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

summaryrefslogtreecommitdiffhomepage
path: root/projects/SelfTest/TestMain.cpp
diff options
context:
space:
mode:
authorPhil Nash2017-08-09 12:10:14 +0100
committerPhil Nash2017-08-09 12:10:14 +0100
commitee9b19efd3737afc93e14023cc0b4a9fd2a21b7c (patch)
tree6bee3b9ac3be2a8057fa767bab44386c12a7b13a /projects/SelfTest/TestMain.cpp
parentb59e0ed48a4d94f9e595a5936434e9bad7834ece (diff)
downloadcatch3-ee9b19efd3737afc93e14023cc0b4a9fd2a21b7c.tar.gz
Moved matcher-based capture macros into their own file
- this file excluded from the CATCH_CONFIG_DISABLE_MATCHERS path. - matchers are always compiled in to the impl file - _THROWS_WITH macros are still available with matchers disabled - but only the ones that take a string - tests that use matchers have #ifdefs, so the whole SelfTest project can compile with matchers disable.
Diffstat (limited to 'projects/SelfTest/TestMain.cpp')
-rw-r--r--projects/SelfTest/TestMain.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp
index aad1f036..c3b1f29b 100644
--- a/projects/SelfTest/TestMain.cpp
+++ b/projects/SelfTest/TestMain.cpp
@@ -47,7 +47,9 @@ inline Catch::TestCase fakeTestCase( const char* name, const char* desc = "" ){
TEST_CASE( "Process can be configured on command line", "[config][command-line]" ) {
+#ifndef CATCH_CONFIG_DISABLE_MATCHERS
using namespace Catch::Matchers;
+#endif
Catch::ConfigData config;
auto cli = Catch::makeCommandLineParser(config);
@@ -153,7 +155,9 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]"
auto result = cli.parse({"test", "-x", "oops"});
CHECK(!result);
+#ifndef CATCH_CONFIG_DISABLE_MATCHERS
REQUIRE_THAT(result.errorMessage(), Contains("convert") && Contains("oops"));
+#endif
}
}
@@ -225,7 +229,9 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]"
SECTION( "error" ) {
auto result = cli.parse({"test", "--use-colour", "wrong"});
CHECK( !result );
+#ifndef CATCH_CONFIG_DISABLE_MATCHERS
CHECK_THAT( result.errorMessage(), Contains( "colour mode must be one of" ) );
+#endif
}
}
}