3 # Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 COMMAND_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
18 INSTALL_DIR="$(dirname $(dirname $COMMAND_DIR))"
27 echo "Usage: $0 $(basename ${BASH_SOURCE[0]}) [OPTIONS]"
30 echo " --ignoremd5 Ignore MD5 check when download model files"
31 echo " --api=(nnapi|loader) TFLite model file loading API (default=$TFLITE_LOADER)"
32 echo " --reportdir=PATH Path to write report (default=$REPORT_DIR)"
33 echo " --list=FILE List file to test. Test all if list option is not passed"
53 TEST_LIST_FILE=${i#*=}
56 echo "Unknown option: $i"
63 if [ ! -z "$TEST_LIST_FILE" ]; then
64 MODELLIST=$(cat "${TEST_LIST_FILE}")
67 if [ ! -e "$REPORT_DIR" ]; then
72 TAP_NAME=verification_test.tap
73 TEST_NAME="Verification"
76 if [[ $TFLITE_LOADER == "nnapi" ]]; then
77 TEST_NAME="NNAPI Verification"
78 TEST_DRIVER=nnapi_test
79 elif [[ $TFLITE_LOADER == "loader" ]]; then
80 TEST_NAME="Loader Verification"
81 TEST_DRIVER=tflite_loader_test_tool
87 $INSTALL_DIR/test/models/run_test.sh --driverbin=$TEST_DRIVER \
88 --reportdir=$REPORT_DIR \
90 ${MODELLIST:-} > $REPORT_DIR/verification_test.log 2>&1
93 if [[ $TEST_RESULT -ne 0 ]]; then
95 cat $REPORT_DIR/$TAP_NAME
97 echo "$TEST_NAME failed... exit code: $TEST_RESULT"
98 echo "============================================"
104 cat $REPORT_DIR/$TAP_NAME
105 echo "============================================"