From: 박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 Date: Fri, 5 Jul 2019 04:07:49 +0000 (+0900) Subject: [tf2tflite] Refine how to add tests (#4105) X-Git-Tag: nncc_backup~177 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6b6f2406ec829f93129979dd0d1f3141bda7dcca;p=platform%2Fcore%2Fml%2Fnnfw.git [tf2tflite] Refine how to add tests (#4105) This commit refines tf2tflite test framework to use CMake's "include" command instead of ListFile_Read function. This change permits flexible test management. For example, now it is possible to comment out some tests temporarily. Signed-off-by: Jonghyun Park --- diff --git a/contrib/tf2tflite/CMakeLists.txt b/contrib/tf2tflite/CMakeLists.txt index 68a0b7b..5ba5b11 100644 --- a/contrib/tf2tflite/CMakeLists.txt +++ b/contrib/tf2tflite/CMakeLists.txt @@ -23,7 +23,6 @@ target_link_libraries(tf2tflite PRIVATE locop) target_link_libraries(tf2tflite PRIVATE hermes_std) target_link_libraries(tf2tflite PRIVATE stdex) -nncc_include(ListFile) nncc_find_resource(TensorFlowTests) unset(REQUIRED_TARGETS) @@ -50,18 +49,14 @@ set(TEST_INFO_FILENAME "test.info") unset(TESTCASES) -# Read "test.lst" -ListFile_Read("test.lst" COMMITED_TESTS) -list(APPEND TESTCASES ${COMMITED_TESTS}) +macro(add NAME) + list(APPEND TESTCASES ${NAME}) +endmacro(add) -# Read "test.local.lst" if it exists -# -# NOTE CMake recommends "full path" for EXISTS -# https://cmake.org/cmake/help/v3.1/command/if.html -if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/test.local.lst") - ListFile_Read("test.local.lst" LOCAL_TESTS) - list(APPEND TESTCASES ${LOCAL_TESTS}) -endif() +# Read "test.lst" +include("test.lst") +# Read "test.local.lst" if exists +include("test.local.lst" OPTIONAL) unset(TEST_DEPS) unset(TEST_NAMES) diff --git a/contrib/tf2tflite/test.lst b/contrib/tf2tflite/test.lst index 492b66b..9e33904 100644 --- a/contrib/tf2tflite/test.lst +++ b/contrib/tf2tflite/test.lst @@ -1,8 +1,8 @@ -BiasAdd_002 -MaxPool_001 -TF_IV3_AvgPool_GlobalPooling -TF_IV3_AvgPool_Module -TF_IV3_Conv2D_000 -TF_IV3_MaxPool -TF_SMALL_NET_0000 -TF_SMALL_NET_0001 +add(BiasAdd_002) +add(MaxPool_001) +add(TF_IV3_AvgPool_GlobalPooling) +add(TF_IV3_AvgPool_Module) +add(TF_IV3_Conv2D_000) +add(TF_IV3_MaxPool) +add(TF_SMALL_NET_0000) +add(TF_SMALL_NET_0001)