[neurun] Break NN API and core API tests (#6448)
author박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Mon, 12 Aug 2019 00:53:04 +0000 (09:53 +0900)
committer오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Mon, 12 Aug 2019 00:53:04 +0000 (09:53 +0900)
"test_neurun" currently includes both NN API and neurun core API tests.

This commit introduces "test_neurun_frontend_nnapi" dedicated to NN API tests.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
runtimes/neurun/CMakeLists.txt
runtimes/neurun/frontend/nnapi/ANeuralNetworksModel.test.cc [moved from runtimes/neurun/test/frontend/nnapi/ANeuralNetworksModel.cc with 100% similarity]
runtimes/neurun/frontend/nnapi/CMakeLists.txt

index af44f1c..1d58b75 100644 (file)
@@ -18,11 +18,8 @@ file(GLOB_RECURSE TESTS "test/*.cc")
 
 add_executable(${TEST_NEURUN} ${TESTS})
 
-# NOTE This line is a workaround to resolve compilation error
-target_include_directories(${TEST_NEURUN} PRIVATE frontend/nnapi)
 target_include_directories(${TEST_NEURUN} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/core/src)
 
-target_link_libraries(${TEST_NEURUN} ${LIB_NEURUN})
 target_link_libraries(${TEST_NEURUN} neurun-core)
 target_link_libraries(${TEST_NEURUN} gtest)
 target_link_libraries(${TEST_NEURUN} gtest_main)
index 0115a48..625a804 100644 (file)
@@ -1,4 +1,6 @@
 file(GLOB_RECURSE SOURCES_FRONTEND "*.cc")
+file(GLOB_RECURSE TESTS_FRONTEND "*.test.cc")
+list(REMOVE_ITEM SOURCES_FRONTEND ${TESTS_FRONTEND})
 
 add_library(${LIB_NEURUN} SHARED ${SOURCES_FRONTEND})
 target_link_libraries(${LIB_NEURUN} PUBLIC nnfw-header)
@@ -9,3 +11,10 @@ set_target_properties(${LIB_NEURUN} PROPERTIES OUTPUT_NAME neuralnetworks)
 
 install(TARGETS ${LIB_NEURUN} DESTINATION lib)
 
+add_executable(test_neurun_frontend_nnapi ${TESTS_FRONTEND})
+
+target_link_libraries(test_neurun_frontend_nnapi PRIVATE ${LIB_NEURUN})
+target_link_libraries(test_neurun_frontend_nnapi PRIVATE gtest)
+target_link_libraries(test_neurun_frontend_nnapi PRIVATE gtest_main)
+
+install(TARGETS test_neurun_frontend_nnapi DESTINATION unittest)