summaryrefslogtreecommitdiff
path: root/infra/scripts/test_ubuntu_runtime.sh
diff options
context:
space:
mode:
Diffstat (limited to 'infra/scripts/test_ubuntu_runtime.sh')
-rwxr-xr-xinfra/scripts/test_ubuntu_runtime.sh84
1 files changed, 84 insertions, 0 deletions
diff --git a/infra/scripts/test_ubuntu_runtime.sh b/infra/scripts/test_ubuntu_runtime.sh
new file mode 100755
index 000000000..d4190bd80
--- /dev/null
+++ b/infra/scripts/test_ubuntu_runtime.sh
@@ -0,0 +1,84 @@
+#!/bin/bash
+
+set -eo pipefail
+source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
+
+BACKEND="cpu"
+TEST_ARCH=$(uname -m | tr '[:upper:]' '[:lower:]')
+TEST_OS="linux"
+TFLITE_LOADER="0"
+LINEAR_ONLY="0"
+
+function Usage()
+{
+ echo "Usage: $0 $(basename ${BASH_SOURCE[0]}) [OPTIONS]"
+ echo ""
+ echo "Options:"
+ echo " --backend <BACKEND> Runtime backend to test (default: ${BACKEND})"
+ echo " --tflite-loader Enable TFLite Loader test"
+ echo " --linear-only Use Linear executor only"
+}
+
+while [[ $# -gt 0 ]]
+do
+ arg="$1"
+ case $arg in
+ -h|--help|help)
+ Usage
+ exit 0
+ ;;
+ --backend)
+ BACKEND=$(echo $2 | tr '[:upper:]' '[:lower:]')
+ shift 2
+ ;;
+ --backend=*)
+ BACKEND=$(echo ${1#*=} | tr '[:upper:]' '[:lower:]')
+ shift
+ ;;
+ --tflite-loader)
+ TFLITE_LOADER="1"
+ shift
+ ;;
+ --linear-only)
+ LINEAR_ONLY="1"
+ shift
+ ;;
+ *)
+ # Ignore
+ shift
+ ;;
+ esac
+done
+
+CheckTestPrepared
+echo "[[ ${TEST_ARCH}-${TEST_OS}: ${BACKEND} backend test ]]"
+UNITTEST_SKIPLIST="Product/out/unittest/nnapi_gtest.skip.${TEST_ARCH}-${TEST_OS}.${BACKEND}"
+FRAMEWORK_TESTLIST="tests/scripts/list/frameworktest_list.${TEST_ARCH}.${BACKEND}.txt"
+REPORT_BASE="report/${BACKEND}"
+EXECUTORS=("Linear" "Dataflow" "Parallel")
+if [ $LINEAR_ONLY = "1" ]; then
+ EXECUTORS=("Linear")
+fi
+
+for EXECUTOR in "${EXECUTORS[@]}";
+do
+ echo "[EXECUTOR]: ${EXECUTOR}"
+ export EXECUTOR="${EXECUTOR}"
+ Unittests "${BACKEND}" "${UNITTEST_SKIPLIST}" "${REPORT_BASE}/${EXECUTOR}"
+ TFLiteModelVerification "${BACKEND}" "${FRAMEWORK_TESTLIST}" "${REPORT_BASE}/${EXECUTOR}"
+ unset EXECUTOR
+done
+
+if [[ $TFLITE_LOADER = "1" ]]; then
+ # Test tflite_loader
+ pushd ${ROOT_PATH} > /dev/null
+ ./tests/scripts/test-driver.sh \
+ --frameworktest \
+ --framework_driverbin="$ROOT_PATH/Product/out/bin/tflite_loader_test_tool" \
+ --frameworktest_list_file=tests/scripts/list/tflite_loader_list.${TEST_ARCH}.txt \
+ --reportdir="$ROOT_PATH/report/tfliteloader" .
+
+ # Test custom op
+ ./Product/out/tests/FillFrom_runner
+ popd > /dev/null
+fi