aboutsummaryrefslogtreecommitdiff
path: root/test cases/frameworks
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2015-06-14 18:42:30 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2015-06-14 18:42:30 +0300
commit39c26d6fe007ae6012a3a4d41d8cadcafecc4048 (patch)
tree152afc5d7bd17eed55696c29467752891fa918e2 /test cases/frameworks
parent2c3986796eaa9265deaae34ccb7b09bfb3b32df8 (diff)
downloadmeson-39c26d6fe007ae6012a3a4d41d8cadcafecc4048.zip
meson-39c26d6fe007ae6012a3a4d41d8cadcafecc4048.tar.gz
meson-39c26d6fe007ae6012a3a4d41d8cadcafecc4048.tar.bz2
Can use both main and nomain gtest in same project. Fixes #149.
Diffstat (limited to 'test cases/frameworks')
-rw-r--r--test cases/frameworks/2 gtest/meson.build4
-rw-r--r--test cases/frameworks/2 gtest/test_nomain.cc14
2 files changed, 18 insertions, 0 deletions
diff --git a/test cases/frameworks/2 gtest/meson.build b/test cases/frameworks/2 gtest/meson.build
index 50499a5..419f451 100644
--- a/test cases/frameworks/2 gtest/meson.build
+++ b/test cases/frameworks/2 gtest/meson.build
@@ -1,6 +1,10 @@
project('gtest', 'cpp')
gtest = dependency('gtest', main : true)
+gtest_nomain = dependency('gtest', main : false)
e = executable('testprog', 'test.cc', dependencies : gtest)
test('gtest test', e)
+
+e = executable('testprog_nomain', 'test_nomain.cc', dependencies : gtest_nomain)
+test('gtest nomain test', e)
diff --git a/test cases/frameworks/2 gtest/test_nomain.cc b/test cases/frameworks/2 gtest/test_nomain.cc
new file mode 100644
index 0000000..bd0bcfe
--- /dev/null
+++ b/test cases/frameworks/2 gtest/test_nomain.cc
@@ -0,0 +1,14 @@
+#include<gtest/gtest.h>
+
+TEST(basic_test, eq_works) {
+ ASSERT_EQ(0, 1-1) << "Equality is broken. Mass panic!";
+}
+
+TEST(basic_test, neq_works) {
+ ASSERT_NE(15, 106) << "Inequal is equal. The foundations of space and time are in jeopardy.";
+}
+
+int main(int argc, char **argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}