summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/ctest_skipped_test/RunCMakeTest.cmake
blob: dcf5cd4e2f7b50f9a249d33bb1306bfeefe5e95c (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
include(RunCTest)

function(run_SkipTest)
  set(CASE_CMAKELISTS_SUFFIX_CODE [[
add_test(NAME SkipTest COMMAND ${skip_command})

set_tests_properties(SkipTest PROPERTIES SKIP_RETURN_CODE 125)
  ]])
  run_ctest(SkipTest)
endfunction()
run_SkipTest()

function(run_SkipSetupTest)
  set(CASE_CMAKELISTS_SUFFIX_CODE [[
add_test(NAME SkipTest COMMAND ${skip_command})
add_test(NAME SuccessfulCleanupTest COMMAND "${CMAKE_COMMAND}" --version)

set_tests_properties(SkipTest PROPERTIES SKIP_RETURN_CODE 125
                                         FIXTURES_SETUP "Foo")
set_tests_properties(SuccessfulTest PROPERTIES FIXTURES_REQUIRED "Foo")
set_tests_properties(SuccessfulCleanupTest PROPERTIES FIXTURES_CLEANUP "Foo")
  ]])
  run_ctest(SkipSetupTest)
endfunction()
run_SkipSetupTest()

function(run_SkipRequiredTest)
  set(CASE_CMAKELISTS_SUFFIX_CODE [[
add_test(NAME SkipTest COMMAND ${skip_command})
add_test(NAME SuccessfulCleanupTest COMMAND "${CMAKE_COMMAND}" --version)

set_tests_properties(SuccessfulTest PROPERTIES FIXTURES_SETUP "Foo")
set_tests_properties(SkipTest PROPERTIES SKIP_RETURN_CODE 125
                                         FIXTURES_REQUIRED "Foo")
set_tests_properties(SuccessfulCleanupTest PROPERTIES FIXTURES_CLEANUP "Foo")
  ]])
  run_ctest(SkipRequiredTest)
endfunction()
run_SkipRequiredTest()

function(run_SkipCleanupTest)
  set(CASE_CMAKELISTS_SUFFIX_CODE [[
add_test(NAME CleanupTest COMMAND ${skip_command})

set_tests_properties(SuccessfulTest PROPERTIES FIXTURES_REQUIRED "Foo")
set_tests_properties(CleanupTest PROPERTIES SKIP_RETURN_CODE 125
                                            FIXTURES_CLEANUP "Foo")
  ]])
  run_ctest(SkipCleanupTest)
endfunction()
run_SkipCleanupTest()