diff options
author | crupest <crupest@outlook.com> | 2023-10-07 17:42:22 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2023-10-07 17:42:22 +0800 |
commit | 922619988d0392d365bc48767183a218baf0def9 (patch) | |
tree | 146cd0f75bc24d0f6f0f1b8c11b9318ef8db9645 /test | |
parent | ae2ae81374792cb78259104b9cbc3e0fef5e6471 (diff) | |
download | cru-922619988d0392d365bc48767183a218baf0def9.tar.gz cru-922619988d0392d365bc48767183a218baf0def9.tar.bz2 cru-922619988d0392d365bc48767183a218baf0def9.zip |
Recover build. Remove test discovery in emscripten.
Diffstat (limited to 'test')
-rw-r--r-- | test/CMakeLists.txt | 14 | ||||
-rw-r--r-- | test/common/CMakeLists.txt | 2 | ||||
-rw-r--r-- | test/platform/CMakeLists.txt | 2 | ||||
-rw-r--r-- | test/platform/graphics/cairo/CMakeLists.txt | 2 | ||||
-rw-r--r-- | test/platform/graphics/direct2d/CMakeLists.txt | 2 | ||||
-rw-r--r-- | test/toml/CMakeLists.txt | 2 | ||||
-rw-r--r-- | test/xml/CMakeLists.txt | 2 |
7 files changed, 19 insertions, 7 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c4133193..10ab323e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,7 +1,19 @@ include(Catch) add_library(CruTestBase INTERFACE) -target_link_libraries(CruTestBase INTERFACE Catch2::Catch2WithMain) +if (EMSCRIPTEN) + target_link_libraries(CruTestBase INTERFACE Catch2::Catch2) +else() + target_link_libraries(CruTestBase INTERFACE Catch2::Catch2WithMain) +endif() + +function(cru_catch_discover_tests target) + if (EMSCRIPTEN) + message("Emscripten, not do catch_discover_tests for " target) + else() + catch_discover_tests(target) + endif() +endfunction() add_subdirectory(common) add_subdirectory(platform) diff --git a/test/common/CMakeLists.txt b/test/common/CMakeLists.txt index 85049357..650e82a9 100644 --- a/test/common/CMakeLists.txt +++ b/test/common/CMakeLists.txt @@ -20,4 +20,4 @@ if (WIN32) ) endif() -catch_discover_tests(CruBaseTest) +cru_catch_discover_tests(CruBaseTest) diff --git a/test/platform/CMakeLists.txt b/test/platform/CMakeLists.txt index 6a26214b..6a6f81e5 100644 --- a/test/platform/CMakeLists.txt +++ b/test/platform/CMakeLists.txt @@ -12,4 +12,4 @@ if (UNIX AND NOT EMSCRIPTEN) add_subdirectory(graphics/cairo) endif() -catch_discover_tests(CruPlatformBaseTest) +cru_catch_discover_tests(CruPlatformBaseTest) diff --git a/test/platform/graphics/cairo/CMakeLists.txt b/test/platform/graphics/cairo/CMakeLists.txt index 5d055aa2..273e6ebd 100644 --- a/test/platform/graphics/cairo/CMakeLists.txt +++ b/test/platform/graphics/cairo/CMakeLists.txt @@ -3,4 +3,4 @@ add_executable(CruPlatformGraphicsCairoTest ) target_link_libraries(CruPlatformGraphicsCairoTest PRIVATE CruPlatformGraphicsCairo CruTestBase) -catch_discover_tests(CruPlatformGraphicsCairoTest) +cru_catch_discover_tests(CruPlatformGraphicsCairoTest) diff --git a/test/platform/graphics/direct2d/CMakeLists.txt b/test/platform/graphics/direct2d/CMakeLists.txt index 66a07d15..db740b3d 100644 --- a/test/platform/graphics/direct2d/CMakeLists.txt +++ b/test/platform/graphics/direct2d/CMakeLists.txt @@ -3,4 +3,4 @@ add_executable(CruPlatformGraphicsDirect2dTest ) target_link_libraries(CruPlatformGraphicsDirect2dTest PRIVATE CruPlatformGraphicsDirect2d CruTestBase) -catch_discover_tests(CruPlatformGraphicsDirect2dTest) +cru_catch_discover_tests(CruPlatformGraphicsDirect2dTest) diff --git a/test/toml/CMakeLists.txt b/test/toml/CMakeLists.txt index 172a540b..a0909349 100644 --- a/test/toml/CMakeLists.txt +++ b/test/toml/CMakeLists.txt @@ -3,4 +3,4 @@ add_executable(CruTomlTest ) target_link_libraries(CruTomlTest PRIVATE CruToml CruTestBase) -catch_discover_tests(CruTomlTest) +cru_catch_discover_tests(CruTomlTest) diff --git a/test/xml/CMakeLists.txt b/test/xml/CMakeLists.txt index 9c8c1630..07bfa52b 100644 --- a/test/xml/CMakeLists.txt +++ b/test/xml/CMakeLists.txt @@ -3,4 +3,4 @@ add_executable(CruXmlTest ) target_link_libraries(CruXmlTest PRIVATE CruXml CruTestBase) -catch_discover_tests(CruXmlTest) +cru_catch_discover_tests(CruXmlTest) |