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
24 fi24 fi
25}25}
26 26
27# Runs decode_to_md5 on $1 and echoes the MD5 sum for the final frame. $2 is27# 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.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.
29decode_to_md5() {30decode_to_md5() {
30 local decoder="${LIBVPX_BIN_PATH}/decode_to_md5${VPX_TEST_EXE_SUFFIX}"31 local decoder="${LIBVPX_BIN_PATH}/decode_to_md5${VPX_TEST_EXE_SUFFIX}"
31 local input_file="$1"32 local input_file="$1"
32 local codec="$2"33 local codec="$2"
34 local expected_md5="$3"
33 local output_file="${VPX_TEST_OUTPUT_DIR}/decode_to_md5_${codec}"35 local output_file="${VPX_TEST_OUTPUT_DIR}/decode_to_md5_${codec}"
34 36
35 [ -x "${decoder}" ] || return 137 [ -x "${decoder}" ] || return 1
36 38
37 "${decoder}" "${input_file}" "${output_file}" > /dev/null 2>&139 eval "${decoder}" "${input_file}" "${output_file}" ${devnull}
38 40
39 [ -e "${output_file}" ] || return 141 [ -e "${output_file}" ] || return 1
40 42
41 local md5_last_frame=$(tail -n1 "${output_file}")43 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
43}46}
44 47
45decode_to_md5_vp8() {48decode_to_md5_vp8() {
@@ -47,8 +50,7 @@ decode_to_md5_vp8() { · 1 unmodified line
47 local expected_md5="56794d911b02190212bca92f88ad60c6"50 local expected_md5="56794d911b02190212bca92f88ad60c6"
48 51
49 if [ "$(vp8_decode_available)" = "yes" ]; then52 if [ "$(vp8_decode_available)" = "yes" ]; then
50 local actual_md5="$(decode_to_md5 "${VP8_IVF_FILE}" vp8)" || return 153 decode_to_md5 "${VP8_IVF_FILE}" "vp8" "${expected_md5}"
51 [ "${actual_md5}" = "${expected_md5}" ] || return 1
52 fi54 fi
53}55}
54 56
@@ -57,8 +59,7 @@ decode_to_md5_vp9() { · 2 unmodified lines
57 local expected_md5="2952c0eae93f3dadd1aa84c50d3fd6d2"59 local expected_md5="2952c0eae93f3dadd1aa84c50d3fd6d2"
58 60
59 if [ "$(vp9_decode_available)" = "yes" ]; then61 if [ "$(vp9_decode_available)" = "yes" ]; then
60 local actual_md5="$(decode_to_md5 "${VP9_IVF_FILE}" vp9)" || return 162 decode_to_md5 "${VP9_IVF_FILE}" "vp9" "${expected_md5}"
61 [ "${actual_md5}" = "${expected_md5}" ] || return 1
62 fi63 fi
63}64}
64 65
test/decode_with_drops.sh+1−1
@@ -36,7 +36,7 @@ decode_with_drops() { · 35 unmodified lines
36 36
37 [ -x "${decoder}" ] || return 137 [ -x "${decoder}" ] || return 1
38 38
39 "${decoder}" "${input_file}" "${output_file}" "${drop_mode}" > /dev/null 2>&139 eval "${decoder}" "${input_file}" "${output_file}" "${drop_mode}" ${devnull}
40 40
41 [ -e "${output_file}" ] || return 141 [ -e "${output_file}" ] || return 1
42}42}
test/simple_decoder.sh+1−1
@@ -34,7 +34,7 @@ simple_decoder() { · 33 unmodified lines
34 34
35 [ -x "${decoder}" ] || return 135 [ -x "${decoder}" ] || return 1
36 36
37 "${decoder}" "${input_file}" "${output_file}" > /dev/null 2>&137 eval "${decoder}" "${input_file}" "${output_file}" ${devnull}
38 38
39 [ -e "${output_file}" ] || return 139 [ -e "${output_file}" ] || return 1
40}40}
test/simple_encoder.sh+3−2
@@ -31,8 +31,9 @@ simple_encoder() { · 30 unmodified lines
31 31
32 [ -x "${encoder}" ] || return 132 [ -x "${encoder}" ] || return 1
33 33
34 "${encoder}" "${codec}" "${YUV_RAW_INPUT_WIDTH}" "${YUV_RAW_INPUT_HEIGHT}" \34 eval "${encoder}" "${codec}" "${YUV_RAW_INPUT_WIDTH}" \
35 "${YUV_RAW_INPUT}" "${output_file}" 9999 > /dev/null 2>&135 "${YUV_RAW_INPUT_HEIGHT}" "${YUV_RAW_INPUT}" "${output_file}" 9999 \
36 ${devnull}
36 37
37 [ -e "${output_file}" ] || return 138 [ -e "${output_file}" ] || return 1
38}39}
test/tools_common.sh+16−8
@@ -15,6 +15,7 @@ if [ -z "${VPX_TEST_TOOLS_COMMON_SH}" ]; then · 14 unmodified lines
15VPX_TEST_TOOLS_COMMON_SH=included15VPX_TEST_TOOLS_COMMON_SH=included
16 16
17set -e17set -e
18devnull='> /dev/null 2>&1'
18 19
19vlog() {20vlog() {
20 [ "${VPX_TEST_VERBOSE_OUTPUT}" = "yes" ] && echo "$@"21 [ "${VPX_TEST_VERBOSE_OUTPUT}" = "yes" ] && echo "$@"
@@ -197,9 +198,9 @@ vpxdec() { · 176 unmodified lines
197 local decoder="${LIBVPX_BIN_PATH}/vpxdec${VPX_TEST_EXE_SUFFIX}"198 local decoder="${LIBVPX_BIN_PATH}/vpxdec${VPX_TEST_EXE_SUFFIX}"
198 199
199 if [ -z "${pipe_input}" ]; then200 if [ -z "${pipe_input}" ]; then
200 "${decoder}" "$input" --summary --noblit "$@" > /dev/null 2>&1201 eval "${decoder}" "$input" --summary --noblit "$@" ${devnull}
201 else202 else
202 cat "${input}" | "${decoder}" - --summary --noblit "$@" > /dev/null 2>&1203 cat "${input}" | eval "${decoder}" - --summary --noblit "$@" ${devnull}
203 fi204 fi
204}205}
205 206
@@ -245,14 +246,16 @@ vpxenc() { · 39 unmodified lines
245 fi246 fi
246 247
247 if [ -z "${pipe_input}" ]; then248 if [ -z "${pipe_input}" ]; then
248 "${encoder}" --codec=${codec} --width=${width} --height=${height} \249 eval "${encoder}" --codec=${codec} --width=${width} --height=${height} \
249 --limit=${frames} ${use_ivf} ${extra_flags} --output="${output}" \250 --limit=${frames} ${use_ivf} ${extra_flags} --output="${output}" \
250 "${input}" > /dev/null 2>&1251 "${input}" \
252 ${devnull}
251 else253 else
252 cat "${input}" \254 cat "${input}" \
253 | "${encoder}" --codec=${codec} --width=${width} --height=${height} \255 | eval "${encoder}" --codec=${codec} --width=${width} \
254 --limit=${frames} ${use_ivf} ${extra_flags} --output="${output}" - \256 --height=${height} --limit=${frames} ${use_ivf} ${extra_flags} \
255 > /dev/null 2>&1257 --output="${output}" - \
258 ${devnull}
256 fi259 fi
257 260
258 if [ ! -e "${output}" ]; then261 if [ ! -e "${output}" ]; then
@@ -336,6 +339,7 @@ cat << EOF · 77 unmodified lines
336 --run-disabled-tests: Run disabled tests.339 --run-disabled-tests: Run disabled tests.
337 --help: Display this message and exit.340 --help: Display this message and exit.
338 --test-data-path <path to libvpx test data directory>341 --test-data-path <path to libvpx test data directory>
342 --show-program-output: Shows output from all programs being tested.
339 --verbose: Verbose output.343 --verbose: Verbose output.
340 344
341 When the --bin-path option is not specified the script attempts to use345 When the --bin-path option is not specified the script attempts to use
@@ -388,6 +392,9 @@ while [ -n "$1" ]; do · 46 unmodified lines
388 --verbose)392 --verbose)
389 VPX_TEST_VERBOSE_OUTPUT=yes393 VPX_TEST_VERBOSE_OUTPUT=yes
390 ;;394 ;;
395 --show-program-output)
396 devnull=
397 ;;
391 *)398 *)
392 vpx_test_usage399 vpx_test_usage
393 exit 1400 exit 1
@@ -445,6 +452,7 @@ vlog "$(basename "${0%.*}") test configuration: · 51 unmodified lines
445 VPX_TEST_OUTPUT_DIR=${VPX_TEST_OUTPUT_DIR}452 VPX_TEST_OUTPUT_DIR=${VPX_TEST_OUTPUT_DIR}
446 VPX_TEST_VERBOSE_OUTPUT=${VPX_TEST_VERBOSE_OUTPUT}453 VPX_TEST_VERBOSE_OUTPUT=${VPX_TEST_VERBOSE_OUTPUT}
447 VPX_TEST_FILTER=${VPX_TEST_FILTER}454 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}"
449 457
450fi # End $VPX_TEST_TOOLS_COMMON_SH pseudo include guard.458fi # 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