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

summaryrefslogtreecommitdiffhomepage
path: root/tests/SelfTest
diff options
context:
space:
mode:
authorMartin Hořeňovský2020-01-25 09:06:25 +0100
committerMartin Hořeňovský2020-01-25 09:07:36 +0100
commit6c3a5ef625eda76a2886e15950eca85ed6ebb411 (patch)
tree0991f6b6f17024c811b26f3dca46db089739a801 /tests/SelfTest
parentc770a9c8b5a1a079d7e4172a78107d0480ea67c5 (diff)
downloadcatch3-6c3a5ef625eda76a2886e15950eca85ed6ebb411.tar.gz
Remove CATCH_CONFIG_DISABLE_MATCHERS
Now that the recommended distribution and usage method is proper library, users can just avoid including the matcher headers to get basically the same effect.
Diffstat (limited to 'tests/SelfTest')
-rw-r--r--tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp9
-rw-r--r--tests/SelfTest/IntrospectiveTests/Tag.tests.cpp2
-rw-r--r--tests/SelfTest/UsageTests/Compilation.tests.cpp2
-rw-r--r--tests/SelfTest/UsageTests/Exception.tests.cpp4
-rw-r--r--tests/SelfTest/UsageTests/Matchers.tests.cpp4
5 files changed, 0 insertions, 21 deletions
diff --git a/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp b/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp
index 310746ac..c2a4db0a 100644
--- a/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp
+++ b/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp
@@ -286,9 +286,7 @@ TEST_CASE( "Parse test names and tags" ) {
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);
@@ -367,9 +365,7 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]"
auto result = cli.parse({"test", "--reporter", "unsupported"});
CHECK(!result);
-#ifndef CATCH_CONFIG_DISABLE_MATCHERS
REQUIRE_THAT(result.errorMessage(), Contains("Unrecognized reporter"));
-#endif
}
}
@@ -401,10 +397,7 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]"
SECTION("-x must be numeric") {
auto result = cli.parse({"test", "-x", "oops"});
CHECK(!result);
-
-#ifndef CATCH_CONFIG_DISABLE_MATCHERS
REQUIRE_THAT(result.errorMessage(), Contains("convert") && Contains("oops"));
-#endif
}
}
@@ -476,9 +469,7 @@ 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
}
}
diff --git a/tests/SelfTest/IntrospectiveTests/Tag.tests.cpp b/tests/SelfTest/IntrospectiveTests/Tag.tests.cpp
index 98c88cf8..6f27ad8c 100644
--- a/tests/SelfTest/IntrospectiveTests/Tag.tests.cpp
+++ b/tests/SelfTest/IntrospectiveTests/Tag.tests.cpp
@@ -22,14 +22,12 @@ TEST_CASE( "Tag alias can be registered against tag patterns" ) {
FAIL( "expected exception" );
}
catch( std::exception& ex ) {
-#ifndef CATCH_CONFIG_DISABLE_MATCHERS
std::string what = ex.what();
using namespace Catch::Matchers;
CHECK_THAT( what, Contains( "[@zzz]" ) );
CHECK_THAT( what, Contains( "file" ) );
CHECK_THAT( what, Contains( "2" ) );
CHECK_THAT( what, Contains( "10" ) );
-#endif
}
}
diff --git a/tests/SelfTest/UsageTests/Compilation.tests.cpp b/tests/SelfTest/UsageTests/Compilation.tests.cpp
index 4134ec54..b34bdfbd 100644
--- a/tests/SelfTest/UsageTests/Compilation.tests.cpp
+++ b/tests/SelfTest/UsageTests/Compilation.tests.cpp
@@ -79,9 +79,7 @@ namespace { namespace CompilationTests {
REQUIRE_THROWS(throws_int(true));
CHECK_THROWS_AS(throws_int(true), int);
REQUIRE_NOTHROW(throws_int(false));
-#ifndef CATCH_CONFIG_DISABLE_MATCHERS
REQUIRE_THAT("aaa", Catch::EndsWith("aaa"));
-#endif
return true;
}
diff --git a/tests/SelfTest/UsageTests/Exception.tests.cpp b/tests/SelfTest/UsageTests/Exception.tests.cpp
index aafe928e..79745c8f 100644
--- a/tests/SelfTest/UsageTests/Exception.tests.cpp
+++ b/tests/SelfTest/UsageTests/Exception.tests.cpp
@@ -162,8 +162,6 @@ TEST_CASE("thrown std::strings are translated", "[.][failing][!throws]") {
}
-#ifndef CATCH_CONFIG_DISABLE_MATCHERS
-
TEST_CASE( "Exception messages can be tested for", "[!throws]" ) {
using namespace Catch::Matchers;
SECTION( "exact match" )
@@ -178,8 +176,6 @@ TEST_CASE( "Exception messages can be tested for", "[!throws]" ) {
}
}
-#endif
-
TEST_CASE( "Mismatching exception messages failing the test", "[.][failing][!throws]" ) {
REQUIRE_THROWS_WITH( thisThrows(), "expected exception" );
REQUIRE_THROWS_WITH( thisThrows(), "should fail" );
diff --git a/tests/SelfTest/UsageTests/Matchers.tests.cpp b/tests/SelfTest/UsageTests/Matchers.tests.cpp
index 3664cf50..0efc9221 100644
--- a/tests/SelfTest/UsageTests/Matchers.tests.cpp
+++ b/tests/SelfTest/UsageTests/Matchers.tests.cpp
@@ -22,8 +22,6 @@
namespace { namespace MatchersTests {
-#ifndef CATCH_CONFIG_DISABLE_MATCHERS
-
#ifndef MATCHERS_TEST_HELPERS_INCLUDED // Don't compile this more than once per TU
#define MATCHERS_TEST_HELPERS_INCLUDED
@@ -558,8 +556,6 @@ namespace { namespace MatchersTests {
} } // namespace MatchersTests
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-
#ifdef __clang__
#pragma clang diagnostic pop
#endif