Add test_driver.sh for verification (#439)
author김용섭/동작제어Lab(SR)/Engineer/삼성전자 <yons.kim@samsung.com>
Thu, 5 Apr 2018 05:43:41 +0000 (14:43 +0900)
committer서상민/동작제어Lab(SR)/Senior Engineer/삼성전자 <sangmin7.seo@samsung.com>
Thu, 5 Apr 2018 05:43:41 +0000 (14:43 +0900)
* Add test_driver.sh for verification

This commits add test_driver.sh to Product/out/bin for verification.
Additional tests would be appended in this script soon.

Signed-off-by: Yongseop Kim <yons.kim@samsung.com>
tools/test_driver/test_driver.sh [new file with mode: 0755]

diff --git a/tools/test_driver/test_driver.sh b/tools/test_driver/test_driver.sh
new file mode 100755 (executable)
index 0000000..3bbcc90
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+# NOTE: Supposed that this script would be executed with an artifact path.
+#       The artifact path has tests/(test suite) and Product/
+#       Reference this PR(https://github.sec.samsung.net/STAR/nnfw/pull/375).
+
+ARTIFACT_PATH="$1"
+if [ ! -e "$ARTIFACT_PATH" ]; then
+    echo "Pass on with proper ARTIFACT_PATH"
+    exit 1
+fi
+ARTIFACT_PATH="$(realpath $1)"
+
+RUN_TEST_SH=$ARTIFACT_PATH/tests/framework/run_test.sh
+if [ ! -e "$RUN_TEST_SH" ]; then
+    echo "Cannot find $RUN_TEST_SH"
+    exit 1
+fi
+
+# Run unittest in each part such as Runtime, ACL
+# TODO: fill this
+
+# Run tflite_run with various tflite models
+# TODO: fill this
+
+# Run nnapi_test with various tflite models
+export DRIVER_BIN=$ARTIFACT_PATH/Product/out/bin/nnapi_test
+export LD_LIBRARY_PATH=$ARTIFACT_PATH/Product/out/lib:$LD_LIBRARY_PATH
+echo ""
+echo "Verification with nnapi_test"
+echo "======================"
+$RUN_TEST_SH
+echo "======================"
+echo ""