From 8908f3c98ac6a49ae4f3abf349c574e4d7777967 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9D=B4=ED=95=9C=EC=A2=85/=EB=8F=99=EC=9E=91=EC=A0=9C?= =?utf8?q?=EC=96=B4Lab=28SR=29/Engineer/=EC=82=BC=EC=84=B1=EC=A0=84?= =?utf8?q?=EC=9E=90?= Date: Wed, 8 Aug 2018 11:19:04 +0900 Subject: [PATCH] [neurun] Setup unittest infra (#2191) Setup unittest infra with GTest with a sample test. Signed-off-by: Hanjoung Lee --- runtimes/neurun/CMakeLists.txt | 16 ++++++++++++++++ runtimes/neurun/test/model.cc | 9 +++++++++ 2 files changed, 25 insertions(+) create mode 100644 runtimes/neurun/test/model.cc diff --git a/runtimes/neurun/CMakeLists.txt b/runtimes/neurun/CMakeLists.txt index 3888a5c..011edcb 100644 --- a/runtimes/neurun/CMakeLists.txt +++ b/runtimes/neurun/CMakeLists.txt @@ -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 index 0000000..88cc205 --- /dev/null +++ b/runtimes/neurun/test/model.cc @@ -0,0 +1,9 @@ +#include + +#include "model.h" + +TEST(MODEL, model_build) +{ + ANeuralNetworksModel model; + ASSERT_EQ(model.isFinished(), false); +} -- 2.7.4