Rewrite includes in tests to use library's include paths

This commit is contained in:
Martin Hořeňovský 2019-12-02 12:23:10 +01:00
parent 82cc5bc034
commit 90e2549cec
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
45 changed files with 67 additions and 69 deletions

View File

@ -88,8 +88,6 @@ include(CTest)
add_executable(SelfTest ${TEST_SOURCES})
target_link_libraries(SelfTest PRIVATE Catch2)
# Fixme!
target_include_directories(SelfTest PRIVATE ${SOURCES_DIR})
# It took CMake until 3.8 to abandon the doomed approach of enumerating
# required features so we just list bunch of C++11 and C++14 features.

View File

@ -6,11 +6,11 @@
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#include "catch.hpp"
#include "catch_test_spec_parser.h"
#include "catch_test_case_info.h"
#include "catch_config.hpp"
#include "catch_commandline.h"
#include <catch2/catch.hpp>
#include <catch2/catch_test_spec_parser.h>
#include <catch2/catch_test_case_info.h>
#include <catch2/catch_config.hpp>
#include <catch2/catch_commandline.h>
#ifdef __clang__
# pragma clang diagnostic ignored "-Wc++98-compat"

View File

@ -3,7 +3,7 @@
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#include "catch.hpp"
#include <catch2/catch.hpp>
#if defined(_MSC_VER)
#pragma warning(push)

View File

