diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b73ef1f..9f787f47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,6 +59,7 @@ elseif(WITH_GOOGLE_TEST) target_link_libraries( gtest_version GTest::gtest_main + helloworld ) include(GoogleTest) diff --git a/googletest_version.cpp b/googletest_version.cpp index bed7b59e..1ebf9ab3 100644 --- a/googletest_version.cpp +++ b/googletest_version.cpp @@ -1,9 +1,7 @@ #include - +#include "lib.h" // Demonstrate some basic assertions. -TEST(HelloTest, BasicAssertions) { - // Expect two strings not to be equal. - EXPECT_STRNE("hello", "world"); +TEST(VersionTest, BasicAssertions) { // Expect equality. - EXPECT_EQ(7 * 6, 42); -} \ No newline at end of file +ASSERT_GT(version(), 0) << "wrong programm version"; +}