From 3109add95ccbc0b388e874253a7894027726cb0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Wed, 9 Oct 2019 12:48:55 +0200 Subject: [PATCH] Add tests for the -f/--input-file command line argument --- 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(+) create mode 100644 projects/SelfTest/Misc/plain-old-tests.input create mode 100644 projects/SelfTest/Misc/special-characters-in-file.input 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 $ "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 $ "-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 $ "-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 $) 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