Skip to content

Commit dbf882b

Browse files
authored
Merge pull request #105 from phprus/test-options
Added options for testing
2 parents 2a7ebf3 + 6033320 commit dbf882b

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ else()
1717
option(GHC_FILESYSTEM_BUILD_TESTING "Enable tests" OFF)
1818
option(GHC_FILESYSTEM_WITH_INSTALL "With install target" ON)
1919
endif()
20+
option(GHC_FILESYSTEM_BUILD_STD_TESTING "Enable STD tests" ${GHC_FILESYSTEM_BUILD_TESTING})
21+
if(NOT DEFINED GHC_FILESYSTEM_TEST_COMPILE_FEATURES)
22+
set(GHC_FILESYSTEM_TEST_COMPILE_FEATURES ${CMAKE_CXX_COMPILE_FEATURES})
23+
endif()
2024

2125
if(NOT DEFINED CMAKE_CXX_STANDARD)
2226
set(CMAKE_CXX_STANDARD 11)

test/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ else()
2929
set_target_properties(filesystem_test PROPERTIES LINK_FLAGS "-g4 -s DISABLE_EXCEPTION_CATCHING=0 -s ALLOW_MEMORY_GROWTH=1")
3030
endif()
3131
ParseAndAddCatchTests(filesystem_test)
32-
AddExecutableWithStdFS(std_filesystem_test filesystem_test.cpp catch.hpp)
32+
if(GHC_FILESYSTEM_BUILD_STD_TESTING)
33+
AddExecutableWithStdFS(std_filesystem_test filesystem_test.cpp catch.hpp)
34+
endif()
3335
if(WIN32)
3436
add_executable(filesystem_test_char filesystem_test.cpp catch.hpp)
3537
target_link_libraries(filesystem_test_char ghc_filesystem)
@@ -44,10 +46,10 @@ else()
4446
endif()
4547
ParseAndAddCatchTests(filesystem_test_char)
4648
endif()
47-
if("cxx_std_17" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
49+
if("cxx_std_17" IN_LIST GHC_FILESYSTEM_TEST_COMPILE_FEATURES)
4850
AddTestExecutableWithStdCpp(17 filesystem_test.cpp catch.hpp)
4951
endif()
50-
if("cxx_std_20" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
52+
if("cxx_std_20" IN_LIST GHC_FILESYSTEM_TEST_COMPILE_FEATURES)
5153
AddTestExecutableWithStdCpp(20 filesystem_test.cpp catch.hpp)
5254
endif()
5355
endif()

0 commit comments

Comments
 (0)