[tf2tflite] Refine how to add tests (#4105)
author박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Fri, 5 Jul 2019 04:07:49 +0000 (13:07 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Fri, 5 Jul 2019 04:07:49 +0000 (13:07 +0900)
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 <jh1302.park@samsung.com>
contrib/tf2tflite/CMakeLists.txt
contrib/tf2tflite/test.lst

index 68a0b7b..5ba5b11 100644 (file)
@@ -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)
index 492b66b..9e33904 100644 (file)
@@ -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)