summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAxel Fagerstedt <axel.fagerstedt@linaro.org>2013-01-31 14:56:59 +0100
committerAxel Fagerstedt <axel.fagerstedt@linaro.org>2013-01-31 16:50:36 +0100
commitda26a199b4c717e110cd597ca878a3d2831fead7 (patch)
treeedfb4745f8527438d5b884b2180be02963143012
parentd75c0fbc152135bfbee969bbbdf5fe83e8bf134c (diff)
downloadlinaro-android-kernel-test-da26a199b4c717e110cd597ca878a3d2831fead7.tar.gz
Add wrapper to run all ashmemtest-expanded testcases
ashmemtest-expanded-runner.sh will run all input scenarios in /data/linaro-android-kernel-test/ashmemtest-expanded, compare the output to the corresponding out file and report a test passed/failed status.
-rwxr-xr-xashmemtest-expanded/ashmemtest-expanded-runner.sh23
-rw-r--r--product.mk3
2 files changed, 26 insertions, 0 deletions
diff --git a/ashmemtest-expanded/ashmemtest-expanded-runner.sh b/ashmemtest-expanded/ashmemtest-expanded-runner.sh
new file mode 100755
index 0000000..59d52b7
--- /dev/null
+++ b/ashmemtest-expanded/ashmemtest-expanded-runner.sh
@@ -0,0 +1,23 @@
+#!/system/bin/sh
+
+DIR=/data/linaro-android-kernel-test/ashmemtest-expanded
+FILES=$DIR/*.txt
+
+for f in $FILES
+do
+ BASENAME=`basename $f`
+ TESTNAME="${BASENAME%.*}"
+
+ echo "running $TESTNAME"
+
+ OUTPUT=`ashmemtest-expanded $f`
+ EXPECTED_OUTPUT=`cat $DIR/$TESTNAME.out`
+
+ if [ "$OUTPUT" == "$EXPECTED_OUTPUT" ]; then
+ echo $OUTPUT
+ echo "[$TESTNAME]: test passed"
+ else
+ echo $OUTPUT
+ echo "[$TESTNAME]: test failed"
+ fi
+done
diff --git a/product.mk b/product.mk
index 5d216cd..1f6a7d5 100644
--- a/product.mk
+++ b/product.mk
@@ -1,7 +1,10 @@
+# pick up tests for inclusion in the system image
PRODUCT_PACKAGES += ashmemtest \
ashmemtest-expanded \
sync-basic
+PRODUCT_COPY_FILES += external/linaro-android-kernel-test/ashmemtest-expanded/ashmemtest-expanded-runner.sh:system/bin/ashmemtest-expanded-runner.sh
+# put expanded ashmemtest in/out files on the device filesystem
PRODUCT_COPY_FILES += \
external/linaro-android-kernel-test/ashmemtest-expanded/test0.txt:data/linaro-android-kernel-test/ashmemtest-expanded/test0.txt \
external/linaro-android-kernel-test/ashmemtest-expanded/test0.out:data/linaro-android-kernel-test/ashmemtest-expanded/test0.out \