Adding code
This commit is contained in:
19
tests/CMakeLists.txt
Normal file
19
tests/CMakeLists.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
googletest
|
||||
GIT_REPOSITORY https://github.com/google/googletest.git
|
||||
GIT_TAG release-1.11.0
|
||||
)
|
||||
FetchContent_MakeAvailable(googletest)
|
||||
add_library(GTest::GTest INTERFACE IMPORTED)
|
||||
target_link_libraries(GTest::GTest INTERFACE gtest_main)
|
||||
|
||||
|
||||
file(GLOB_RECURSE TEST_SRC "*.cpp")
|
||||
add_executable(Test ${TEST_SRC})
|
||||
target_link_libraries(Test PUBLIC J3ML)
|
||||
#find_package(GTest REQUIRED)
|
||||
target_link_libraries(Test PRIVATE GTest::GTest)
|
||||
include_directories("include")
|
||||
add_test(NAME "J3MLTestSuite" COMMAND J3MLTestSuite)
|
7
tests/tests.cpp
Normal file
7
tests/tests.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
|
||||
GTEST_API_ int main(int argc, char** argv) {
|
||||
testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
Reference in New Issue
Block a user