Unverified Commit 1c2d12ba authored by Ian Humphrey's avatar Ian Humphrey Committed by GitHub
Browse files

Merge pull request #534 from makaylas/testing

Added test file discovery support and seperated the main into another…
parents 32fe49a4 8046da0a
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -2,10 +2,14 @@ cmake_minimum_required(VERSION 3.10)

add_dependencies(isis3 isis3)

file(GLOB test_source "${CMAKE_SOURCE_DIR}/tests/*.cpp")


# Link runISISTests with what we want to test and the GTest and pthread library
add_executable(runISISTests
               FileNameTests.cpp)
               IsisTestMain.cpp
               ${test_source})
               
target_link_libraries(runISISTests isis3 ${ALLLIBS} ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} pthread)

gtest_discover_tests(runISISTests WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/../tests)
gtest_discover_tests(runISISTests WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests)
+6 −0
Original line number Diff line number Diff line
#include <gtest/gtest.h>

int main(int argc, char **argv) {
   ::testing::InitGoogleTest(&argc, argv);
   return RUN_ALL_TESTS();
}