5 unset(LUCI_VALUE_TESTS)
6 unset(LUCI_VALUE_TESTS_TOL)
9 list(APPEND LUCI_VALUE_TESTS ${NAME})
12 macro(addevaltol NAME RTOL ATOL)
13 list(APPEND LUCI_VALUE_TESTS_TOL ${NAME} ${RTOL} ${ATOL})
18 # Read "test.local.lst" if exists
19 include("test.local.lst" OPTIONAL)
21 # Generate dependencies
22 add_custom_target(luci_eval_testfiles ALL DEPENDS ${TESTFILES})
24 if(NOT CMAKE_CROSSCOMPILING)
26 get_target_property(ARTIFACTS_BIN_PATH testDataGenerator BINARY_DIR)
28 add_test(NAME luci_value_test
29 COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/evalverify.sh"
30 "${CMAKE_CURRENT_BINARY_DIR}"
31 "${ARTIFACTS_BIN_PATH}"
32 "${NNCC_OVERLAY_DIR}/venv_2_12_1"
33 "$<TARGET_FILE:luci_eval_driver>"
37 if(DEFINED LUCI_VALUE_TESTS_TOL)
38 add_test(NAME luci_value_tol_test
39 COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/evalverifytol.sh"
40 "${CMAKE_CURRENT_BINARY_DIR}"
41 "${ARTIFACTS_BIN_PATH}"
42 "${NNCC_OVERLAY_DIR}/venv_2_12_1"
43 "$<TARGET_FILE:luci_eval_driver>"
44 ${LUCI_VALUE_TESTS_TOL}
48 else(NOT CMAKE_CROSSCOMPILING)
49 # NOTE target test is carried out using reference input/output data from host
50 # test results. this is because it would be difficult to prepare
51 # TensorFlow lite for target device.
52 # thus, one must run the host test and then run the test in target device
53 # with the test result files from the host test.
55 if(NOT DEFINED ENV{BUILD_HOST_EXEC})
56 message(STATUS "BUILD_HOST_EXEC not set: Skip luci-value-test")
58 endif(NOT DEFINED ENV{BUILD_HOST_EXEC})
60 set(ARTIFACTS_BIN_PATH $ENV{BUILD_HOST_EXEC}/compiler/common-artifacts)
62 add_test(NAME luci_value_cross_test
63 COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/evalverify_ref.sh"
64 "${CMAKE_CURRENT_BINARY_DIR}"
65 "${ARTIFACTS_BIN_PATH}"
66 "$<TARGET_FILE:luci_eval_driver>"
70 if(DEFINED LUCI_VALUE_TESTS_TOL)
71 add_test(NAME luci_value_cross_tol_test
72 COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/evalverifytol_ref.sh"
73 "${CMAKE_CURRENT_BINARY_DIR}"
74 "${ARTIFACTS_BIN_PATH}"
75 "$<TARGET_FILE:luci_eval_driver>"
76 ${LUCI_VALUE_TESTS_TOL}
80 endif(NOT CMAKE_CROSSCOMPILING)