History

Add --show-program-output option to shell tests.

When used --show-program-output shows the output from the programs run during testing.

Tom Finegan committed 12 years ago

Commit 1d29ce51 parent 66537695 files · +30 −20Browse files

Unified · Split

5 files
  1. test/decode_to_md5.sh +9 −8
  2. test/decode_with_drops.sh +1 −1
  3. test/simple_decoder.sh +1 −1
  4. test/simple_encoder.sh +3 −2
  5. test/tools_common.sh +16 −8
test/decode_to_md5.sh+9−8
@@ -24,22 +24,25 @@ decode_to_md5_verify_environment() { · 23 unmodified lines
2424 fi
2525 }
2626
27−# Runs decode_to_md5 on $1 and echoes the MD5 sum for the final frame. $2 is
28−# interpreted as codec name and used solely to name the output file.
27+# Runs decode_to_md5 on $1 and captures the md5 sum for the final frame. $2 is
28+# interpreted as codec name and used solely to name the output file. $3 is the
29+# expected md5 sum: It must match that of the final frame.
2930 decode_to_md5() {
3031 local decoder="${LIBVPX_BIN_PATH}/decode_to_md5${VPX_TEST_EXE_SUFFIX}"
3132 local input_file="$1"
3233 local codec="$2"
34+ local expected_md5="$3"
3335 local output_file="${VPX_TEST_OUTPUT_DIR}/decode_to_md5_${codec}"
3436
3537 [ -x "${decoder}" ] || return 1
3638
37− "${decoder}" "${input_file}" "${output_file}" > /dev/null 2>&1
39+ eval "${decoder}" "${input_file}" "${output_file}" ${devnull}
3840
3941 [ -e "${output_file}" ] || return 1
4042
4143 local md5_last_frame=$(tail -n1 "${output_file}")
42− echo "${md5_last_frame% *}" | tr -d [:space:]
44+ local actual_md5=$(echo "${md5_last_frame% *}" | tr -d [:space:])
45+ [ "${actual_md5}" = "${expected_md5}" ] || return 1
4346 }
4447
4548 decode_to_md5_vp8() {
@@ -47,8 +50,7 @@ decode_to_md5_vp8() { · 1 unmodified line
4750 local expected_md5="56794d911b02190212bca92f88ad60c6"
4851
4952 if [ "$(vp8_decode_available)" = "yes" ]; then
50− local actual_md5="$(decode_to_md5 "${VP8_IVF_FILE}" vp8)" || return 1
51− [ "${actual_md5}" = "${expected_md5}" ] || return 1
53+ decode_to_md5 "${VP8_IVF_FILE}" "vp8" "${expected_md5}"
5254 fi
5355 }
5456
@@ -57,8 +59,7 @@ decode_to_md5_vp9() { · 2 unmodified lines
5759 local expected_md5="2952c0eae93f3dadd1aa84c50d3fd6d2"
5860
5961 if [ "$(vp9_decode_available)" = "yes" ]; then
60− local actual_md5="$(decode_to_md5 "${VP9_IVF_FILE}" vp9)" || return 1
61− [ "${actual_md5}" = "${expected_md5}" ] || return 1
62+ decode_to_md5 "${VP9_IVF_FILE}" "vp9" "${expected_md5}"
6263 fi
6364 }
6465
test/decode_with_drops.sh+1−1
@@ -36,7 +36,7 @@ decode_with_drops() { · 35 unmodified lines
3636
3737 [ -x "${decoder}" ] || return 1
3838
39− "${decoder}" "${input_file}" "${output_file}" "${drop_mode}" > /dev/null 2>&1
39+ eval "${decoder}" "${input_file}" "${output_file}" "${drop_mode}" ${devnull}
4040
4141 [ -e "${output_file}" ] || return 1
4242 }
test/simple_decoder.sh+1−1
@@ -34,7 +34,7 @@ simple_decoder() { · 33 unmodified lines
3434
3535 [ -x "${decoder}" ] || return 1
3636
37− "${decoder}" "${input_file}" "${output_file}" > /dev/null 2>&1
37+ eval "${decoder}" "${input_file}" "${output_file}" ${devnull}
3838
3939 [ -e "${output_file}" ] || return 1
4040 }
test/simple_encoder.sh+3−2
@@ -31,8 +31,9 @@ simple_encoder() { · 30 unmodified lines
3131
3232 [ -x "${encoder}" ] || return 1
3333
34− "${encoder}" "${codec}" "${YUV_RAW_INPUT_WIDTH}" "${YUV_RAW_INPUT_HEIGHT}" \
35− "${YUV_RAW_INPUT}" "${output_file}" 9999 > /dev/null 2>&1
34+ eval "${encoder}" "${codec}" "${YUV_RAW_INPUT_WIDTH}" \
35+ "${YUV_RAW_INPUT_HEIGHT}" "${YUV_RAW_INPUT}" "${output_file}" 9999 \
36+ ${devnull}
3637
3738 [ -e "${output_file}" ] || return 1
3839 }
test/tools_common.sh+16−8
@@ -15,6 +15,7 @@ if [ -z "${VPX_TEST_TOOLS_COMMON_SH}" ]; then · 14 unmodified lines
1515 VPX_TEST_TOOLS_COMMON_SH=included
1616
1717 set -e
18+devnull='> /dev/null 2>&1'
1819
1920 vlog() {
2021 [ "${VPX_TEST_VERBOSE_OUTPUT}" = "yes" ] && echo "$@"
@@ -197,9 +198,9 @@ vpxdec() { · 176 unmodified lines
197198 local decoder="${LIBVPX_BIN_PATH}/vpxdec${VPX_TEST_EXE_SUFFIX}"
198199
199200 if [ -z "${pipe_input}" ]; then
200− "${decoder}" "$input" --summary --noblit "$@" > /dev/null 2>&1
201+ eval "${decoder}" "$input" --summary --noblit "$@" ${devnull}
201202 else
202− cat "${input}" | "${decoder}" - --summary --noblit "$@" > /dev/null 2>&1
203+ cat "${input}" | eval "${decoder}" - --summary --noblit "$@" ${devnull}
203204 fi
204205 }
205206
@@ -245,14 +246,16 @@ vpxenc() { · 39 unmodified lines
245246 fi
246247
247248 if [ -z "${pipe_input}" ]; then
248− "${encoder}" --codec=${codec} --width=${width} --height=${height} \
249+ eval "${encoder}" --codec=${codec} --width=${width} --height=${height} \
249250 --limit=${frames} ${use_ivf} ${extra_flags} --output="${output}" \
250− "${input}" > /dev/null 2>&1
251+ "${input}" \
252+ ${devnull}
251253 else
252254 cat "${input}" \
253− | "${encoder}" --codec=${codec} --width=${width} --height=${height} \
254− --limit=${frames} ${use_ivf} ${extra_flags} --output="${output}" - \
255− > /dev/null 2>&1
255+ | eval "${encoder}" --codec=${codec} --width=${width} \
256+ --height=${height} --limit=${frames} ${use_ivf} ${extra_flags} \
257+ --output="${output}" - \
258+ ${devnull}
256259 fi
257260
258261 if [ ! -e "${output}" ]; then
@@ -336,6 +339,7 @@ cat << EOF · 77 unmodified lines
336339 --run-disabled-tests: Run disabled tests.
337340 --help: Display this message and exit.
338341 --test-data-path <path to libvpx test data directory>
342+ --show-program-output: Shows output from all programs being tested.
339343 --verbose: Verbose output.
340344
341345 When the --bin-path option is not specified the script attempts to use
@@ -388,6 +392,9 @@ while [ -n "$1" ]; do · 46 unmodified lines
388392 --verbose)
389393 VPX_TEST_VERBOSE_OUTPUT=yes
390394 ;;
395+ --show-program-output)
396+ devnull=
397+ ;;
391398 *)
392399 vpx_test_usage
393400 exit 1
@@ -445,6 +452,7 @@ vlog "$(basename "${0%.*}") test configuration: · 51 unmodified lines
445452 VPX_TEST_OUTPUT_DIR=${VPX_TEST_OUTPUT_DIR}
446453 VPX_TEST_VERBOSE_OUTPUT=${VPX_TEST_VERBOSE_OUTPUT}
447454 VPX_TEST_FILTER=${VPX_TEST_FILTER}
448− VPX_TEST_RUN_DISABLED_TESTS=${VPX_TEST_RUN_DISABLED_TESTS}"
455+ VPX_TEST_RUN_DISABLED_TESTS=${VPX_TEST_RUN_DISABLED_TESTS}
456+ VPX_TEST_SHOW_PROGRAM_OUTPUT=${VPX_TEST_SHOW_PROGRAM_OUTPUT}"
449457
450458 fi # End $VPX_TEST_TOOLS_COMMON_SH pseudo include guard.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t