@ -1,4 +1,4 @@
#include "catch.hpp"
#include <catch2/catch.hpp>
// Tests of generator implementation details
TEST_CASE("Generators internals", "[generators][internals]") {

View File

@ -6,7 +6,7 @@
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#include "catch.hpp"
#include <catch2/catch.hpp>
#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
namespace {
struct manual_clock {

View File

@ -5,10 +5,10 @@
* 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 "catch_suppress_warnings.h"
#include "catch_test_case_tracker.h"
#include <catch2/catch_suppress_warnings.h>
#include <catch2/catch_test_case_tracker.h>
#include "catch.hpp"
#include <catch2/catch.hpp>
using namespace Catch;

View File

@ -5,9 +5,9 @@
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#include "catch.hpp"
#include <catch2/catch.hpp>
#include "catch_random_number_generator.h"
#include <catch2/catch_random_number_generator.h>
TEST_CASE("Our PCG implementation provides expected results for known seeds", "[rng]") {
Catch::SimplePcg32 rng;

View File

@ -1,6 +1,6 @@
#include "catch_stringref.h"
#include <catch2/catch_stringref.h>
#include "catch.hpp"
#include <catch2/catch.hpp>
#include <cstring>

View File

@ -1,6 +1,6 @@
#include "catch_string_manip.h"
#include <catch2/catch_string_manip.h>
#include "catch.hpp"
#include <catch2/catch.hpp>
static const char * const no_whitespace = "There is no extra whitespace here";
static const char * const leading_whitespace = " \r \t\n There is no extra whitespace here";

View File

@ -6,8 +6,8 @@
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#include "catch.hpp"
#include "catch_tag_alias_registry.h"
#include <catch2/catch.hpp>
#include <catch2/catch_tag_alias_registry.h>
TEST_CASE( "Tag alias can be registered against tag patterns" ) {

View File

@ -1,6 +1,6 @@
#include "catch.hpp"
#include <catch2/catch.hpp>
#include "catch_enum_values_registry.h"
#include <catch2/catch_enum_values_registry.h>
enum class EnumClass3 { Value1, Value2, Value3, Value4 };

View File

@ -1,5 +1,5 @@
#include "catch.hpp"
#include "catch_xmlwriter.h"
#include <catch2/catch.hpp>
#include <catch2/catch_xmlwriter.h>
#include <sstream>

View File

@ -1,3 +1,3 @@
// This file is only here to verify (to the extent possible) the self sufficiency of the header
#include "catch_suppress_warnings.h"
#include "catch_console_colour.h"
#include <catch2/catch_suppress_warnings.h>
#include <catch2/catch_console_colour.h>

View File

@ -1,2 +1,2 @@
// This file is only here to verify (to the extent possible) the self sufficiency of the header
#include "catch_debugger.h"
#include <catch2/catch_debugger.h>

View File

@ -1,2 +1,2 @@
#include "catch_suppress_warnings.h"
#include "catch_interfaces_reporter.h"
#include <catch2/catch_suppress_warnings.h>
#include <catch2/catch_interfaces_reporter.h>

View File

@ -1,3 +1,3 @@
// This file is only here to verify (to the extent possible) the self sufficiency of the header
#include "catch_suppress_warnings.h"
#include "catch_option.hpp"
#include <catch2/catch_suppress_warnings.h>
#include <catch2/catch_option.hpp>

View File

@ -1,3 +1,3 @@
// This file is only here to verify (to the extent possible) the self sufficiency of the header
#include "catch_suppress_warnings.h"
#include "catch_stream.h"
#include <catch2/catch_suppress_warnings.h>
#include <catch2/catch_stream.h>

View File

@ -1,2 +1,2 @@
// This file is only here to verify (to the extent possible) the self sufficiency of the header
#include "catch_test_case_tracker.h"
#include <catch2/catch_test_case_tracker.h>

View File

@ -1,3 +1,3 @@
// This file is only here to verify (to the extent possible) the self sufficiency of the header
#include "catch_suppress_warnings.h"
#include "catch_test_spec.h"
#include <catch2/catch_suppress_warnings.h>
#include <catch2/catch_test_spec.h>

View File

@ -1,4 +1,4 @@
// This file is only here to verify (to the extent possible) the self sufficiency of the header
#include "catch_suppress_warnings.h"
#include "catch_xmlwriter.h"
#include "catch_reenable_warnings.h"
#include <catch2/catch_suppress_warnings.h>
#include <catch2/catch_xmlwriter.h>
#include <catch2/catch_reenable_warnings.h>

View File

@ -7,13 +7,13 @@
*/
#define CATCH_CONFIG_MAIN
#include "catch.hpp"
#include <catch2/catch.hpp>
// These reporters are not included in the single include, so must be included separately in the main file
#include "reporters/catch_reporter_teamcity.hpp"
#include "reporters/catch_reporter_tap.hpp"
#include "reporters/catch_reporter_automake.hpp"
#include "reporters/catch_reporter_sonarqube.hpp"
#include <catch2/reporters/catch_reporter_teamcity.hpp>
#include <catch2/reporters/catch_reporter_tap.hpp>
#include <catch2/reporters/catch_reporter_automake.hpp>
#include <catch2/reporters/catch_reporter_sonarqube.hpp>
// Some example tag aliases

View File

@ -6,7 +6,7 @@
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#include "catch.hpp"
#include <catch2/catch.hpp>
#include <cmath>

View File

@ -6,7 +6,7 @@
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#include "catch.hpp"
#include <catch2/catch.hpp>
namespace { namespace BDDTests {

View File

@ -1,4 +1,4 @@
#include "catch.hpp"
#include <catch2/catch.hpp>
#include <map>

View File

@ -6,7 +6,7 @@
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#include "catch.hpp"
#include <catch2/catch.hpp>
#include <array>
namespace{ namespace ClassTests {

View File

@ -30,7 +30,7 @@ std::ostream& operator<<(std::ostream& out, foo::helper_1403 const&) {
}
///////////////////////////////
#include "catch.hpp"
#include <catch2/catch.hpp>
#include <cstring>

View File

@ -14,7 +14,7 @@
# endif
#endif
#include "catch.hpp"
#include <catch2/catch.hpp>
#include <string>
#include <limits>

View File

@ -26,7 +26,7 @@ std::ostream& operator<<(std::ostream& o, truthy) {
} // end anonymous namespace
#include "catch.hpp"
#include <catch2/catch.hpp>
TEST_CASE( "Reconstruction should be based on stringification: #914" , "[Decomposition][failing][.]") {
CHECK(truthy(false));

View File

@ -1,4 +1,4 @@
#include "catch.hpp"
#include <catch2/catch.hpp>
namespace {

View File

@ -6,7 +6,7 @@
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#include "catch.hpp"
#include <catch2/catch.hpp>
#include <string>
#include <stdexcept>

View File

@ -1,4 +1,4 @@
#include "catch.hpp"
#include <catch2/catch.hpp>
#include <cstring>

View File

@ -6,7 +6,7 @@
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#include "catch.hpp"
#include <catch2/catch.hpp>
#include <sstream>
#include <algorithm>

View File

@ -6,7 +6,7 @@
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#include "catch.hpp"
#include <catch2/catch.hpp>
#include <iostream>
TEST_CASE( "INFO and WARN do not abort tests", "[messages][.]" ) {

View File

@ -6,7 +6,7 @@
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#include "catch.hpp"
#include <catch2/catch.hpp>
#ifdef __clang__
# pragma clang diagnostic ignored "-Wc++98-compat"

View File

@ -1,4 +1,4 @@
#include "catch.hpp"
#include <catch2/catch.hpp>
#if defined(CATCH_CONFIG_CPP17_BYTE)

View File

@ -1,5 +1,5 @@
#define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER
#include "catch.hpp"
#include <catch2/catch.hpp>
#include <chrono>
#include <cstdint>

View File

@ -6,7 +6,7 @@
*/
#define CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER
#include "catch.hpp"
#include <catch2/catch.hpp>
#include <map>
#include <set>

View File

@ -1,5 +1,5 @@
#define CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER
#include "catch.hpp"
#include <catch2/catch.hpp>
#if defined(CATCH_CONFIG_CPP17_OPTIONAL)

View File

@ -1,5 +1,5 @@
#define CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER
#include "catch.hpp"
#include <catch2/catch.hpp>
TEST_CASE( "std::pair<int,std::string> -> toString", "[toString][pair]" ) {
std::pair<int,std::string> value( 34, "xyzzy" );

View File

@ -1,5 +1,5 @@
#define CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER
#include "catch.hpp"
#include <catch2/catch.hpp>
#include <tuple>

View File

@ -1,5 +1,5 @@
#define CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER
#include "catch.hpp"
#include <catch2/catch.hpp>
#if defined(CATCH_CONFIG_CPP17_VARIANT)

View File

@ -1,4 +1,4 @@
#include "catch.hpp"
#include <catch2/catch.hpp>
#include <vector>
#include <array>

View File

@ -13,7 +13,7 @@ std::string fallbackStringifier(T const&) {
}
#define CATCH_CONFIG_FALLBACK_STRINGIFIER fallbackStringifier
#include "catch.hpp"
#include <catch2/catch.hpp>

View File

@ -15,7 +15,7 @@
// that is triggered when compiling as Win32|Release
#endif
#include "catch.hpp"
#include <catch2/catch.hpp>
#include <stdio.h>
#include <sstream>

View File

@ -6,7 +6,7 @@
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#include "catch.hpp"
#include <catch2/catch.hpp>
TEST_CASE()