From df3bd9ca4195492ef4cd40659cc5bc542ff57a5c Mon Sep 17 00:00:00 2001 From: Cruel Date: Thu, 6 Feb 2014 23:13:00 -0500 Subject: [PATCH] Basic unit testing setup. --- .travis.yml | 16 ++++++++++++++++ test/main.cpp | 10 ++++++++++ test/run.sh | 7 +++++++ 3 files changed, 33 insertions(+) create mode 100644 .travis.yml create mode 100644 test/main.cpp create mode 100755 test/run.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..989233c --- /dev/null +++ b/.travis.yml @@ -0,0 +1,16 @@ +language: cpp +compiler: + - gcc +before_install: + - sudo apt-get update + - sudo apt-get install libgtest-dev + - "cd /usr/src/gtest && sudo cmake . && sudo cmake --build . && sudo mv libg* /usr/local/lib/ ; cd -" +script: "cd test && ./run.sh" +notifications: + recipients: + - machin3@gmail.com + email: + on_success: change + on_failure: always +rvm: + - 1.00 \ No newline at end of file diff --git a/test/main.cpp b/test/main.cpp new file mode 100644 index 0000000..9d10927 --- /dev/null +++ b/test/main.cpp @@ -0,0 +1,10 @@ +#include "gtest/gtest.h" + +TEST(Test, EqualityCheck){ + EXPECT_EQ(true, false); +} + +int main(int argc, char **argv) { + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/test/run.sh b/test/run.sh new file mode 100755 index 0000000..295f6de --- /dev/null +++ b/test/run.sh @@ -0,0 +1,7 @@ +echo "Compiling unit tests..." +g++ main.cpp -lgtest -std=c++11 -o test +echo "Running unit tests..." +./test -v +result=$? +echo "Unit tests completed. Result: $result" +exit $result \ No newline at end of file