summaryrefslogtreecommitdiff
path: root/docs/nnfw/howto/HowToAddUnittest.md
diff options
context:
space:
mode:
authorChunseok Lee <chunseok.lee@samsung.com>2020-03-05 15:10:09 +0900
committerChunseok Lee <chunseok.lee@samsung.com>2020-03-05 15:22:53 +0900
commitd91a039e0eda6fd70dcd22672b8ce1817c1ca50e (patch)
tree62668ec548cf31fadbbf4e99522999ad13434a25 /docs/nnfw/howto/HowToAddUnittest.md
parentbd11b24234d7d43dfe05a81c520aa01ffad06e42 (diff)
downloadnnfw-d91a039e0eda6fd70dcd22672b8ce1817c1ca50e.tar.gz
nnfw-d91a039e0eda6fd70dcd22672b8ce1817c1ca50e.tar.bz2
nnfw-d91a039e0eda6fd70dcd22672b8ce1817c1ca50e.zip
catch up to tizen_5.5 and remove unness dir
- update to tizen_5.5 - remove dirs
Diffstat (limited to 'docs/nnfw/howto/HowToAddUnittest.md')
-rw-r--r--docs/nnfw/howto/HowToAddUnittest.md31
1 files changed, 31 insertions, 0 deletions
diff --git a/docs/nnfw/howto/HowToAddUnittest.md b/docs/nnfw/howto/HowToAddUnittest.md
new file mode 100644
index 000000000..5bb75b258
--- /dev/null
+++ b/docs/nnfw/howto/HowToAddUnittest.md
@@ -0,0 +1,31 @@
+# How to Add Unittest using gtest(googletest)
+
+### 1. make own test code
+```
+#include "gtest/gtest.h"
+
+TEST(TFLite_test_case, simple_test)
+{
+ EXPECT_EQ(1, 1);
+}
+```
+
+### 2. Find and prepare package `googletest` to your test executable
+```
+find_nnfw_package(GTest QUITE)
+if(NOT GTest_FOUND)
+ ## Cannot find and prepare googletest package
+ return()
+endif(NOT GTest_FOUND)
+add_executable($YOURTEST_TARGET yourtest1.cc yourtest2.cc)
+```
+
+### 3. Link test executable against libgtest.a and libgtest_main.a (+ pthread)
+```
+target_link_libraries($YOURTEST_TARGET gtest gtest_main pthread)
+```
+
+### 4. Install test executable into Product/out/unittest
+```
+install(TARGETS $YOURTEST_TARGET DESTINATION unittest)
+```