[neurun] Setup unittest infra (#2191)
author이한종/동작제어Lab(SR)/Engineer/삼성전자 <hanjoung.lee@samsung.com>
Wed, 8 Aug 2018 02:19:04 +0000 (11:19 +0900)
committer박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Wed, 8 Aug 2018 02:19:04 +0000 (11:19 +0900)
Setup unittest infra with GTest with a sample test.

Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
runtimes/neurun/CMakeLists.txt
runtimes/neurun/test/model.cc [new file with mode: 0644]

index 3888a5c..011edcb 100644 (file)
@@ -38,3 +38,19 @@ target_link_libraries(${LIB_NEURUN} ${LIB_NEURUN_BACKEND_ACL_CL})
 set_target_properties(${LIB_NEURUN} PROPERTIES OUTPUT_NAME neuralnetworks)
 
 install(TARGETS ${LIB_NEURUN} DESTINATION lib/neurun)
+
+
+# Unit Tests
+
+set(TEST_NEURUN test_neurun)
+
+file(GLOB_RECURSE TESTS "test/*.cc")
+
+add_executable(${TEST_NEURUN} ${TESTS})
+target_link_libraries(${TEST_NEURUN} ${LIB_NEURUN})
+target_link_libraries(${TEST_NEURUN} gtest)
+target_link_libraries(${TEST_NEURUN} gtest_main)
+target_link_libraries(${TEST_NEURUN} ${LIB_PTHREAD})
+add_test(${TEST_NEURUN} ${TEST_NEURUN})
+
+install(TARGETS ${TEST_NEURUN} DESTINATION unittest)
diff --git a/runtimes/neurun/test/model.cc b/runtimes/neurun/test/model.cc
new file mode 100644 (file)
index 0000000..88cc205
--- /dev/null
@@ -0,0 +1,9 @@
+#include <gtest/gtest.h>
+
+#include "model.h"
+
+TEST(MODEL, model_build)
+{
+  ANeuralNetworksModel model;
+  ASSERT_EQ(model.isFinished(), false);
+}