Skip to content

Commit

Permalink
feat: modify NAME argument in section to accept multi vals
Browse files Browse the repository at this point in the history
  • Loading branch information
threeal committed Jun 30, 2024
1 parent 45676dd commit e4353a7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmake/Assertion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,14 @@ endfunction()

# Begins a new test section.
#
# section(<name>)
# section(<name>...)
#
# This function begins a new test section named `<name>`. Use the `endsection`
# function to end the test section.
function(section NAME)
cmake_parse_arguments(PARSE_ARGV 1 ARG "" "" "")
string(JOIN "" NAME "${NAME}" ${ARG_UNPARSED_ARGUMENTS})

message(CHECK_START "${NAME}")
list(APPEND CMAKE_MESSAGE_INDENT " ")
set(CMAKE_MESSAGE_INDENT "${CMAKE_MESSAGE_INDENT}" PARENT_SCOPE)
Expand Down
7 changes: 7 additions & 0 deletions test/SectionCreation.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,11 @@ section("first section")
endsection()

assert(CMAKE_MESSAGE_INDENT STREQUAL " ")

section("second section"
" with a very very very long title" )
assert(CMAKE_MESSAGE_INDENT STREQUAL " ; ")
endsection()

assert(CMAKE_MESSAGE_INDENT STREQUAL " ")
endsection()

0 comments on commit e4353a7

Please sign in to comment.