summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAxel Fagerstedt <axel.fagerstedt@linaro.org>2013-04-02 15:56:12 +0200
committerAxel Fagerstedt <axel.fagerstedt@linaro.org>2013-04-02 15:56:12 +0200
commit57c947462b328f68eb2d106ee0a95e3ae9d94ed3 (patch)
tree0efd53ebf9ce5d9970c4d07d5cb613d51424f5a0
parentda135c9b2f728ad2298465b3df60d7b1c6b4c38b (diff)
downloadlinaro-android-kernel-test-57c947462b328f68eb2d106ee0a95e3ae9d94ed3.tar.gz
Add input arguments
Script now supports running specific tests.
-rwxr-xr-xlinaro-android-kernel-tests.sh91
1 files changed, 82 insertions, 9 deletions
diff --git a/linaro-android-kernel-tests.sh b/linaro-android-kernel-tests.sh
index 352c7fc..63c5945 100755
--- a/linaro-android-kernel-tests.sh
+++ b/linaro-android-kernel-tests.sh
@@ -9,6 +9,27 @@
# Linaro <linaro-dev@lists.linaro.org>
#############################################################################
+usage() {
+ echo ""
+ echo "Usage: $0 [-h] [-t testnames]"
+ echo ""
+ echo "Runs all tests if no arguments are given."
+ echo ""
+ echo "-h prints this help mesage."
+ echo "-t testnames, run specified tests."
+ echo " currently supported:"
+ echo " ashmem"
+ echo " ashmem_expanded"
+ echo " alarmdev"
+ echo " logger"
+ echo " binder"
+ echo " sync"
+ echo ""
+ echo "example:"
+ echo "$ linaro-android-kernel-tests -t \"logger binder\""
+}
+
+
run_ashmemtest()
{
echo "Running basic ashmemtest."
@@ -80,15 +101,67 @@ run_sync_test() {
sync-basic
}
+run_all() {
+ echo "Running all tests"
+ TESTS="ashmem ashmem_expanded alarmdev logger binder sync"
+ run_tests
+}
-run_ashmemtest
-
-run_ashmemtest_expanded
-
-run_alarm_dev_test
-
-run_logger_test
+run_tests() {
+ for TEST in $TESTS;
+ do
+ case $TEST in
+ ashmem)
+ run_ashmemtest
+ ;;
+ ashmem_expanded)
+ run_ashmemtest_expanded
+ ;;
+ alarmdev)
+ run_alarm_dev_test
+ ;;
+ logger)
+ run_logger_test
+ ;;
+ binder)
+ run_binder_test
+ ;;
+ sync)
+ run_sync_test
+ ;;
+ *)
+ echo ""
+ echo "Unrecognized test $TEST."
+ usage
+ exit
+ ;;
+ esac
+ done
+}
-run_binder_test
+TESTS=
+
+# no input argument
+# run all tests
+if [ $# -eq 0 ]; then
+ run_all
+ exit
+fi
+
+while getopts "ht:" OPT
+do
+ case $OPT in
+ h)
+ usage
+ exit 1
+ ;;
+ t)
+ TESTS=$OPTARG
+ ;;
+ *)
+ usage
+ exit
+ esac
+done
-run_sync_test
+run_tests