diff options
author | Chunseok Lee <chunseok.lee@samsung.com> | 2018-05-04 17:57:16 +0900 |
---|---|---|
committer | Chunseok Lee <chunseok.lee@samsung.com> | 2018-05-04 17:57:16 +0900 |
commit | 07659ccd9fe7b1cf1547cc6cad78bcf489f0a361 (patch) | |
tree | cf3a123812b7f1ad8b50d7d0ace891e0c03c6110 /docs | |
parent | da6f7a3e8360a49fd073a6e0031a4da134d9d984 (diff) | |
download | nnfw-07659ccd9fe7b1cf1547cc6cad78bcf489f0a361.tar.gz nnfw-07659ccd9fe7b1cf1547cc6cad78bcf489f0a361.tar.bz2 nnfw-07659ccd9fe7b1cf1547cc6cad78bcf489f0a361.zip |
Imported Upstream version 0.1upstream/0.1submit/tizen/20180504.091146
Diffstat (limited to 'docs')
-rw-r--r-- | docs/howto/HowToAddUnittest.md | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/docs/howto/HowToAddUnittest.md b/docs/howto/HowToAddUnittest.md new file mode 100644 index 000000000..6612f153d --- /dev/null +++ b/docs/howto/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) +``` |