summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/cmake_parse_arguments/CornerCasesArgvN.cmake
blob: 807ed03e1e4e738a5d6ccd31b7c13b2a5066c10b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
include(${CMAKE_CURRENT_LIST_DIR}/test_utils.cmake)

function(test1)
  cmake_parse_arguments(PARSE_ARGV 0
    mpref "" "" "MULTI")

  TEST(mpref_MULTI foo "foo\;bar")

  cmake_parse_arguments(PARSE_ARGV 1
    upref "" "" "MULTI")

  TEST(upref_UNPARSED_ARGUMENTS foo "foo\;bar")
endfunction()
test1(MULTI foo "foo\;bar")

function(test2)
  cmake_parse_arguments(PARSE_ARGV 0
    mpref "" "" "MULTI")

  TEST(mpref_MULTI "foo;" "bar;")

  cmake_parse_arguments(PARSE_ARGV 1
    upref "" "" "MULTI")

  TEST(upref_UNPARSED_ARGUMENTS "foo;" "bar;")
endfunction()
test2(MULTI "foo;" "bar;")

function(test3)
  cmake_parse_arguments(PARSE_ARGV 0
    mpref "" "" "MULTI")

  TEST(mpref_MULTI "[foo;]" "bar\\")

  cmake_parse_arguments(PARSE_ARGV 1
    upref "" "" "MULTI")

  TEST(upref_UNPARSED_ARGUMENTS "[foo;]" "bar\\")
endfunction()
test3(MULTI "[foo;]" "bar\\")

function(test4)
  cmake_parse_arguments(PARSE_ARGV 0
    mpref "" "" "MULTI")

  TEST(mpref_MULTI foo "bar;none")

  cmake_parse_arguments(PARSE_ARGV 1
    upref "" "" "MULTI")

  TEST(upref_UNPARSED_ARGUMENTS foo "bar;none")
endfunction()
test4(MULTI foo bar\\ none)