Loading src/UnitTests/CMakeLists.txt +5 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,10 @@ ADD_EXECUTABLE( DummyTest DummyTest.cpp ) TARGET_COMPILE_OPTIONS( DummyTest PRIVATE ${CXX_TESTS_FLAGS} ) TARGET_LINK_LIBRARIES( DummyTest ${GTEST_BOTH_LIBRARIES} ) ADD_EXECUTABLE( DummyTestFail DummyTestFail.cpp ) TARGET_COMPILE_OPTIONS( DummyTestFail PRIVATE ${CXX_TESTS_FLAGS} ) TARGET_LINK_LIBRARIES( DummyTestFail ${GTEST_BOTH_LIBRARIES} ) # Specify a cuda test # if( BUILD_CUDA ) Loading @@ -17,6 +21,7 @@ TARGET_LINK_LIBRARIES( DummyTest ${GTEST_BOTH_LIBRARIES} ) # endif() ADD_TEST( DummyTest ${EXECUTABLE_OUTPUT_PATH}/DummyTest${CMAKE_EXECUTABLE_SUFFIX} ) ADD_TEST( DummyTestFail ${EXECUTABLE_OUTPUT_PATH}/DummyTestFail${CMAKE_EXECUTABLE_SUFFIX} ) # Add the tests Loading src/UnitTests/DummyTestFail.cpp 0 → 100644 +22 −0 Original line number Diff line number Diff line #ifdef HAVE_GTEST #include <gtest/gtest.h> using namespace TNL; TEST( DummyTest, basicTest ) { const bool tr = true; const bool fa = false; const int two = 2; const int ten = 10; EXPECT_EQ(tr, true); EXPECT_EQ(fa, false); EXPECT_EQ(two, 2); EXPECT_EQ(ten, 5); // fail expected } #endif #include "main.h" Loading
src/UnitTests/CMakeLists.txt +5 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,10 @@ ADD_EXECUTABLE( DummyTest DummyTest.cpp ) TARGET_COMPILE_OPTIONS( DummyTest PRIVATE ${CXX_TESTS_FLAGS} ) TARGET_LINK_LIBRARIES( DummyTest ${GTEST_BOTH_LIBRARIES} ) ADD_EXECUTABLE( DummyTestFail DummyTestFail.cpp ) TARGET_COMPILE_OPTIONS( DummyTestFail PRIVATE ${CXX_TESTS_FLAGS} ) TARGET_LINK_LIBRARIES( DummyTestFail ${GTEST_BOTH_LIBRARIES} ) # Specify a cuda test # if( BUILD_CUDA ) Loading @@ -17,6 +21,7 @@ TARGET_LINK_LIBRARIES( DummyTest ${GTEST_BOTH_LIBRARIES} ) # endif() ADD_TEST( DummyTest ${EXECUTABLE_OUTPUT_PATH}/DummyTest${CMAKE_EXECUTABLE_SUFFIX} ) ADD_TEST( DummyTestFail ${EXECUTABLE_OUTPUT_PATH}/DummyTestFail${CMAKE_EXECUTABLE_SUFFIX} ) # Add the tests Loading
src/UnitTests/DummyTestFail.cpp 0 → 100644 +22 −0 Original line number Diff line number Diff line #ifdef HAVE_GTEST #include <gtest/gtest.h> using namespace TNL; TEST( DummyTest, basicTest ) { const bool tr = true; const bool fa = false; const int two = 2; const int ten = 10; EXPECT_EQ(tr, true); EXPECT_EQ(fa, false); EXPECT_EQ(two, 2); EXPECT_EQ(ten, 5); // fail expected } #endif #include "main.h"