| OLD | NEW | 
|    1 #!/bin/sh |    1 #!/bin/sh | 
|    2 ## |    2 ## | 
|    3 ##  Copyright (c) 2014 The WebM project authors. All Rights Reserved. |    3 ##  Copyright (c) 2014 The WebM project authors. All Rights Reserved. | 
|    4 ## |    4 ## | 
|    5 ##  Use of this source code is governed by a BSD-style license |    5 ##  Use of this source code is governed by a BSD-style license | 
|    6 ##  that can be found in the LICENSE file in the root of the source |    6 ##  that can be found in the LICENSE file in the root of the source | 
|    7 ##  tree. An additional intellectual property rights grant can be found |    7 ##  tree. An additional intellectual property rights grant can be found | 
|    8 ##  in the file PATENTS.  All contributing project authors may |    8 ##  in the file PATENTS.  All contributing project authors may | 
|    9 ##  be found in the AUTHORS file in the root of the source tree. |    9 ##  be found in the AUTHORS file in the root of the source tree. | 
|   10 ## |   10 ## | 
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   99 # current git hash. |   99 # current git hash. | 
|  100 check_git_hashes() { |  100 check_git_hashes() { | 
|  101   hash_at_configure_time=$(config_hash) |  101   hash_at_configure_time=$(config_hash) | 
|  102   hash_now=$(current_hash) |  102   hash_now=$(current_hash) | 
|  103  |  103  | 
|  104   if [ "${hash_at_configure_time}" != "${hash_now}" ]; then |  104   if [ "${hash_at_configure_time}" != "${hash_now}" ]; then | 
|  105     echo "Warning: git hash has changed since last configure." |  105     echo "Warning: git hash has changed since last configure." | 
|  106   fi |  106   fi | 
|  107 } |  107 } | 
|  108  |  108  | 
 |  109 # $1 is the name of an environment variable containing a directory name to | 
 |  110 # test. | 
 |  111 test_env_var_dir() { | 
 |  112   local dir=$(eval echo "\${$1}") | 
 |  113   if [ ! -d "${dir}" ]; then | 
 |  114     elog "'${dir}': No such directory" | 
 |  115     elog "The $1 environment variable must be set to a valid directory." | 
 |  116     return 1 | 
 |  117   fi | 
 |  118 } | 
 |  119  | 
