Add gtest

This commit is contained in:
Patricia Aas 2020-11-27 17:48:38 +01:00
parent 28367bd088
commit 170c18762d
4 changed files with 20 additions and 1 deletions

View file

@ -1 +1,2 @@
add_subdirectory(src)
add_subdirectory(src)
add_subdirectory(test)

View file

@ -9,6 +9,7 @@ class ConanDependencies(ConanFile):
}
def requirements(self):
self.requires("gtest/1.10.0")
self.requires("sdl2/2.0.9@bincrafters/stable")
self.requires("sdl2_image/2.0.4@bincrafters/stable")

View file

@ -0,0 +1,11 @@
enable_testing()
find_package(GTest REQUIRED)
include(GoogleTest)
add_executable(tests tests.cpp)
target_link_libraries(tests GTest::GTest)
gtest_add_tests(TARGET tests TEST_PREFIX old_pacman:)
gtest_discover_tests(tests TEST_PREFIX new_pacman:)
add_test(NAME monolithic COMMAND tests)

6
pacman/test/tests.cpp Normal file
View file

@ -0,0 +1,6 @@
#include <gtest/gtest.h>
int main(int argc, char* argv[]) {
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}