summaryrefslogtreecommitdiff
path: root/tests/scripts/common.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/scripts/common.sh')
-rwxr-xr-xtests/scripts/common.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/scripts/common.sh b/tests/scripts/common.sh
index 12a35fd35..1e7ab39c7 100755
--- a/tests/scripts/common.sh
+++ b/tests/scripts/common.sh
@@ -32,3 +32,31 @@ function switch_nnfw_kernel_env()
fi
done
}
+
+function get_result_of_benchmark_test()
+{
+ local RUN_TEST_SH=$1
+ local DRIVER_BIN=$2
+ local MODEL=$3
+ local LOG_FILE=$4
+
+ local RET=0
+ $RUN_TEST_SH --driverbin=$DRIVER_BIN $MODEL > $LOG_FILE 2>&1
+ RET=$?
+ if [[ $RET -ne 0 ]]; then
+ echo "Testing $MODEL aborted... exit code: $RET"
+ exit $RET
+ fi
+
+ local RESULT=`grep -E '^Mean:' $LOG_FILE | sed -e 's/ms//g' | awk '{print $2}'`
+ echo "$RESULT"
+}
+
+function print_result_of_benchmark_test()
+{
+ local NAME=$1
+ local RESULT=$2
+ local RESULT_FILE=$3
+
+ echo "$NAME $RESULT" > $RESULT_FILE
+}