forked from Samsung/ONE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_coverage.sh
executable file
·52 lines (39 loc) · 1.7 KB
/
test_coverage.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
# Test suite: ${ARCHIVE_PATH}/coverage-suite.tar.gz
# NNPackage test suite: ${ARCHIVE_PATH}/nnpkg-test-suite.tar.gz (optional)
set -eo pipefail
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
pushd $ROOT_PATH > /dev/null
NNAS_WORKSPACE=${NNAS_WORKSPACE:-build}
if [[ -z "${ARCHIVE_PATH}" ]]; then
ARCHIVE_PATH=${NNAS_WORKSPACE}/archive
echo "Default archive directory including nncc package and resources: ${ARCHIVE_PATH}"
fi
tar -zxf ${ARCHIVE_PATH}/coverage-suite.tar.gz -C ./
CheckTestPrepared
if [[ ! -e $ROOT_PATH/tests/scripts/build_path_depth.txt ]]; then
echo "Cannot find prefix strip file"
exit 1
fi
export GCOV_PREFIX_STRIP=`cat $ROOT_PATH/tests/scripts/build_path_depth.txt`
TENSOR_LOGGING=trace_log.txt ./infra/scripts/test_ubuntu_runtime.sh --backend acl_cl --nnapi-frontend
./infra/scripts/test_ubuntu_runtime.sh --backend acl_neon
./infra/scripts/test_ubuntu_runtime.sh --backend cpu
# Enable all logs (mixed backend)
ONERT_LOG_ENABLE=1 GRAPH_DOT_DUMP=1 ./infra/scripts/test_ubuntu_runtime_mixed.sh
# Enable trace event (acl_cl default backend)
export TRACE_FILEPATH=trace.json
TFLiteModelVerification "acl_cl" "Product/out/test/list/tflite_comparator.armv7l.acl_cl.list" "report/acl_cl/trace"
unset TRACE_FILEPATH
# Interpreter
./infra/scripts/test_ubuntu_runtime.sh --interp
# nnpackage test suite
if [[ -e ${ARCHIVE_PATH}/nnpkg-test-suite.tar.gz ]]; then
tar -zxf ${ARCHIVE_PATH}/nnpkg-test-suite.tar.gz -C ./
./infra/scripts/test_arm_nnpkg.sh
fi
# Pack coverage test data: coverage-data.tar.gz
find Product -type f \( -iname *.gcda -or -iname *.gcno \) > include_lists.txt
tar -zcf ${ARCHIVE_PATH}/coverage-data.tar.gz -T include_lists.txt
rm -rf include_lists.txt
popd > /dev/null