summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2017-11-14 22:45:57 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2017-11-14 22:45:57 +0800
commit38a69fd7fc55f01683c6abf6df06aed8479cee85 (patch)
tree3e762f3af57bb6465538acd24638829abd193dec
parent30393cde2af9b21fae3327dbd0e91f0bd761b922 (diff)
downloadlinaro-android-userspace-test-linaro-oreo.tar.gz
update to work with oreo buildslinaro-oreo
1. use libstagefright_mp3dec_test under data nativetest directory 2. remove test for libstagefright_h264enc_test since it's removed from upstream 3. apply changes in test-definitions, so that test-definitions could use this script directly Change-Id: I30c2a97762f8043cdad85b8364abf507874d9c7f Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rwxr-xr-xlinaro-android-userspace-tests.sh119
-rw-r--r--product.mk1
2 files changed, 15 insertions, 105 deletions
diff --git a/linaro-android-userspace-tests.sh b/linaro-android-userspace-tests.sh
index 0ab464f..d1f0c5e 100755
--- a/linaro-android-userspace-tests.sh
+++ b/linaro-android-userspace-tests.sh
@@ -1,4 +1,9 @@
#!/system/bin/sh
+# shellcheck disable=SC2039
+# shellcheck disable=SC2086
+# shellcheck disable=SC2181
+# shellcheck disable=SC2155
+# shellcheck disable=SC2166
#############################################################################
# Copyright (c) 2014 Linaro
# All rights reserved. This program and the accompanying materials
@@ -15,8 +20,7 @@ ALL_AUDIO_CODECS="audio_codec_aac audio_codec_flac audio_codec_mp3 \
audio_codec_tremolo"
ALL_SPEECH_CODECS="speech_codec_amrnb_dec speech_codec_amrnb_enc \
speech_codec_amrwb_dec speech_codec_amrwb_enc"
-ALL_VIDEO_CODECS="video_codec_h264_dec video_codec_h264_enc \
- video_codec_h263_dec video_codec_h263_enc"
+ALL_VIDEO_CODECS="video_codec_h264_dec video_codec_h263_dec video_codec_h263_enc"
ALL_CODECS="${ALL_AUDIO_CODECS} ${ALL_SPEECH_CODECS} ${ALL_VIDEO_CODECS}"
ALL_TESTS="${ALL_CODECS}"
@@ -29,9 +33,9 @@ ALL_TESTS_OPT="all_tests"
func_md5(){
if [ -n "$(which md5)" ]; then
- md5 $@
+ md5 "$@"
else
- md5sum $@
+ md5sum "$@"
fi
}
@@ -55,7 +59,7 @@ usage() {
printf " %-10s\t%s\n" "-v" "Turn on verbose output"
echo
echo "Example:"
- echo "\t$0 -t \"audio_codec_aac speech_codec_amrnb_dec\""
+ printf "\t%s -t \"audio_codec_aac speech_codec_amrnb_dec\"\n" "$0"
}
run_audio_codec_aac()
@@ -126,6 +130,7 @@ run_audio_codec_mp3()
local TEST_FILE="/data/linaro-android-userspace-test/audio-codec/Retribution.mp3"
local OUT_FILE="/data/local/tmp/audio-codec-test.out"
local EXPECTED_MD5SUM="bf1456a93dfc53e474c30c9fca75c647"
+ local CMD_PATH="/data/nativetest/libstagefright_mp3dec_test/libstagefright_mp3dec_test"
echo
echo "Running MP3 decoder test"
@@ -137,9 +142,9 @@ run_audio_codec_mp3()
return 1
fi
if [ "${VERBOSE}" -eq "1" ]; then
- libstagefright_mp3dec_test ${TEST_FILE} ${OUT_FILE}
+ ${CMD_PATH} ${TEST_FILE} ${OUT_FILE}
else
- libstagefright_mp3dec_test ${TEST_FILE} ${OUT_FILE} &> /dev/null
+ ${CMD_PATH} ${TEST_FILE} ${OUT_FILE} &> /dev/null
fi
if [ "$?" -ne "0" ]; then
echo "ERROR: MP3 decoder test returned error"
@@ -233,7 +238,7 @@ run_speech_codec()
echo -n "${TAG}: Decoding and verifying output"
fi
- while read LINE
+ while read -r LINE
do
if [[ "${LINE:0:1}" == "#" ]]; then
continue
@@ -441,100 +446,6 @@ run_video_codec_h264_dec()
return $?
}
-run_video_codec_h264_enc()
-{
- local TAG="video_codec_h264_enc"
- local NAME="H.264 encoder test"
- local DATA_DIR="/data/linaro-android-userspace-test/video-codec/h264"
- local MD5SUM_FILE="${DATA_DIR}/MD5SUM.enc"
- local RUN="libstagefright_h264enc_test"
- local OUT_FILE="/data/local/tmp/video-codec-test.out"
-
- echo
- echo "${TAG}: Running ${NAME}"
- if [ ! -f ${MD5SUM_FILE} ]; then
- echo "${TAG}: ERROR: MD5SUM file '${MD5SUM_FILE}' does not exist"
- echo "${TAG}: ${NAME}: FAILED"
- echo "[${TAG}]: test failed"
- return 1
- fi
-
- echo -n "${TAG}: Encoding and verifying output"
-
- local TEST_FILE=""
- local OUT_WIDTH=""
- local OUT_HEIGHT=""
- local OUT_FRAMERATE=""
- local OUT_BITRATE=""
- local EXPECTED_MD5SUM=""
- local LINE=0
- local result=true
- while read -r TEST_FILE OUT_WIDTH OUT_HEIGHT OUT_FRAMERATE OUT_BITRATE EXPECTED_MD5SUM
- do
- ((LINE++))
-
- # Skip comment or empty lines
- if [[ "${TEST_FILE:0:1}" == "#" ]] || [ -z "${TEST_FILE}" ]; then
- continue
- fi
-
- echo -n "."
-
- if [ -z "${OUT_WIDTH}" -o -z "${OUT_HEIGHT}" -o -z "${OUT_FRAMERATE}" -o -z "${OUT_BITRATE}" -o -z "${EXPECTED_MD5SUM}" ]; then
- echo "${TAG}: ERROR: invalid MD5SUM entry (${MD5SUM_FILE}:${LINE})"
- echo "${TAG}: ${NAME}: FAILED"
- echo "[${TAG}]: test failed"
- return 1
- fi
-
- TEST_FILE="${DATA_DIR}/${TEST_FILE}"
- if [ ! -f ${TEST_FILE} ]; then
- echo "${TAG}: ERROR: test file '${TEST_FILE}' does not exist"
- echo "${TAG}: ${NAME}: FAILED"
- echo "[${TAG}]: test failed"
- return 1
- fi
- local cmd="${RUN} ${TEST_FILE} ${OUT_FILE} ${OUT_WIDTH} ${OUT_HEIGHT} ${OUT_FRAMERATE} ${OUT_BITRATE}"
- if [ "${VERBOSE}" -eq "1" ]; then
- $cmd
- else
- ${cmd} &> /dev/null
- fi
-
- if [ "$?" -ne "0" ]; then
- echo
- echo "${TAG}: ${cmd}"
- echo "${TAG}: ERROR: ${NAME} returned error for ${MD5SUM_FILE}:${LINE}"
- result=false
- continue
- fi
-
- local MD5SUM=$(func_md5 ${OUT_FILE})
- MD5SUM="${MD5SUM%% *}"
- if [[ "${MD5SUM}" != "${EXPECTED_MD5SUM}" ]]; then
- echo
- echo "${TAG}: ${cmd}"
- echo "${TAG}: ERROR: incorrect MD5SUM '${MD5SUM}' (expected '${EXPECTED_MD5SUM}')"
- result=false
- continue
- fi
- done < ${MD5SUM_FILE}
- echo "done"
-
- if [ -f ${OUT_FILE} ]; then
- rm ${OUT_FILE}
- fi
-
- if ${result}; then
- echo "${TAG}: ${NAME}: PASSED"
- echo "[${TAG}]: test passed"
- else
- echo "${TAG}: ${NAME}: FAILED"
- echo "[${TAG}]: test failed"
- fi
- return 0
-}
-
run_video_codec_h263_dec()
{
local TAG="video_codec_h263_dec"
@@ -717,12 +628,12 @@ run_tests() {
# Function names follow the naming convention of:
# run_<test_name>
run_${TEST}
- RET=$(( ${RET} + $? ))
+ RET=$(( RET + $? ))
else
echo
echo "Unrecognized test '${TEST}'"
usage
- RET=$(( ${RET} + 1 ))
+ RET=$(( RET + 1 ))
break
fi
done
diff --git a/product.mk b/product.mk
index e817a61..a2c20ba 100644
--- a/product.mk
+++ b/product.mk
@@ -20,7 +20,6 @@ PRODUCT_PACKAGES += \
libstagefright_amrwbdec_test \
libstagefright_amrwbenc_test \
libstagefright_h264dec_test \
- libstagefright_h264enc_test \
libstagefright_m4vh263dec_test \
libstagefright_m4vh263enc_test