From: 이한종/On-Device Lab(SR)/Engineer/삼성전자 Date: Sun, 17 Mar 2019 23:51:34 +0000 (+0900) Subject: Cache generated tests (#4755) X-Git-Tag: submit/tizen/20190325.013700~50 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=584bc24324e34b4c11223944a91890d44dc7184b;p=platform%2Fcore%2Fml%2Fnnfw.git Cache generated tests (#4755) Do not generate generated tests unless related files are changed. Signed-off-by: Hanjoung Lee --- diff --git a/tests/nnapi/CMakeLists.txt b/tests/nnapi/CMakeLists.txt index 04a9b4c..d03d1ae 100644 --- a/tests/nnapi/CMakeLists.txt +++ b/tests/nnapi/CMakeLists.txt @@ -3,7 +3,17 @@ if (NOT BUILD_RUNTIME_NNAPI_TEST) endif(NOT BUILD_RUNTIME_NNAPI_TEST) if (GENERATE_RUNTIME_NNAPI_TESTS) - execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/specs/generate_test.sh) + set(GENERATOR_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/specs/generate_test.sh") + file(GLOB_RECURSE TEST_SPECS "${CMAKE_CURRENT_SOURCE_DIR}/specs/*.mod.py") + set(GENERATED_CPPS "${CMAKE_CURRENT_SOURCE_DIR}/src/generated/all_generated_V1_1_cts_tests.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/src/generated/all_generated_V1_0_cts_tests.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/src/generated/all_generated_Ex_cts_tests.cpp") + add_custom_command(OUTPUT ${GENERATED_CPPS} + COMMAND ${GENERATOR_SCRIPT} + DEPENDS ${GENERATOR_SCRIPT} ${TEST_SPECS} + COMMENT "Generating runtime nnapi tests") + add_custom_target(generate-runtime-nnapi-tests + DEPENDS ${GENERATED_CPPS}) endif(GENERATE_RUNTIME_NNAPI_TESTS) # Executable `runtime_run` (Dummy runner executable using NN API) @@ -20,6 +30,10 @@ set(RUNTIME_NNAPI_TEST_SRC ${RUNTIME_NNAPI_TEST_SRC} ${GENERATED_TEST_SRC}) add_executable(${RUNTIME_NNAPI_TEST} ${RUNTIME_NNAPI_TEST_SRC}) +if (GENERATE_RUNTIME_NNAPI_TESTS) + add_dependencies(${RUNTIME_NNAPI_TEST} generate-runtime-nnapi-tests) +endif(GENERATE_RUNTIME_NNAPI_TESTS) + nnfw_find_package(GTest) set(RUNTIME_NNAPI_TEST_SRC_INC ${CMAKE_CURRENT_SOURCE_DIR}/include