|  109 # This script requires that the LIBVPX_BIN_PATH, LIBVPX_CONFIG_PATH, and |  120 # This script requires that the LIBVPX_BIN_PATH, LIBVPX_CONFIG_PATH, and | 
|  110 # LIBVPX_TEST_DATA_PATH variables are in the environment: Confirm that |  121 # LIBVPX_TEST_DATA_PATH variables are in the environment: Confirm that | 
|  111 # the variables are set and that they all evaluate to directory paths. |  122 # the variables are set and that they all evaluate to directory paths. | 
|  112 verify_vpx_test_environment() { |  123 verify_vpx_test_environment() { | 
|  113   if [ ! -d "${LIBVPX_BIN_PATH}" ]; then |  124   test_env_var_dir "LIBVPX_BIN_PATH" \ | 
|  114     echo "The LIBVPX_BIN_PATH environment variable must be set." |  125     && test_env_var_dir "LIBVPX_CONFIG_PATH" \ | 
|  115     return 1 |  126     && test_env_var_dir "LIBVPX_TEST_DATA_PATH" | 
|  116   fi |  | 
|  117   if [ ! -d "${LIBVPX_CONFIG_PATH}" ]; then |  | 
|  118     echo "The LIBVPX_CONFIG_PATH environment variable must be set." |  | 
|  119     return 1 |  | 
|  120   fi |  | 
|  121   if [ ! -d "${LIBVPX_TEST_DATA_PATH}" ]; then |  | 
|  122     echo "The LIBVPX_TEST_DATA_PATH environment variable must be set." |  | 
|  123     return 1 |  | 
|  124   fi |  | 
|  125 } |  127 } | 
|  126  |  128  | 
|  127 # Greps vpx_config.h in LIBVPX_CONFIG_PATH for positional parameter one, which |  129 # Greps vpx_config.h in LIBVPX_CONFIG_PATH for positional parameter one, which | 
|  128 # should be a LIBVPX preprocessor flag. Echoes yes to stdout when the feature |  130 # should be a LIBVPX preprocessor flag. Echoes yes to stdout when the feature | 
|  129 # is available. |  131 # is available. | 
|  130 vpx_config_option_enabled() { |  132 vpx_config_option_enabled() { | 
|  131   vpx_config_option="${1}" |  133   vpx_config_option="${1}" | 
|  132   vpx_config_file="${LIBVPX_CONFIG_PATH}/vpx_config.h" |  134   vpx_config_file="${LIBVPX_CONFIG_PATH}/vpx_config.h" | 
|  133   config_line=$(grep "${vpx_config_option}" "${vpx_config_file}") |  135   config_line=$(grep "${vpx_config_option}" "${vpx_config_file}") | 
|  134   if echo "${config_line}" | egrep -q '1$'; then |  136   if echo "${config_line}" | egrep -q '1$'; then | 
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  374  |  376  | 
|  375 # Create a temporary directory for output files, and a trap to clean it up. |  377 # Create a temporary directory for output files, and a trap to clean it up. | 
|  376 if [ -n "${TMPDIR}" ]; then |  378 if [ -n "${TMPDIR}" ]; then | 
|  377   VPX_TEST_TEMP_ROOT="${TMPDIR}" |  379   VPX_TEST_TEMP_ROOT="${TMPDIR}" | 
|  378 elif [ -n "${TEMPDIR}" ]; then |  380 elif [ -n "${TEMPDIR}" ]; then | 
|  379   VPX_TEST_TEMP_ROOT="${TEMPDIR}" |  381   VPX_TEST_TEMP_ROOT="${TEMPDIR}" | 
|  380 else |  382 else | 
|  381   VPX_TEST_TEMP_ROOT=/tmp |  383   VPX_TEST_TEMP_ROOT=/tmp | 
|  382 fi |  384 fi | 
|  383  |  385  | 
|  384 VPX_TEST_RAND=$(awk 'BEGIN { srand(); printf "%d\n",(rand() * 32768)}') |  386 VPX_TEST_OUTPUT_DIR="${VPX_TEST_TEMP_ROOT}/vpx_test_$$" | 
|  385 VPX_TEST_OUTPUT_DIR="${VPX_TEST_TEMP_ROOT}/vpx_test_${VPX_TEST_RAND}" |  | 
|  386  |  387  | 
|  387 if ! mkdir -p "${VPX_TEST_OUTPUT_DIR}" || \ |  388 if ! mkdir -p "${VPX_TEST_OUTPUT_DIR}" || \ | 
|  388    [ ! -d "${VPX_TEST_OUTPUT_DIR}" ]; then |  389    [ ! -d "${VPX_TEST_OUTPUT_DIR}" ]; then | 
|  389   echo "${0##*/}: Cannot create output directory, giving up." |  390   echo "${0##*/}: Cannot create output directory, giving up." | 
|  390   echo "${0##*/}:   VPX_TEST_OUTPUT_DIR=${VPX_TEST_OUTPUT_DIR}" |  391   echo "${0##*/}:   VPX_TEST_OUTPUT_DIR=${VPX_TEST_OUTPUT_DIR}" | 
|  391   exit 1 |  392   exit 1 | 
|  392 fi |  393 fi | 
|  393  |  394  | 
|  394 if [ "$(is_windows_target)" = "yes" ]; then |  395 if [ "$(is_windows_target)" = "yes" ]; then | 
|  395   VPX_TEST_EXE_SUFFIX=".exe" |  396   VPX_TEST_EXE_SUFFIX=".exe" | 
| (...skipping 17 matching lines...) Expand all  Loading... | 
|  413   LIBVPX_CONFIG_PATH=${LIBVPX_CONFIG_PATH} |  414   LIBVPX_CONFIG_PATH=${LIBVPX_CONFIG_PATH} | 
|  414   LIBVPX_TEST_DATA_PATH=${LIBVPX_TEST_DATA_PATH} |  415   LIBVPX_TEST_DATA_PATH=${LIBVPX_TEST_DATA_PATH} | 
|  415   VP8_IVF_FILE=${VP8_IVF_FILE} |  416   VP8_IVF_FILE=${VP8_IVF_FILE} | 
|  416   VP9_IVF_FILE=${VP9_IVF_FILE} |  417   VP9_IVF_FILE=${VP9_IVF_FILE} | 
|  417   VP9_WEBM_FILE=${VP9_WEBM_FILE} |  418   VP9_WEBM_FILE=${VP9_WEBM_FILE} | 
|  418   VPX_TEST_EXE_SUFFIX=${VPX_TEST_EXE_SUFFIX} |  419   VPX_TEST_EXE_SUFFIX=${VPX_TEST_EXE_SUFFIX} | 
|  419   VPX_TEST_FILTER=${VPX_TEST_FILTER} |  420   VPX_TEST_FILTER=${VPX_TEST_FILTER} | 
|  420   VPX_TEST_LIST_TESTS=${VPX_TEST_LIST_TESTS} |  421   VPX_TEST_LIST_TESTS=${VPX_TEST_LIST_TESTS} | 
|  421   VPX_TEST_OUTPUT_DIR=${VPX_TEST_OUTPUT_DIR} |  422   VPX_TEST_OUTPUT_DIR=${VPX_TEST_OUTPUT_DIR} | 
|  422   VPX_TEST_PREFIX=${VPX_TEST_PREFIX} |  423   VPX_TEST_PREFIX=${VPX_TEST_PREFIX} | 
|  423   VPX_TEST_RAND=${VPX_TEST_RAND} |  | 
|  424   VPX_TEST_RUN_DISABLED_TESTS=${VPX_TEST_RUN_DISABLED_TESTS} |  424   VPX_TEST_RUN_DISABLED_TESTS=${VPX_TEST_RUN_DISABLED_TESTS} | 
|  425   VPX_TEST_SHOW_PROGRAM_OUTPUT=${VPX_TEST_SHOW_PROGRAM_OUTPUT} |  425   VPX_TEST_SHOW_PROGRAM_OUTPUT=${VPX_TEST_SHOW_PROGRAM_OUTPUT} | 
|  426   VPX_TEST_TEMP_ROOT=${VPX_TEST_TEMP_ROOT} |  426   VPX_TEST_TEMP_ROOT=${VPX_TEST_TEMP_ROOT} | 
|  427   VPX_TEST_VERBOSE_OUTPUT=${VPX_TEST_VERBOSE_OUTPUT} |  427   VPX_TEST_VERBOSE_OUTPUT=${VPX_TEST_VERBOSE_OUTPUT} | 
|  428   YUV_RAW_INPUT=${YUV_RAW_INPUT} |  428   YUV_RAW_INPUT=${YUV_RAW_INPUT} | 
|  429   YUV_RAW_INPUT_WIDTH=${YUV_RAW_INPUT_WIDTH} |  429   YUV_RAW_INPUT_WIDTH=${YUV_RAW_INPUT_WIDTH} | 
|  430   YUV_RAW_INPUT_HEIGHT=${YUV_RAW_INPUT_HEIGHT}" |  430   YUV_RAW_INPUT_HEIGHT=${YUV_RAW_INPUT_HEIGHT}" | 
|  431  |  431  | 
|  432 fi  # End $VPX_TEST_TOOLS_COMMON_SH pseudo include guard. |  432 fi  # End $VPX_TEST_TOOLS_COMMON_SH pseudo include guard. | 
| OLD | NEW |