Test driver: report directory (#2188)
author오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Tue, 7 Aug 2018 08:56:27 +0000 (17:56 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Tue, 7 Aug 2018 08:56:27 +0000 (17:56 +0900)
Add parameter to set report directory

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
tools/test_driver/test_driver.sh

index 42289ea..751e6c3 100755 (executable)
@@ -51,6 +51,7 @@ function Usage()
     echo "--usennapi            - (default=on)  declare USE_NNAPI=1"
     echo "--nousennapi          - (default=off) declare nothing about USE_NNAPI"
     echo "--acl_envon           - (default=off) declare envs for ACL"
+    echo "--reportdir           - (default=\$ARTIFACT_PATH/report) directory to save report"
     echo ""
 }
 
@@ -72,6 +73,7 @@ BENCHMARK_OP_ON="false"
 BENCHMARK_ACL_ON="false"
 ACL_ENV_ON="false"
 PROFILE_ON="false"
+REPORT_DIR=""
 
 for i in "$@"
 do
@@ -145,6 +147,9 @@ do
             ALLTEST_ON="false"
             PROFILE_ON="true"
             ;;
+        --reportdir=*)
+            REPORT_DIR=${i#*=}
+            ;;
         *)
             # Be careful that others params are handled as $ARTIFACT_PATH
             ARTIFACT_PATH="$i"
@@ -172,6 +177,10 @@ if [ -z "$UNIT_TEST_DIR" ]; then
     UNIT_TEST_DIR=$ARTIFACT_PATH/Product/out/unittest
 fi
 
+if [ -z "$REPORT_DIR" ]; then
+    REPORT_DIR=$ARTIFACT_PATH/report
+fi
+
 if [ -z "$LD_LIBRARY_PATH_IN_SHELL" ]; then
     LD_LIBRARY_PATH="$ARTIFACT_PATH/Product/out/lib:$LD_LIBRARY_PATH"
 else
@@ -193,7 +202,7 @@ fi
 # Run unittest in each part such as Runtime, ACL
 if [ "$ALLTEST_ON" == "true" ] || [ "$UNITTEST_ON" == "true" ]; then
     $MY_PATH/run_unittest.sh \
-        --reportdir=$ARTIFACT_PATH/report \
+        --reportdir=$REPORT_DIR \
         --unittestdir=$UNIT_TEST_DIR
 fi
 
@@ -206,7 +215,7 @@ if [ "$FRAMEWORKTEST_ON" == "true" ]; then
     $MY_PATH/run_frameworktest.sh \
         --runtestsh=$RUN_TEST_SH \
         --driverbin=$FRAMEWORK_DRIVER_BIN \
-        --reportdir=$ARTIFACT_PATH/report \
+        --reportdir=$REPORT_DIR \
         --tapname=framework_test.tap \
         --logname=framework_test.log \
         --testname="Frameworktest" \
@@ -223,7 +232,7 @@ if [ "$ALLTEST_ON" == "true" ] || [ "$VERIFICATION_ON" == "true" ]; then
     $MY_PATH/run_frameworktest.sh \
         --runtestsh=$RUN_TEST_SH \
         --driverbin=$VERIFICATION_DRIVER_BIN \
-        --reportdir=$ARTIFACT_PATH/report \
+        --reportdir=$REPORT_DIR \
         --tapname=verification_test.tap \
         --logname=verification_test.log \
         --testname="Verification" \
@@ -241,7 +250,7 @@ if [ "$BENCHMARK_ON" == "true" ]; then
     $MY_PATH/run_benchmark.sh \
         --runtestsh=$RUN_TEST_SH \
         --driverbin=$DRIVER_BIN \
-        --reportdir=$ARTIFACT_PATH/report/benchmark
+        --reportdir=$REPORT_DIR/benchmark
 fi
 
 # Run tflite_benchmark per operation with tflite models
@@ -255,7 +264,7 @@ if [ "$BENCHMARK_OP_ON" == "true" ]; then
     $MY_PATH/run_benchmark_op.sh \
         --runtestsh=$RUN_TEST_SH \
         --driverbin=$DRIVER_BIN \
-        --reportdir=$ARTIFACT_PATH/report/benchmark_op \
+        --reportdir=$REPORT_DIR/benchmark_op \
         --modelfilepath=$ARTIFACT_PATH/tests/framework \
         --frameworktest_list_file=${FRAMEWORKTEST_LIST_FILE:-}
 fi
@@ -263,7 +272,7 @@ fi
 # Run benchmark/acl/benchmark_googlenet,mobilenet and inception_v3
 if [ "$BENCHMARK_ACL_ON" == "true" ]; then
     $MY_PATH/run_benchmark_acl.sh \
-        --reportdir=$ARTIFACT_PATH/report/benchmark \
+        --reportdir=$AREPORT_DIR/benchmark \
         --bindir=$ARTIFACT_PATH/Product/out/bin
 fi
 
@@ -272,9 +281,9 @@ if [ "$BENCHMARK_ON" == "true" ] || [ "$BENCHMARK_ACL_ON" == "true" ] || [ "$BEN
     # functions to fill json with benchmark results
     source $ARTIFACT_PATH/tools/test_driver/print_to_json.sh
     if [ "$BENCHMARK_OP_ON" == "true" ]; then
-        print_to_json $ARTIFACT_PATH/report/benchmark_op $ARTIFACT_PATH/report "benchmark_op_result.json"
+        print_to_json $REPORT_DIR/benchmark_op $REPORT_DIR "benchmark_op_result.json"
     else
-        print_to_json $ARTIFACT_PATH/report/benchmark $ARTIFACT_PATH/report "benchmark_result.json"
+        print_to_json $REPORT_DIR/benchmark $REPORT_DIR "benchmark_result.json"
     fi
 fi