| 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 vp9_encode_available() { | 193 vp9_encode_available() { |
| 194 [ "$(vpx_config_option_enabled CONFIG_VP9_ENCODER)" = "yes" ] && echo yes | 194 [ "$(vpx_config_option_enabled CONFIG_VP9_ENCODER)" = "yes" ] && echo yes |
| 195 } | 195 } |
| 196 | 196 |
| 197 # Echoes yes to stdout when vpx_config_option_enabled() reports yes for | 197 # Echoes yes to stdout when vpx_config_option_enabled() reports yes for |
| 198 # CONFIG_WEBM_IO. | 198 # CONFIG_WEBM_IO. |
| 199 webm_io_available() { | 199 webm_io_available() { |
| 200 [ "$(vpx_config_option_enabled CONFIG_WEBM_IO)" = "yes" ] && echo yes | 200 [ "$(vpx_config_option_enabled CONFIG_WEBM_IO)" = "yes" ] && echo yes |
| 201 } | 201 } |
| 202 | 202 |
| 203 # Filters strings from positional parameter one using the filter specified by | 203 # Filters strings from $1 using the filter specified by $2. Filter behavior |
| 204 # positional parameter two. Filter behavior depends on the presence of a third | 204 # depends on the presence of $3. When $3 is present, strings that match the |
| 205 # positional parameter. When parameter three is present, strings that match the | 205 # filter are excluded. When $3 is omitted, strings matching the filter are |
| 206 # filter are excluded. When omitted, strings matching the filter are included. | 206 # included. |
| 207 # The filtered string is echoed to stdout. | 207 # The filtered result is echoed to stdout. |
| 208 filter_strings() { | 208 filter_strings() { |
| 209 strings=${1} | 209 strings=${1} |
| 210 filter=${2} | 210 filter=${2} |
| 211 exclude=${3} | 211 exclude=${3} |
| 212 | 212 |
| 213 if [ -n "${exclude}" ]; then | 213 if [ -n "${exclude}" ]; then |
| 214 # When positional parameter three exists the caller wants to remove strings. | 214 # When positional parameter three exists the caller wants to remove strings. |
| 215 # Tell grep to invert matches using the -v argument. | 215 # Tell grep to invert matches using the -v argument. |
| 216 exclude='-v' | 216 exclude='-v' |
| 217 else | 217 else |
| (...skipping 28 matching lines...) Expand all Loading... |
| 246 if [ "${VPX_TEST_RUN_DISABLED_TESTS}" != "yes" ]; then | 246 if [ "${VPX_TEST_RUN_DISABLED_TESTS}" != "yes" ]; then |
| 247 # Filter out DISABLED tests. | 247 # Filter out DISABLED tests. |
| 248 tests_to_filter=$(filter_strings "${tests_to_filter}" ^DISABLED exclude) | 248 tests_to_filter=$(filter_strings "${tests_to_filter}" ^DISABLED exclude) |
| 249 fi | 249 fi |
| 250 | 250 |
| 251 if [ -n "${VPX_TEST_FILTER}" ]; then | 251 if [ -n "${VPX_TEST_FILTER}" ]; then |
| 252 # Remove tests not matching the user's filter. | 252 # Remove tests not matching the user's filter. |
| 253 tests_to_filter=$(filter_strings "${tests_to_filter}" ${VPX_TEST_FILTER}) | 253 tests_to_filter=$(filter_strings "${tests_to_filter}" ${VPX_TEST_FILTER}) |
| 254 fi | 254 fi |
| 255 | 255 |
| 256 # User requested test listing: Dump test names and return. |
| 257 if [ "${VPX_TEST_LIST_TESTS}" = "yes" ]; then |
| 258 for test_name in $tests_to_filter; do |
| 259 echo ${test_name} |
| 260 done |
| 261 return |
| 262 fi |
| 263 |
| 264 # Combine environment and actual tests. |
| 256 local tests_to_run="${env_tests} ${tests_to_filter}" | 265 local tests_to_run="${env_tests} ${tests_to_filter}" |
| 257 | 266 |
| 258 check_git_hashes | 267 check_git_hashes |
| 259 | 268 |
| 260 # Run tests. | 269 # Run tests. |
| 261 for test in ${tests_to_run}; do | 270 for test in ${tests_to_run}; do |
| 262 test_begin "${test}" | 271 test_begin "${test}" |
| 263 vlog " RUN ${test}" | 272 vlog " RUN ${test}" |
| 264 "${test}" | 273 "${test}" |
| 265 vlog " PASS ${test}" | 274 vlog " PASS ${test}" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 276 --bin-path <path to libvpx binaries directory> | 285 --bin-path <path to libvpx binaries directory> |
| 277 --config-path <path to libvpx config directory> | 286 --config-path <path to libvpx config directory> |
| 278 --filter <filter>: User test filter. Only tests matching filter are run. | 287 --filter <filter>: User test filter. Only tests matching filter are run. |
| 279 --run-disabled-tests: Run disabled tests. | 288 --run-disabled-tests: Run disabled tests. |
| 280 --help: Display this message and exit. | 289 --help: Display this message and exit. |
| 281 --test-data-path <path to libvpx test data directory> | 290 --test-data-path <path to libvpx test data directory> |
| 282 --show-program-output: Shows output from all programs being tested. | 291 --show-program-output: Shows output from all programs being tested. |
| 283 --prefix: Allows for a user specified prefix to be inserted before all test | 292 --prefix: Allows for a user specified prefix to be inserted before all test |
| 284 programs. Grants the ability, for example, to run test programs | 293 programs. Grants the ability, for example, to run test programs |
| 285 within valgrind. | 294 within valgrind. |
| 295 --list-tests: List all test names and exit without actually running tests. |
| 286 --verbose: Verbose output. | 296 --verbose: Verbose output. |
| 287 | 297 |
| 288 When the --bin-path option is not specified the script attempts to use | 298 When the --bin-path option is not specified the script attempts to use |
| 289 \$LIBVPX_BIN_PATH and then the current directory. | 299 \$LIBVPX_BIN_PATH and then the current directory. |
| 290 | 300 |
| 291 When the --config-path option is not specified the script attempts to use | 301 When the --config-path option is not specified the script attempts to use |
| 292 \$LIBVPX_CONFIG_PATH and then the current directory. | 302 \$LIBVPX_CONFIG_PATH and then the current directory. |
| 293 | 303 |
| 294 When the -test-data-path option is not specified the script attempts to use | 304 When the -test-data-path option is not specified the script attempts to use |
| 295 \$LIBVPX_TEST_DATA_PATH and then the current directory. | 305 \$LIBVPX_TEST_DATA_PATH and then the current directory. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 --prefix) | 345 --prefix) |
| 336 VPX_TEST_PREFIX="$2" | 346 VPX_TEST_PREFIX="$2" |
| 337 shift | 347 shift |
| 338 ;; | 348 ;; |
| 339 --verbose) | 349 --verbose) |
| 340 VPX_TEST_VERBOSE_OUTPUT=yes | 350 VPX_TEST_VERBOSE_OUTPUT=yes |
| 341 ;; | 351 ;; |
| 342 --show-program-output) | 352 --show-program-output) |
| 343 devnull= | 353 devnull= |
| 344 ;; | 354 ;; |
| 355 --list-tests) |
| 356 VPX_TEST_LIST_TESTS=yes |
| 357 ;; |
| 345 *) | 358 *) |
| 346 vpx_test_usage | 359 vpx_test_usage |
| 347 exit 1 | 360 exit 1 |
| 348 ;; | 361 ;; |
| 349 esac | 362 esac |
| 350 shift | 363 shift |
| 351 done | 364 done |
| 352 | 365 |
| 353 # Handle running the tests from a build directory without arguments when running | 366 # Handle running the tests from a build directory without arguments when running |
| 354 # the tests on *nix/macosx. | 367 # the tests on *nix/macosx. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 | 407 |
| 395 vlog "$(basename "${0%.*}") test configuration: | 408 vlog "$(basename "${0%.*}") test configuration: |
| 396 LIBVPX_BIN_PATH=${LIBVPX_BIN_PATH} | 409 LIBVPX_BIN_PATH=${LIBVPX_BIN_PATH} |
| 397 LIBVPX_CONFIG_PATH=${LIBVPX_CONFIG_PATH} | 410 LIBVPX_CONFIG_PATH=${LIBVPX_CONFIG_PATH} |
| 398 LIBVPX_TEST_DATA_PATH=${LIBVPX_TEST_DATA_PATH} | 411 LIBVPX_TEST_DATA_PATH=${LIBVPX_TEST_DATA_PATH} |
| 399 VP8_IVF_FILE=${VP8_IVF_FILE} | 412 VP8_IVF_FILE=${VP8_IVF_FILE} |
| 400 VP9_IVF_FILE=${VP9_IVF_FILE} | 413 VP9_IVF_FILE=${VP9_IVF_FILE} |
| 401 VP9_WEBM_FILE=${VP9_WEBM_FILE} | 414 VP9_WEBM_FILE=${VP9_WEBM_FILE} |
| 402 VPX_TEST_EXE_SUFFIX=${VPX_TEST_EXE_SUFFIX} | 415 VPX_TEST_EXE_SUFFIX=${VPX_TEST_EXE_SUFFIX} |
| 403 VPX_TEST_FILTER=${VPX_TEST_FILTER} | 416 VPX_TEST_FILTER=${VPX_TEST_FILTER} |
| 417 VPX_TEST_LIST_TESTS=${VPX_TEST_LIST_TESTS} |
| 404 VPX_TEST_OUTPUT_DIR=${VPX_TEST_OUTPUT_DIR} | 418 VPX_TEST_OUTPUT_DIR=${VPX_TEST_OUTPUT_DIR} |
| 405 VPX_TEST_PREFIX=${VPX_TEST_PREFIX} | 419 VPX_TEST_PREFIX=${VPX_TEST_PREFIX} |
| 406 VPX_TEST_RAND=${VPX_TEST_RAND} | 420 VPX_TEST_RAND=${VPX_TEST_RAND} |
| 407 VPX_TEST_RUN_DISABLED_TESTS=${VPX_TEST_RUN_DISABLED_TESTS} | 421 VPX_TEST_RUN_DISABLED_TESTS=${VPX_TEST_RUN_DISABLED_TESTS} |
| 408 VPX_TEST_SHOW_PROGRAM_OUTPUT=${VPX_TEST_SHOW_PROGRAM_OUTPUT} | 422 VPX_TEST_SHOW_PROGRAM_OUTPUT=${VPX_TEST_SHOW_PROGRAM_OUTPUT} |
| 409 VPX_TEST_TEMP_ROOT=${VPX_TEST_TEMP_ROOT} | 423 VPX_TEST_TEMP_ROOT=${VPX_TEST_TEMP_ROOT} |
| 410 VPX_TEST_VERBOSE_OUTPUT=${VPX_TEST_VERBOSE_OUTPUT} | 424 VPX_TEST_VERBOSE_OUTPUT=${VPX_TEST_VERBOSE_OUTPUT} |
| 411 YUV_RAW_INPUT=${YUV_RAW_INPUT} | 425 YUV_RAW_INPUT=${YUV_RAW_INPUT} |
| 412 YUV_RAW_INPUT_WIDTH=${YUV_RAW_INPUT_WIDTH} | 426 YUV_RAW_INPUT_WIDTH=${YUV_RAW_INPUT_WIDTH} |
| 413 YUV_RAW_INPUT_HEIGHT=${YUV_RAW_INPUT_HEIGHT}" | 427 YUV_RAW_INPUT_HEIGHT=${YUV_RAW_INPUT_HEIGHT}" |
| 414 | 428 |
| 415 fi # End $VPX_TEST_TOOLS_COMMON_SH pseudo include guard. | 429 fi # End $VPX_TEST_TOOLS_COMMON_SH pseudo include guard. |
| OLD | NEW |