summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2017-04-22 09:38:55 (GMT)
committerCraig Scott <craig.scott@crascit.com>2017-05-01 15:54:13 (GMT)
commitc1b2b7c03c899c9b066840600ec15b16ae2fa9ac (patch)
tree588318387fddce99535d6f90637cfd670e2a24b8 /Tests/RunCMake
parent02d11868827417e88cbbee795703421dfdb342f6 (diff)
downloadCMake-c1b2b7c03c899c9b066840600ec15b16ae2fa9ac.zip
CMake-c1b2b7c03c899c9b066840600ec15b16ae2fa9ac.tar.gz
CMake-c1b2b7c03c899c9b066840600ec15b16ae2fa9ac.tar.bz2
Add ctest options for limiting which tests fixtures add
The new options allow the user to restrict the setup and cleanup tests automatically added for fixtures.
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/ctest_fixtures/CMakeLists.txt.in2
-rw-r--r--Tests/RunCMake/ctest_fixtures/RunCMakeTest.cmake50
-rw-r--r--Tests/RunCMake/ctest_fixtures/exclude_any_bar-stdout.txt15
-rw-r--r--Tests/RunCMake/ctest_fixtures/exclude_any_foo-stdout.txt13
-rw-r--r--Tests/RunCMake/ctest_fixtures/exclude_any_foobar-stdout.txt9
-rw-r--r--Tests/RunCMake/ctest_fixtures/exclude_cleanup_bar-stdout.txt15
-rw-r--r--Tests/RunCMake/ctest_fixtures/exclude_cleanup_foo-stdout.txt15
-rw-r--r--Tests/RunCMake/ctest_fixtures/exclude_setup_bar-stdout.txt17
-rw-r--r--Tests/RunCMake/ctest_fixtures/exclude_setup_foo-stdout.txt15
-rw-r--r--Tests/RunCMake/ctest_fixtures/test.cmake.in2
10 files changed, 151 insertions, 2 deletions
diff --git a/Tests/RunCMake/ctest_fixtures/CMakeLists.txt.in b/Tests/RunCMake/ctest_fixtures/CMakeLists.txt.in
index ab50fdd..5cb0b4e 100644
--- a/Tests/RunCMake/ctest_fixtures/CMakeLists.txt.in
+++ b/Tests/RunCMake/ctest_fixtures/CMakeLists.txt.in
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.6.2)
+cmake_minimum_required (VERSION 3.8.0)
project(ctest_fixtures LANGUAGES NONE)
include(CTest)
diff --git a/Tests/RunCMake/ctest_fixtures/RunCMakeTest.cmake b/Tests/RunCMake/ctest_fixtures/RunCMakeTest.cmake
index 673cf57..1754203 100644
--- a/Tests/RunCMake/ctest_fixtures/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_fixtures/RunCMakeTest.cmake
@@ -19,6 +19,41 @@ run_ctest_test(setupFoo INCLUDE setupFoo)
run_ctest_test(wontRun INCLUDE wontRun)
run_ctest_test(unused INCLUDE Unused)
+run_ctest_test(exclude_setup_foo
+ INCLUDE "one|two"
+ EXCLUDE_FIXTURE_SETUP "Foo"
+)
+
+run_ctest_test(exclude_setup_bar
+ INCLUDE "one|two"
+ EXCLUDE_FIXTURE_SETUP "Bar"
+)
+
+run_ctest_test(exclude_cleanup_foo
+ INCLUDE "one|two"
+ EXCLUDE_FIXTURE_CLEANUP "Foo"
+)
+
+run_ctest_test(exclude_cleanup_bar
+ INCLUDE "one|two"
+ EXCLUDE_FIXTURE_CLEANUP "Bar"
+)
+
+run_ctest_test(exclude_any_foo
+ INCLUDE "one|two"
+ EXCLUDE_FIXTURE "Foo"
+)
+
+run_ctest_test(exclude_any_bar
+ INCLUDE "one|two"
+ EXCLUDE_FIXTURE "Bar"
+)
+
+run_ctest_test(exclude_any_foobar
+ INCLUDE "one|two"
+ EXCLUDE_FIXTURE "Foo|Bar"
+)
+
#------------------------------------------------------------
# CMake configure will fail due to cyclic test dependencies
#------------------------------------------------------------
@@ -35,3 +70,18 @@ set(CASE_CMAKELISTS_CYCLIC_CODE [[
FIXTURES_REQUIRED "Foo")
]])
run_ctest(cyclicCleanup)
+
+#------------------------------------------------------------
+# Repeat some of the exclusion tests with ctest command line
+# options instead of arguments to ctest_test(). This verifies
+# that the command line options make it through as well.
+#------------------------------------------------------------
+unset(CASE_CMAKELISTS_CYCLIC_CODE)
+set(CASE_CTEST_FIXTURES_ARGS "")
+
+run_ctest(exclude_setup_foo -R "one|two" -FS Foo)
+run_ctest(exclude_setup_foo -R "one|two" --fixture-exclude-setup Foo)
+run_ctest(exclude_cleanup_foo -R "one|two" -FC Foo)
+run_ctest(exclude_cleanup_foo -R "one|two" --fixture-exclude-cleanup Foo)
+run_ctest(exclude_any_foo -R "one|two" -FA Foo)
+run_ctest(exclude_any_foo -R "one|two" --fixture-exclude-any Foo)
diff --git a/Tests/RunCMake/ctest_fixtures/exclude_any_bar-stdout.txt b/Tests/RunCMake/ctest_fixtures/exclude_any_bar-stdout.txt
new file mode 100644
index 0000000..82663d5
--- /dev/null
+++ b/Tests/RunCMake/ctest_fixtures/exclude_any_bar-stdout.txt
@@ -0,0 +1,15 @@
+Test project .*/Tests/RunCMake/ctest_fixtures/exclude_any_bar-build
+ Start 3: setupFoo
+1/5 Test #3: setupFoo +\.+ +Passed +[0-9.]+ sec
+ Start 2: setupBoth
+2/5 Test #2: setupBoth +\.+ +Passed +[0-9.]+ sec
+ Start 1: one
+3/5 Test #1: one +\.+ +Passed +[0-9.]+ sec
+ Start 5: cleanupFoo
+4/5 Test #5: cleanupFoo +\.+ +Passed +[0-9.]+ sec
+ Start 6: two
+5/5 Test #6: two +\.+ +Passed +[0-9.]+ sec
++
+100% tests passed, 0 tests failed out of 5
++
+Total Test time \(real\) = +[0-9.]+ sec$
diff --git a/Tests/RunCMake/ctest_fixtures/exclude_any_foo-stdout.txt b/Tests/RunCMake/ctest_fixtures/exclude_any_foo-stdout.txt
new file mode 100644
index 0000000..8c08d08
--- /dev/null
+++ b/Tests/RunCMake/ctest_fixtures/exclude_any_foo-stdout.txt
@@ -0,0 +1,13 @@
+Test project .*/Tests/RunCMake/ctest_fixtures/exclude_any_foo-build
+ Start 2: setupBoth
+1/4 Test #2: setupBoth +\.+ +Passed +[0-9.]+ sec
+ Start 1: one
+2/4 Test #1: one +\.+ +Passed +[0-9.]+ sec
+ Start 6: two
+3/4 Test #6: two +\.+ +Passed +[0-9.]+ sec
+ Start 7: cleanupBar
+4/4 Test #7: cleanupBar +\.+ +Passed +[0-9.]+ sec
++
+100% tests passed, 0 tests failed out of 4
++
+Total Test time \(real\) = +[0-9.]+ sec$
diff --git a/Tests/RunCMake/ctest_fixtures/exclude_any_foobar-stdout.txt b/Tests/RunCMake/ctest_fixtures/exclude_any_foobar-stdout.txt
new file mode 100644
index 0000000..876768b
--- /dev/null
+++ b/Tests/RunCMake/ctest_fixtures/exclude_any_foobar-stdout.txt
@@ -0,0 +1,9 @@
+Test project .*/Tests/RunCMake/ctest_fixtures/exclude_any_foobar-build
+ Start 1: one
+1/2 Test #1: one +\.+ +Passed +[0-9.]+ sec
+ Start 6: two
+2/2 Test #6: two +\.+ +Passed +[0-9.]+ sec
++
+100% tests passed, 0 tests failed out of 2
++
+Total Test time \(real\) = +[0-9.]+ sec$
diff --git a/Tests/RunCMake/ctest_fixtures/exclude_cleanup_bar-stdout.txt b/Tests/RunCMake/ctest_fixtures/exclude_cleanup_bar-stdout.txt
new file mode 100644
index 0000000..0d27198
--- /dev/null
+++ b/Tests/RunCMake/ctest_fixtures/exclude_cleanup_bar-stdout.txt
@@ -0,0 +1,15 @@
+Test project .*/Tests/RunCMake/ctest_fixtures/exclude_cleanup_bar-build
+ Start 3: setupFoo
+1/5 Test #3: setupFoo +\.+ +Passed +[0-9.]+ sec
+ Start 2: setupBoth
+2/5 Test #2: setupBoth +\.+ +Passed +[0-9.]+ sec
+ Start 1: one
+3/5 Test #1: one +\.+ +Passed +[0-9.]+ sec
+ Start 5: cleanupFoo
+4/5 Test #5: cleanupFoo +\.+ +Passed +[0-9.]+ sec
+ Start 6: two
+5/5 Test #6: two +\.+ +Passed +[0-9.]+ sec
++
+100% tests passed, 0 tests failed out of 5
++
+Total Test time \(real\) = +[0-9.]+ sec$
diff --git a/Tests/RunCMake/ctest_fixtures/exclude_cleanup_foo-stdout.txt b/Tests/RunCMake/ctest_fixtures/exclude_cleanup_foo-stdout.txt
new file mode 100644
index 0000000..5b201a3
--- /dev/null
+++ b/Tests/RunCMake/ctest_fixtures/exclude_cleanup_foo-stdout.txt
@@ -0,0 +1,15 @@
+Test project .*/Tests/RunCMake/ctest_fixtures/exclude_cleanup_foo-build
+ Start 3: setupFoo
+1/5 Test #3: setupFoo +\.+ +Passed +[0-9.]+ sec
+ Start 2: setupBoth
+2/5 Test #2: setupBoth +\.+ +Passed +[0-9.]+ sec
+ Start 1: one
+3/5 Test #1: one +\.+ +Passed +[0-9.]+ sec
+ Start 6: two
+4/5 Test #6: two +\.+ +Passed +[0-9.]+ sec
+ Start 7: cleanupBar
+5/5 Test #7: cleanupBar +\.+ +Passed +[0-9.]+ sec
++
+100% tests passed, 0 tests failed out of 5
++
+Total Test time \(real\) = +[0-9.]+ sec$
diff --git a/Tests/RunCMake/ctest_fixtures/exclude_setup_bar-stdout.txt b/Tests/RunCMake/ctest_fixtures/exclude_setup_bar-stdout.txt
new file mode 100644
index 0000000..5357fef
--- /dev/null
+++ b/Tests/RunCMake/ctest_fixtures/exclude_setup_bar-stdout.txt
@@ -0,0 +1,17 @@
+Test project .*/Tests/RunCMake/ctest_fixtures/exclude_setup_bar-build
+ Start 3: setupFoo
+1/6 Test #3: setupFoo +\.+ +Passed +[0-9.]+ sec
+ Start 2: setupBoth
+2/6 Test #2: setupBoth +\.+ +Passed +[0-9.]+ sec
+ Start 1: one
+3/6 Test #1: one +\.+ +Passed +[0-9.]+ sec
+ Start 5: cleanupFoo
+4/6 Test #5: cleanupFoo +\.+ +Passed +[0-9.]+ sec
+ Start 6: two
+5/6 Test #6: two +\.+ +Passed +[0-9.]+ sec
+ Start 7: cleanupBar
+6/6 Test #7: cleanupBar +\.+ +Passed +[0-9.]+ sec
++
+100% tests passed, 0 tests failed out of 6
++
+Total Test time \(real\) = +[0-9.]+ sec$
diff --git a/Tests/RunCMake/ctest_fixtures/exclude_setup_foo-stdout.txt b/Tests/RunCMake/ctest_fixtures/exclude_setup_foo-stdout.txt
new file mode 100644
index 0000000..89f7f44
--- /dev/null
+++ b/Tests/RunCMake/ctest_fixtures/exclude_setup_foo-stdout.txt
@@ -0,0 +1,15 @@
+Test project .*/Tests/RunCMake/ctest_fixtures/exclude_setup_foo-build
+ Start 2: setupBoth
+1/5 Test #2: setupBoth +\.+ +Passed +[0-9.]+ sec
+ Start 1: one
+2/5 Test #1: one +\.+ +Passed +[0-9.]+ sec
+ Start 5: cleanupFoo
+3/5 Test #5: cleanupFoo +\.+ +Passed +[0-9.]+ sec
+ Start 6: two
+4/5 Test #6: two +\.+ +Passed +[0-9.]+ sec
+ Start 7: cleanupBar
+5/5 Test #7: cleanupBar +\.+ +Passed +[0-9.]+ sec
++
+100% tests passed, 0 tests failed out of 5
++
+Total Test time \(real\) = +[0-9.]+ sec$
diff --git a/Tests/RunCMake/ctest_fixtures/test.cmake.in b/Tests/RunCMake/ctest_fixtures/test.cmake.in
index 43df172..7067117 100644
--- a/Tests/RunCMake/ctest_fixtures/test.cmake.in
+++ b/Tests/RunCMake/ctest_fixtures/test.cmake.in
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.6.2)
+cmake_minimum_required(VERSION 3.8.0)
set(CTEST_SITE "test-site")
set(CTEST_BUILD_NAME "test-build-name")