mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-03 03:53:56 -07:00
Add dummy googletest
Uses the built in cmake -Dtest=ON It should download googletest on the fly if needed. Adds a new make target, `make test` Ref #167
This commit is contained in:
parent
cd02df78a1
commit
3ebe42c400
6 changed files with 75 additions and 6 deletions
|
|
@ -341,3 +341,11 @@ option(PORTABLE "portable build" OFF)
|
|||
IF(PORTABLE)
|
||||
add_definitions(-DPORTABLE_BUILD)
|
||||
endif()
|
||||
|
||||
if(test)
|
||||
enable_testing()
|
||||
message(STATUS "Adding tests")
|
||||
add_executable(cockatrice_test test/dummy_test.cpp)
|
||||
target_link_libraries(cockatrice_test gtest_main)
|
||||
add_test(NAME cockatrice_test COMMAND cockatrice_test)
|
||||
endif()
|
||||
16
cockatrice/test/dummy_test.cpp
Normal file
16
cockatrice/test/dummy_test.cpp
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#include "gtest/gtest.h"
|
||||
|
||||
namespace {
|
||||
class FooTest : public ::testing::Test {
|
||||
|
||||
};
|
||||
|
||||
TEST(DummyTest, Works) {
|
||||
ASSERT_EQ(1, 1) << "One is not equal to one";
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue