Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMartin Hořeňovský2019-10-09 12:48:55 +0200
committerMartin Hořeňovský2019-10-09 12:54:13 +0200
commit3109add95ccbc0b388e874253a7894027726cb0c (patch)
tree03ca9d9acc16ca5a2ff5c1e9be23adee9b413ac9
parentadb478913623b618334c5153f6d84614a384907e (diff)
downloadcatch3-3109add95ccbc0b388e874253a7894027726cb0c.tar.gz
Add tests for the -f/--input-file command line argument
-rw-r--r--projects/CMakeLists.txt6
-rw-r--r--projects/SelfTest/Misc/plain-old-tests.input2
-rw-r--r--projects/SelfTest/Misc/special-characters-in-file.input1
3 files changed, 9 insertions, 0 deletions
diff --git a/projects/CMakeLists.txt b/projects/CMakeLists.txt
index b2c67a64..8d0f94d4 100644
--- a/projects/CMakeLists.txt
+++ b/projects/CMakeLists.txt
@@ -433,6 +433,12 @@ set_tests_properties(FilenameAsTagsTest PROPERTIES PASS_REGULAR_EXPRESSION "\\[#
add_test(NAME EscapeSpecialCharactersInTestNames COMMAND $<TARGET_FILE:SelfTest> "Test with special\\, characters \"in name")
set_tests_properties(EscapeSpecialCharactersInTestNames PROPERTIES PASS_REGULAR_EXPRESSION "1 assertion in 1 test case")
+add_test(NAME SpecialCharactersInTestNamesFromFile COMMAND $<TARGET_FILE:SelfTest> "-f ${CATCH_DIR}/projects/SelfTest/Misc/special-characters-in-file.input")
+set_tests_properties(SpecialCharactersInTestNamesFromFile PROPERTIES PASS_REGULAR_EXPRESSION "1 assertion in 1 test case")
+
+add_test(NAME RunningTestsFromFile COMMAND $<TARGET_FILE:SelfTest> "-f ${CATCH_DIR}/projects/SelfTest/Misc/plain-old-tests.input")
+set_tests_properties(RunningTestsFromFile PROPERTIES PASS_REGULAR_EXPRESSION "6 assertions in 2 test cases")
+
if (CATCH_USE_VALGRIND)
add_test(NAME ValgrindRunTests COMMAND valgrind --leak-check=full --error-exitcode=1 $<TARGET_FILE:SelfTest>)
diff --git a/projects/SelfTest/Misc/plain-old-tests.input b/projects/SelfTest/Misc/plain-old-tests.input
new file mode 100644
index 00000000..ae6d9f1b
--- /dev/null
+++ b/projects/SelfTest/Misc/plain-old-tests.input
@@ -0,0 +1,2 @@
+random SECTION tests
+nested SECTION tests
diff --git a/projects/SelfTest/Misc/special-characters-in-file.input b/projects/SelfTest/Misc/special-characters-in-file.input
new file mode 100644
index 00000000..b68a6bfd
--- /dev/null
+++ b/projects/SelfTest/Misc/special-characters-in-file.input
@@ -0,0 +1 @@
+Test with special\, characters \"in name