diff options
author | Matthew Barth <msbarth@us.ibm.com> | 2016-09-09 12:15:46 -0500 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2016-09-28 13:34:35 +0000 |
commit | 00b1e5be1ce0d74541e371790e36a53146cb3b44 (patch) | |
tree | c07eb4866e773bc60952fabea72014ee2734bc89 /test | |
parent | 41cae2b51107f06bfa50c6dd0fbc68a799a6c219 (diff) | |
download | phosphor-host-ipmid-00b1e5be1ce0d74541e371790e36a53146cb3b44.tar.gz phosphor-host-ipmid-00b1e5be1ce0d74541e371790e36a53146cb3b44.zip |
Propose and implement unit test framework
Enable use of GoogleTest and created a sample unit test case.
Change-Id: Ie370745a32777d4ed81ee24145364029c8e7bf02
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.am | 12 | ||||
-rw-r--r-- | test/sample_unittest.cpp | 6 |
2 files changed, 18 insertions, 0 deletions
diff --git a/test/Makefile.am b/test/Makefile.am new file mode 100644 index 0000000..6bed2cb --- /dev/null +++ b/test/Makefile.am @@ -0,0 +1,12 @@ +check_PROGRAMS = + +# Run all 'check' test programs +TESTS = $(check_PROGRAMS) + +# Build/add sample_unittest to test suite +check_PROGRAMS += sample_unittest +sample_unittest_CPPFLAGS = -Igtest $(GTEST_CPPFLAGS) +sample_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) +sample_unittest_LDFLAGS = -lgtest_main -lgtest $(PTHREAD_LIBS) $(OESDK_TESTCASE_FLAGS) +sample_unittest_SOURCES = sample_unittest.cpp +sample_unittest_LDADD = $(top_builddir)/sample.o diff --git a/test/sample_unittest.cpp b/test/sample_unittest.cpp new file mode 100644 index 0000000..2a27279 --- /dev/null +++ b/test/sample_unittest.cpp @@ -0,0 +1,6 @@ +#include "sample.h" +#include <gtest/gtest.h> + +TEST(FactorialTest, Zero) { + EXPECT_EQ(1, Factorial(0)); +} |