Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
Murmele committed Nov 1, 2023
1 parent 57cf7c9 commit dfb45a6
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Define test macro.
macro(test)
cmake_parse_arguments(ARG "" "NAME" "" ${ARGN})
cmake_parse_arguments(ARG "NO_WIN32_OFFSCREEN" "NAME" "" ${ARGN})

add_executable(test_${ARG_NAME} ${ARG_NAME}.cpp)
target_link_libraries(test_${ARG_NAME} testlib)
Expand All @@ -15,13 +15,24 @@ macro(test)
add_test(NAME ${ARG_NAME} COMMAND $<TARGET_FILE:test_${ARG_NAME}>)
add_dependencies(check_build test_${ARG_NAME})

if(${ARG_NO_WIN32_OFFSCREEN})
set_property(
TEST ${ARG_NAME}
APPEND
PROPERTY LABELS "NO_WIN32_OFFSCREEN")
endif()

if(WIN32)
find_package(Qt6Gui)
string(REPLACE ";" "\;" NEWPATH "$ENV{PATH}")
string(REPLACE ";" "\;" PLUGIN_PATH
"$<TARGET_FILE_DIR:Qt6::QOffscreenIntegrationPlugin>")

set(PLATFORM "windows")
if(${ARG_NO_WIN32_OFFSCREEN})
set(PLATFORM "windows")
else()
set(PLATFORM "offscreen")
endif()

set_tests_properties(
${ARG_NAME}
Expand All @@ -46,6 +57,16 @@ add_custom_target(
COMMENT "Running tests..."
USES_TERMINAL)

# Add check target excluding NO_WIN32_OFFSCREEN tests.
add_custom_target(
check_no_win32_offscreen
COMMAND ${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure
--timeout 300 --label-exclude NO_WIN32_OFFSCREEN
DEPENDS check_build
COMMENT "Running tests..."
USES_TERMINAL)


enable_testing()

# Add test library.
Expand Down Expand Up @@ -90,7 +111,7 @@ test(NAME referencelist)
test(NAME amend)
test(NAME SshConfig)
test(NAME store)
test(NAME fileContextMenu)
test(NAME fileContextMenu NO_WIN32_OFFSCREEN)
test(NAME Setting)
test(NAME commitMessageTemplate)
test(NAME commitEditor)
Expand Down

0 comments on commit dfb45a6

Please sign in to comment.