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

summaryrefslogtreecommitdiffhomepage
path: root/tests/SelfTest/UsageTests
diff options
context:
space:
mode:
authorMartin Hořeňovský2020-01-20 23:24:04 +0100
committerMartin Hořeňovský2020-01-21 10:03:54 +0100
commit26f78f96aa6eed4be97281b5b740ab0cf0466c48 (patch)
tree1ed75a6974a364c78f51c426b0a0044217260952 /tests/SelfTest/UsageTests
parentc381b49c60e7c1d6b354b67ca168b2af58c42f13 (diff)
downloadcatch3-26f78f96aa6eed4be97281b5b740ab0cf0466c48.tar.gz
Start using piecemeal includes in test files
Diffstat (limited to 'tests/SelfTest/UsageTests')
-rw-r--r--tests/SelfTest/UsageTests/Approx.tests.cpp5
-rw-r--r--tests/SelfTest/UsageTests/BDD.tests.cpp5
-rw-r--r--tests/SelfTest/UsageTests/Class.tests.cpp5
-rw-r--r--tests/SelfTest/UsageTests/Compilation.tests.cpp7
-rw-r--r--tests/SelfTest/UsageTests/Condition.tests.cpp10
-rw-r--r--tests/SelfTest/UsageTests/Decomposition.tests.cpp5
-rw-r--r--tests/SelfTest/UsageTests/EnumToString.tests.cpp3
-rw-r--r--tests/SelfTest/UsageTests/Exception.tests.cpp6
-rw-r--r--tests/SelfTest/UsageTests/Generators.tests.cpp4
-rw-r--r--tests/SelfTest/UsageTests/Matchers.tests.cpp11
-rw-r--r--tests/SelfTest/UsageTests/Message.tests.cpp5
-rw-r--r--tests/SelfTest/UsageTests/Misc.tests.cpp5
-rw-r--r--tests/SelfTest/UsageTests/ToStringByte.tests.cpp2
-rw-r--r--tests/SelfTest/UsageTests/ToStringChrono.tests.cpp2
-rw-r--r--tests/SelfTest/UsageTests/ToStringGeneral.tests.cpp4
-rw-r--r--tests/SelfTest/UsageTests/ToStringOptional.tests.cpp2
-rw-r--r--tests/SelfTest/UsageTests/ToStringPair.tests.cpp2
-rw-r--r--tests/SelfTest/UsageTests/ToStringTuple.tests.cpp2
-rw-r--r--tests/SelfTest/UsageTests/ToStringVariant.tests.cpp2
-rw-r--r--tests/SelfTest/UsageTests/ToStringWhich.tests.cpp2
-rw-r--r--tests/SelfTest/UsageTests/Tricky.tests.cpp5
-rw-r--r--tests/SelfTest/UsageTests/VariadicMacros.tests.cpp5
22 files changed, 41 insertions, 58 deletions
diff --git a/tests/SelfTest/UsageTests/Approx.tests.cpp b/tests/SelfTest/UsageTests/Approx.tests.cpp
index ff32e841..181d2d4c 100644
--- a/tests/SelfTest/UsageTests/Approx.tests.cpp
+++ b/tests/SelfTest/UsageTests/Approx.tests.cpp
@@ -6,10 +6,13 @@
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
-#include <catch2/catch.hpp>
+#include <catch2/catch_test_macros.hpp>
+#include <catch2/catch_approx.h>
#include <cmath>
+using Catch::Detail::Approx;
+
namespace { namespace ApproxTests {
#ifndef APPROX_TEST_HELPERS_INCLUDED // Don't compile this more than once per TU
diff --git a/tests/SelfTest/UsageTests/BDD.tests.cpp b/tests/SelfTest/UsageTests/BDD.tests.cpp
index 84c4614c..131340fa 100644
--- a/tests/SelfTest/UsageTests/BDD.tests.cpp
+++ b/tests/SelfTest/UsageTests/BDD.tests.cpp
@@ -1,12 +1,9 @@
/*
- * Created by Phil on 29/11/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
-#include <catch2/catch.hpp>
+#include <catch2/catch_test_macros.hpp>
namespace { namespace BDDTests {
diff --git a/tests/SelfTest/UsageTests/Class.tests.cpp b/tests/SelfTest/UsageTests/Class.tests.cpp
index 8f1bbb0f..095686a1 100644
--- a/tests/SelfTest/UsageTests/Class.tests.cpp
+++ b/tests/SelfTest/UsageTests/Class.tests.cpp
@@ -1,12 +1,9 @@
/*
- * Created by Phil on 09/11/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
-#include <catch2/catch.hpp>
+#include <catch2/catch_test_macros.hpp>
#include <array>
namespace{ namespace ClassTests {
diff --git a/tests/SelfTest/UsageTests/Compilation.tests.cpp b/tests/SelfTest/UsageTests/Compilation.tests.cpp
index 4df3ea5a..4134ec54 100644
--- a/tests/SelfTest/UsageTests/Compilation.tests.cpp
+++ b/tests/SelfTest/UsageTests/Compilation.tests.cpp
@@ -1,6 +1,4 @@
/*
- * Created by Martin on 17/02/2017.
- *
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
@@ -30,7 +28,8 @@ std::ostream& operator<<(std::ostream& out, foo::helper_1403 const&) {
}
///////////////////////////////
-#include <catch2/catch.hpp>
+#include <catch2/catch_test_macros.hpp>
+#include <catch2/catch_matchers_string.h>
#include <cstring>
@@ -218,7 +217,7 @@ namespace { namespace CompilationTests {
REQUIRE( y.v == 0 );
REQUIRE( 0 == y.v );
}
-
+
TEST_CASE("#1319: Sections can have description (even if it is not saved", "[compilation]") {
SECTION("SectionName", "This is a long form section description") {
SUCCEED();
diff --git a/tests/SelfTest/UsageTests/Condition.tests.cpp b/tests/SelfTest/UsageTests/Condition.tests.cpp
index 153eaf7a..489d6994 100644
--- a/tests/SelfTest/UsageTests/Condition.tests.cpp
+++ b/tests/SelfTest/UsageTests/Condition.tests.cpp
@@ -1,7 +1,4 @@
/*
- * Created by Phil on 08/11/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
@@ -11,10 +8,13 @@
// Wdouble-promotion is not supported until 3.8
# if (__clang_major__ > 3) || (__clang_major__ == 3 && __clang_minor__ > 7)
# pragma clang diagnostic ignored "-Wdouble-promotion"
-# endif
+# endif
#endif
-#include <catch2/catch.hpp>
+#include <catch2/catch_approx.h>
+#include <catch2/catch_test_macros.hpp>
+
+using Catch::Detail::Approx;
#include <string>
#include <limits>
diff --git a/tests/SelfTest/UsageTests/Decomposition.tests.cpp b/tests/SelfTest/UsageTests/Decomposition.tests.cpp
index 5309bd60..15feefc2 100644
--- a/tests/SelfTest/UsageTests/Decomposition.tests.cpp
+++ b/tests/SelfTest/UsageTests/Decomposition.tests.cpp
@@ -1,7 +1,4 @@
/*
- * Created by Martin on 27/5/2017.
- * Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
- *
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
@@ -26,7 +23,7 @@ std::ostream& operator<<(std::ostream& o, truthy) {
} // end anonymous namespace
-#include <catch2/catch.hpp>
+#include <catch2/catch_test_macros.hpp>
TEST_CASE( "Reconstruction should be based on stringification: #914" , "[Decomposition][failing][.]") {
CHECK(truthy(false));
diff --git a/tests/SelfTest/UsageTests/EnumToString.tests.cpp b/tests/SelfTest/UsageTests/EnumToString.tests.cpp
index 02e90305..171e795f 100644
--- a/tests/SelfTest/UsageTests/EnumToString.tests.cpp
+++ b/tests/SelfTest/UsageTests/EnumToString.tests.cpp
@@ -1,4 +1,5 @@
-#include <catch2/catch.hpp>
+#include <catch2/catch_test_macros.hpp>
+#include <catch2/catch_enum_values_registry.h>
namespace {
diff --git a/tests/SelfTest/UsageTests/Exception.tests.cpp b/tests/SelfTest/UsageTests/Exception.tests.cpp
index d0f135b7..aafe928e 100644
--- a/tests/SelfTest/UsageTests/Exception.tests.cpp
+++ b/tests/SelfTest/UsageTests/Exception.tests.cpp
@@ -1,12 +1,10 @@
/*
- * Created by Phil on 09/11/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
-#include <catch2/catch.hpp>
+#include <catch2/catch_test_macros.hpp>
+#include <catch2/catch_matchers_string.h>
#include <string>
#include <stdexcept>
diff --git a/tests/SelfTest/UsageTests/Generators.tests.cpp b/tests/SelfTest/UsageTests/Generators.tests.cpp
index 59a1baef..ca03f026 100644
--- a/tests/SelfTest/UsageTests/Generators.tests.cpp
+++ b/tests/SelfTest/UsageTests/Generators.tests.cpp
@@ -1,4 +1,6 @@
-#include <catch2/catch.hpp>
+#include <catch2/catch_test_macros.hpp>
+#include <catch2/catch_generators_generic.hpp>
+#include <catch2/catch_generators_specific.hpp>
#include <cstring>
diff --git a/tests/SelfTest/UsageTests/Matchers.tests.cpp b/tests/SelfTest/UsageTests/Matchers.tests.cpp
index 130b51b2..3664cf50 100644
--- a/tests/SelfTest/UsageTests/Matchers.tests.cpp
+++ b/tests/SelfTest/UsageTests/Matchers.tests.cpp
@@ -1,15 +1,18 @@
/*
- * Created by Phil on 21/02/2017.
- * Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
- *
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
-#include <catch2/catch.hpp>
+#include <catch2/catch_test_macros.hpp>
+#include <catch2/catch_matchers_exception.hpp>
+#include <catch2/catch_matchers_floating.h>
+#include <catch2/catch_matchers_generic.hpp>
+#include <catch2/catch_matchers_string.h>
+#include <catch2/catch_matchers_vector.h>
#include <sstream>
#include <algorithm>
+#include <cmath>
#ifdef __clang__
#pragma clang diagnostic push
diff --git a/tests/SelfTest/UsageTests/Message.tests.cpp b/tests/SelfTest/UsageTests/Message.tests.cpp
index 92fca804..a30c2e9e 100644
--- a/tests/SelfTest/UsageTests/Message.tests.cpp
+++ b/tests/SelfTest/UsageTests/Message.tests.cpp
@@ -1,12 +1,9 @@
/*
- * Created by Phil on 09/11/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
-#include <catch2/catch.hpp>
+#include <catch2/catch_test_macros.hpp>
#include <iostream>
TEST_CASE( "INFO and WARN do not abort tests", "[messages][.]" ) {
diff --git a/tests/SelfTest/UsageTests/Misc.tests.cpp b/tests/SelfTest/UsageTests/Misc.tests.cpp
index a503bc0a..37210a4c 100644
--- a/tests/SelfTest/UsageTests/Misc.tests.cpp
+++ b/tests/SelfTest/UsageTests/Misc.tests.cpp
@@ -1,12 +1,9 @@
/*
- * Created by Phil on 29/11/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
-#include <catch2/catch.hpp>
+#include <catch2/catch_test_macros.hpp>
#ifdef __clang__
# pragma clang diagnostic ignored "-Wc++98-compat"
diff --git a/tests/SelfTest/UsageTests/ToStringByte.tests.cpp b/tests/SelfTest/UsageTests/ToStringByte.tests.cpp
index 15044ab3..ceb94e22 100644
--- a/tests/SelfTest/UsageTests/ToStringByte.tests.cpp
+++ b/tests/SelfTest/UsageTests/ToStringByte.tests.cpp
@@ -1,4 +1,4 @@
-#include <catch2/catch.hpp>
+#include <catch2/catch_test_macros.hpp>
#if defined(CATCH_CONFIG_CPP17_BYTE)
diff --git a/tests/SelfTest/UsageTests/ToStringChrono.tests.cpp b/tests/SelfTest/UsageTests/ToStringChrono.tests.cpp
index 1b01c7e8..a2be85a3 100644
--- a/tests/SelfTest/UsageTests/ToStringChrono.tests.cpp
+++ b/tests/SelfTest/UsageTests/ToStringChrono.tests.cpp
@@ -1,5 +1,5 @@
#define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER
-#include <catch2/catch.hpp>
+#include <catch2/catch_test_macros.hpp>
#include <chrono>
#include <cstdint>
diff --git a/tests/SelfTest/UsageTests/ToStringGeneral.tests.cpp b/tests/SelfTest/UsageTests/ToStringGeneral.tests.cpp
index f6d936cc..c738b32c 100644
--- a/tests/SelfTest/UsageTests/ToStringGeneral.tests.cpp
+++ b/tests/SelfTest/UsageTests/ToStringGeneral.tests.cpp
@@ -1,12 +1,10 @@
/*
- * Created by Martin on 17/02/2017.
- *
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#define CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER
-#include <catch2/catch.hpp>
+#include <catch2/catch_test_macros.hpp>
#include <map>
#include <set>
diff --git a/tests/SelfTest/UsageTests/ToStringOptional.tests.cpp b/tests/SelfTest/UsageTests/ToStringOptional.tests.cpp
index 46456163..2b7ac3ec 100644
--- a/tests/SelfTest/UsageTests/ToStringOptional.tests.cpp
+++ b/tests/SelfTest/UsageTests/ToStringOptional.tests.cpp
@@ -1,5 +1,5 @@
#define CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER
-#include <catch2/catch.hpp>
+#include <catch2/catch_test_macros.hpp>
#if defined(CATCH_CONFIG_CPP17_OPTIONAL)
diff --git a/tests/SelfTest/UsageTests/ToStringPair.tests.cpp b/tests/SelfTest/UsageTests/ToStringPair.tests.cpp
index ba734f17..3b8608aa 100644
--- a/tests/SelfTest/UsageTests/ToStringPair.tests.cpp
+++ b/tests/SelfTest/UsageTests/ToStringPair.tests.cpp
@@ -1,5 +1,5 @@
#define CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER
-#include <catch2/catch.hpp>
+#include <catch2/catch_test_macros.hpp>
TEST_CASE( "std::pair<int,std::string> -> toString", "[toString][pair]" ) {
std::pair<int,std::string> value( 34, "xyzzy" );
diff --git a/tests/SelfTest/UsageTests/ToStringTuple.tests.cpp b/tests/SelfTest/UsageTests/ToStringTuple.tests.cpp
index 983ba550..1d1a7ab0 100644
--- a/tests/SelfTest/UsageTests/ToStringTuple.tests.cpp
+++ b/tests/SelfTest/UsageTests/ToStringTuple.tests.cpp
@@ -1,5 +1,5 @@
#define CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER
-#include <catch2/catch.hpp>
+#include <catch2/catch_test_macros.hpp>
#include <tuple>
diff --git a/tests/SelfTest/UsageTests/ToStringVariant.tests.cpp b/tests/SelfTest/UsageTests/ToStringVariant.tests.cpp
index 32471a0a..de9748cd 100644
--- a/tests/SelfTest/UsageTests/ToStringVariant.tests.cpp
+++ b/tests/SelfTest/UsageTests/ToStringVariant.tests.cpp
@@ -1,5 +1,5 @@
#define CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER
-#include <catch2/catch.hpp>
+#include <catch2/catch_test_macros.hpp>
#if defined(CATCH_CONFIG_CPP17_VARIANT)
diff --git a/tests/SelfTest/UsageTests/ToStringWhich.tests.cpp b/tests/SelfTest/UsageTests/ToStringWhich.tests.cpp
index 0a5eac40..4c10207e 100644
--- a/tests/SelfTest/UsageTests/ToStringWhich.tests.cpp
+++ b/tests/SelfTest/UsageTests/ToStringWhich.tests.cpp
@@ -13,7 +13,7 @@ std::string fallbackStringifier(T const&) {
}
#define CATCH_CONFIG_FALLBACK_STRINGIFIER fallbackStringifier
-#include <catch2/catch.hpp>
+#include <catch2/catch_test_macros.hpp>
diff --git a/tests/SelfTest/UsageTests/Tricky.tests.cpp b/tests/SelfTest/UsageTests/Tricky.tests.cpp
index c2afdca1..e9803c76 100644
--- a/tests/SelfTest/UsageTests/Tricky.tests.cpp
+++ b/tests/SelfTest/UsageTests/Tricky.tests.cpp
@@ -1,7 +1,4 @@
/*
- * Created by Phil on 09/11/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
@@ -15,7 +12,7 @@
// that is triggered when compiling as Win32|Release
#endif
-#include <catch2/catch.hpp>
+#include <catch2/catch_test_macros.hpp>
#include <stdio.h>
#include <sstream>
diff --git a/tests/SelfTest/UsageTests/VariadicMacros.tests.cpp b/tests/SelfTest/UsageTests/VariadicMacros.tests.cpp
index de8dc187..c8754dee 100644
--- a/tests/SelfTest/UsageTests/VariadicMacros.tests.cpp
+++ b/tests/SelfTest/UsageTests/VariadicMacros.tests.cpp
@@ -1,12 +1,9 @@
/*
- * Created by Phil on 15/03/2013.
- * Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
- *
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
-#include <catch2/catch.hpp>
+#include <catch2/catch_test_macros.hpp>
TEST_CASE()