echo "Usage: ./tizen_xu4_test.sh --test-suite-path=path/to/test-suite.tar.gz --unittest --verification"
echo "--rpm-dir : directory containing nnfw.rpm and nnfw-test.rpm"
echo "--test-suite-path : filepath to test-suite.tar.gz"
- echo "--unittest : run unittest"
- echo "--verification : run verification"
- echo "--framework : run framework"
echo "--gcov-dir : directory to save gcov files"
}
$SDB_CMD shell rm -rf $TEST_ROOT
$SDB_CMD shell mkdir -p $TEST_ROOT
# install nnfw nnfw-test rpms
- for file in $RPM_DIR/*
+ for file in $RPM_DIR/*.rpm
do
$SDB_CMD push $file $TEST_ROOT
$SDB_CMD shell rpm -Uvh $TEST_ROOT/$(basename $file) --force --nodeps
--test-suite-path=*)
TEST_SUITE_PATH=${i#*=}
;;
- --unittest)
- UNITTEST=on
- ;;
- --verification)
- VERIFICATION=on
- ;;
- --framework)
- FRAMEWORK=on
- ;;
--gcov-dir=*)
GCOV_DIR=${i#*=}
;;
prepare_suite_test
fi
-# For tizen, we run acl_cl and mixed test
-$SDB_CMD shell /bin/bash -c "IGNORE_MD5=1 $TEST_ROOT/infra/scripts/test_tizen_neurun_acl_cl.sh"
-$SDB_CMD shell /bin/bash -c "IGNORE_MD5=1 $TEST_ROOT/infra/scripts/test_tizen_neurun_mixed.sh"
-
-# run unittest
-if [ "$UNITTEST" == "on" ]; then
- $SDB_CMD shell $TEST_ROOT/tests/scripts/test_driver.sh --unittest --artifactpath=$TEST_ROOT
-fi
-
-# run framework test
-if [ "$FRAMEWORK" == "on" ]; then
- $SDB_CMD shell $TEST_ROOT/tests/scripts/test_driver.sh --frameworktest --artifactpath=$TEST_ROOT
-fi
-
-# run verification
-if [ "$VERIFICATION" == "on" ]; then
- $SDB_CMD shell $TEST_ROOT/tests/scripts/test_driver.sh --verification --artifactpath=$TEST_ROOT
-fi
-
-# pull gcov files
-if [ -n "$GCOV_DIR" ]; then
- $SDB_CMD shell 'rm -rf /home/gcov && mkdir -p /home/gcov'
- $SDB_CMD shell 'find / -type f \( -iname "*.gcda" -or -iname "*.gcno" \) -exec cp {} /home/gcov/. \;'
- $SDB_CMD shell 'cd /home/ && tar -zcvf gcov.tar.gz ./gcov '
- cd $GCOV_DIR
- sdb pull /home/gcov.tar.gz
- tar -zxvf gcov.tar.gz
+if [ -z "${GCOV_DIR}" ]; then
+ ${SDB_CMD} shell /bin/bash -c "IGNORE_MD5=1 ${TEST_ROOT}/infra/scripts/test_tizen_neurun_acl_cl.sh"
+ ${SDB_CMD} shell /bin/bash -c "IGNORE_MD5=1 ${TEST_ROOT}/infra/scripts/test_tizen_neurun_mixed.sh"
+else
+ mkdir -p ${GCOV_DIR}
+ rm -rf ${GCOV_DIR}/*
+ pushd ${GCOV_DIR}
+
+ sdb pull ${TEST_ROOT}/tests/scripts/build_path.txt
+ SRC_PREFIX=`cat build_path.txt`
+ GCOV_PREFIX_STRIP=`echo "${SRC_PREFIX}" | grep -o '/' | wc -l`
+ GCOV_DATA_PATH="/opt/usr/nnfw-gcov"
+
+ # TODO For coverage check, we run acl_cl and mixed test
+ ${SDB_CMD} shell /bin/bash -c "GCOV_PREFIX_STRIP=${GCOV_PREFIX_STRIP} IGNORE_MD5=1 ${TEST_ROOT}/infra/scripts/test_tizen_neurun_acl_cl.sh"
+ ${SDB_CMD} shell /bin/bash -c "GCOV_PREFIX_STRIP=${GCOV_PREFIX_STRIP} IGNORE_MD5=1 ${TEST_ROOT}/infra/scripts/test_tizen_neurun_mixed.sh"
+
+ # More test to check coverage
+ ${SDB_CMD} shell "rm -rf ${GCOV_DATA_PATH} && mkdir -p ${GCOV_DATA_PATH}"
+ ${SDB_CMD} shell "find ${TEST_ROOT} -type f \( -iname '*.gcda' -or -iname '*.gcno' \) -exec cp {} ${GCOV_DATA_PATH}/. \;"
+ ${SDB_CMD} shell "cd ${TEST_ROOT} && tar -zcvf coverage-data.tar.gz -C ${GCOV_DATA_PATH} ."
+
+ # pull gcov files
+ sdb pull ${TEST_ROOT}/coverage-data.tar.gz
+ tar -zxvf coverage-data.tar.gz
+ popd
fi
%{test_build_env} ./nnfw configure %{test_build_options} %{extra_option}
%{test_build_env} ./nnfw build
%if %{coverage_build} == 1
-pwd | grep -o '/' | wc -l > tests/scripts/build_path_depth.txt
+pwd > tests/scripts/build_path.txt
%endif
tar -zcf test-suite.tar.gz infra/scripts tests/scripts tests/framework
%endif
%{test_build_env} ./nnfw install
tar -zxf test-suite.tar.gz -C %{buildroot}%{test_install_home}
+%if %{coverage_build} == 1
+mkdir -p %{buildroot}%{test_install_home}/gcov
+find . -name "*.gcno" -exec xargs cp {} %{buildroot}%{test_install_home}/gcov/. \;
+%endif
+
%endif
%post -p /sbin/ldconfig