summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
author이춘석/동작제어Lab(SR)/Senior Engineer/삼성전자 <chunseok.lee@samsung.com>2018-04-04 09:34:13 +0900
committer서상민/동작제어Lab(SR)/Senior Engineer/삼성전자 <sangmin7.seo@samsung.com>2018-04-04 09:34:13 +0900
commitfd104d603dca35a6850b40aed8647f80502dea36 (patch)
treecd6bc5a102c17f2bd13177b794a867ee64ef3eb3 /docs
parent6b0d71112d65c12a1e5e16cf64594d16dead2428 (diff)
downloadnnfw-fd104d603dca35a6850b40aed8647f80502dea36.tar.gz
nnfw-fd104d603dca35a6850b40aed8647f80502dea36.tar.bz2
nnfw-fd104d603dca35a6850b40aed8647f80502dea36.zip
Enable googletest for unittesting (#398)
0. Support arm-cross, x64-native, arm-native, and tizen-obs build 1. Introduce googletest at top level 2. Add simple test tflite_test.cc : this should be removed 3. Add howto doc
Diffstat (limited to 'docs')
-rw-r--r--docs/HowToAddUnittest.md27
1 files changed, 27 insertions, 0 deletions
diff --git a/docs/HowToAddUnittest.md b/docs/HowToAddUnittest.md
new file mode 100644
index 000000000..6612f153d
--- /dev/null
+++ b/docs/HowToAddUnittest.md
@@ -0,0 +1,27 @@
+# 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. Add dependancy on `googletest` to your test executable
+```
+add_executable($YOURTEST_TARGET yourtest1.cc yourtest2.cc)
+add_dependencies($YOURTEST_TARGET googletest)
+```
+
+### 3. Link test executable against libgtest.a and libgtest_main.a (+ pthread)
+```
+target_link_libraries($YOURTEST_TARGET libgtest.a libgtest_main.a pthread)
+```
+
+### 4. Install test executable into Product/out/unittest
+```
+install(TARGETS $YOURTEST_TARGET DESTINATION unittest)
+```