Loading system/test/run_unit_tests.sh +25 −6 Original line number Diff line number Diff line Loading @@ -10,8 +10,11 @@ known_tests=( ) usage() { echo "Usage: $0 [-s <specific device> ][--all|--help|<test name>[.<filter>] ...]" echo "" echo "Usage: $0 --help" echo " $0 [-s <specific device>] [--all] [<test name>[.<filter>] ...] [--<arg> ...]" echo echo "Unknown long arguments are passed to the test." echo echo "Known test names:" for name in ${known_tests[*]} Loading @@ -24,6 +27,17 @@ run_tests() { adb="adb${1:+ -s $1}" shift test_args=() for arg do shift if [ "$arg" == "--" ]; then break else test_args+=( "$arg" ) fi done failed_tests='' for spec in $* do Loading @@ -35,7 +49,7 @@ run_tests() { echo "pushing..." $adb push {$ANDROID_PRODUCT_OUT,}/data/nativetest/$name/$name echo "running..." $adb shell data/nativetest/$name/$name${filter:+ "--gtest_filter=${filter}"} $adb shell data/nativetest/$name/$name${filter:+ "--gtest_filter=${filter}"} ${test_args[*]} if [ $? != 0 ]; then failed_tests="$failed_tests$CR!!! FAILED TEST: $name !!!"; fi Loading @@ -49,6 +63,7 @@ run_tests() { } tests=() test_args=() while [ $# -gt 0 ]; do case "$1" in -h|--help) Loading @@ -69,6 +84,10 @@ while [ $# -gt 0 ]; do tests+=( ${known_tests[*]} ) shift ;; --*) test_args+=( "$1" ) shift ;; *) tests+=( $1 ) shift Loading @@ -77,7 +96,7 @@ while [ $# -gt 0 ]; do done if [ ${#tests[*]} -eq 0 ]; then run_tests "$device" ${known_tests[*]} || exit 1 else run_tests "$device" ${tests[*]} || exit 1 tests+=( ${known_tests[*]} ) fi run_tests "$device" ${test_args[*]} -- ${tests[*]} || exit 1 Loading
system/test/run_unit_tests.sh +25 −6 Original line number Diff line number Diff line Loading @@ -10,8 +10,11 @@ known_tests=( ) usage() { echo "Usage: $0 [-s <specific device> ][--all|--help|<test name>[.<filter>] ...]" echo "" echo "Usage: $0 --help" echo " $0 [-s <specific device>] [--all] [<test name>[.<filter>] ...] [--<arg> ...]" echo echo "Unknown long arguments are passed to the test." echo echo "Known test names:" for name in ${known_tests[*]} Loading @@ -24,6 +27,17 @@ run_tests() { adb="adb${1:+ -s $1}" shift test_args=() for arg do shift if [ "$arg" == "--" ]; then break else test_args+=( "$arg" ) fi done failed_tests='' for spec in $* do Loading @@ -35,7 +49,7 @@ run_tests() { echo "pushing..." $adb push {$ANDROID_PRODUCT_OUT,}/data/nativetest/$name/$name echo "running..." $adb shell data/nativetest/$name/$name${filter:+ "--gtest_filter=${filter}"} $adb shell data/nativetest/$name/$name${filter:+ "--gtest_filter=${filter}"} ${test_args[*]} if [ $? != 0 ]; then failed_tests="$failed_tests$CR!!! FAILED TEST: $name !!!"; fi Loading @@ -49,6 +63,7 @@ run_tests() { } tests=() test_args=() while [ $# -gt 0 ]; do case "$1" in -h|--help) Loading @@ -69,6 +84,10 @@ while [ $# -gt 0 ]; do tests+=( ${known_tests[*]} ) shift ;; --*) test_args+=( "$1" ) shift ;; *) tests+=( $1 ) shift Loading @@ -77,7 +96,7 @@ while [ $# -gt 0 ]; do done if [ ${#tests[*]} -eq 0 ]; then run_tests "$device" ${known_tests[*]} || exit 1 else run_tests "$device" ${tests[*]} || exit 1 tests+=( ${known_tests[*]} ) fi run_tests "$device" ${test_args[*]} -- ${tests[*]} || exit 1