mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 03:55:24 +00:00
Meta: Add option to specify custom test names for Lagom
This commit is contained in:
parent
dbd624e875
commit
610fe28115
Notes:
sideshowbarker
2024-07-17 08:36:27 +09:00
Author: https://github.com/DanShaders Commit: https://github.com/SerenityOS/serenity/commit/610fe28115 Pull-request: https://github.com/SerenityOS/serenity/pull/21612 Reviewed-by: https://github.com/ADKaster
1 changed files with 9 additions and 7 deletions
|
@ -254,16 +254,18 @@ function(lagom_lib target_name fs_name)
|
|||
endfunction()
|
||||
|
||||
function(lagom_test source)
|
||||
cmake_parse_arguments(LAGOM_TEST "" "WORKING_DIRECTORY" "LIBS" ${ARGN})
|
||||
get_filename_component(name ${source} NAME_WE)
|
||||
add_executable(${name} ${source})
|
||||
target_link_libraries(${name} PRIVATE LibCore LibFileSystem LibTest LibTestMain ${LAGOM_TEST_LIBS})
|
||||
cmake_parse_arguments(LAGOM_TEST "" "NAME;WORKING_DIRECTORY" "LIBS" ${ARGN})
|
||||
if (NOT DEFINED LAGOM_TEST_NAME)
|
||||
get_filename_component(LAGOM_TEST_NAME ${source} NAME_WE)
|
||||
endif()
|
||||
add_executable(${LAGOM_TEST_NAME} ${source})
|
||||
target_link_libraries(${LAGOM_TEST_NAME} PRIVATE LibCore LibFileSystem LibTest LibTestMain ${LAGOM_TEST_LIBS})
|
||||
add_test(
|
||||
NAME ${name}
|
||||
COMMAND ${name}
|
||||
NAME ${LAGOM_TEST_NAME}
|
||||
COMMAND ${LAGOM_TEST_NAME}
|
||||
WORKING_DIRECTORY ${LAGOM_TEST_WORKING_DIRECTORY}
|
||||
)
|
||||
set_target_properties(${name} PROPERTIES LAGOM_WORKING_DIRECTORY "${LAGOM_TEST_WORKING_DIRECTORY}")
|
||||
set_target_properties(${LAGOM_TEST_NAME} PROPERTIES LAGOM_WORKING_DIRECTORY "${LAGOM_TEST_WORKING_DIRECTORY}")
|
||||
endfunction()
|
||||
|
||||
function(serenity_test test_src sub_dir)
|
||||
|
|
Loading…
Add table
Reference in a new issue