Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Add tests for the -f/--input-file command line argument

Commit
3109add95ccbc0b388e874253a7894027726cb0c
Author
Martin Hořeňovský ·
Parents
adb478913623

Files · Download .tar.gz

Changes

 projects/CMakeLists.txt                                 | 6 ++++++
 projects/SelfTest/Misc/plain-old-tests.input            | 2 ++
 projects/SelfTest/Misc/special-characters-in-file.input | 1 +
 3 files changed, 9 insertions(+)

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