diff options
66 files changed, 450 insertions, 89 deletions
diff --git a/etc/import/TARGETS.catch2 b/etc/import/TARGETS.catch2 index 44fdda10..80bfcac8 100644 --- a/etc/import/TARGETS.catch2 +++ b/etc/import/TARGETS.catch2 @@ -1,7 +1,36 @@ -{ "catch2": +{ "catch2-config-header-blueprint": + { "type": ["@", "rules", "CC/auto", "config_file"] + , "input": [["./", "src/catch2", "catch_user_config.hpp.in"]] + , "output": ["catch2", "catch_user_config.hpp"] + , "magic_string": ["cmakedefine"] + , "@only": ["true"] + } +, "catch2-config-header": + { "type": "configure" + , "target": "catch2-config-header-blueprint" + , "config": + { "type": "let*" + , "bindings": + [ [ "defines" + , [ ["CATCH_CONFIG_DEFAULT_REPORTER", "console"] + , ["CATCH_CONFIG_CONSOLE_WIDTH", "80"] + ] + ] + ] + , "body": {"type": "env", "vars": ["defines"]} + } + } +, "catch2": + { "type": ["@", "rules", "CC", "library"] + , "name": ["Catch2"] + , "hdrs": [["./", "src/catch2", "hdrs"], "catch2-config-header"] + , "srcs": [["./", "src/catch2", "srcs"]] + } +, "catch2-main": { "type": ["@", "rules", "CC", "library"] - , "hdrs": ["catch.hpp"] - , "private-ldflags": ["-lpthread"] - , "stage": ["catch2"] + , "name": ["Catch2Main"] + , "hdrs": ["catch2-config-header"] + , "srcs": [["./", "src/catch2", "main"]] + , "deps": ["catch2"] } } diff --git a/etc/import/src/catch2/TARGETS.catch2 b/etc/import/src/catch2/TARGETS.catch2 new file mode 100644 index 00000000..b066de9c --- /dev/null +++ b/etc/import/src/catch2/TARGETS.catch2 @@ -0,0 +1,285 @@ +{ "hdrs": + { "type": ["@", "rules", "data", "staged"] + , "srcs": + [ "benchmark/catch_benchmark.hpp" + , "benchmark/catch_benchmark_all.hpp" + , "benchmark/catch_chronometer.hpp" + , "benchmark/catch_clock.hpp" + , "benchmark/catch_constructor.hpp" + , "benchmark/catch_environment.hpp" + , "benchmark/catch_estimate.hpp" + , "benchmark/catch_execution_plan.hpp" + , "benchmark/catch_optimizer.hpp" + , "benchmark/catch_outlier_classification.hpp" + , "benchmark/catch_sample_analysis.hpp" + , "benchmark/detail/catch_analyse.hpp" + , "benchmark/detail/catch_benchmark_function.hpp" + , "benchmark/detail/catch_complete_invoke.hpp" + , "benchmark/detail/catch_estimate_clock.hpp" + , "benchmark/detail/catch_measure.hpp" + , "benchmark/detail/catch_repeat.hpp" + , "benchmark/detail/catch_run_for_at_least.hpp" + , "benchmark/detail/catch_stats.hpp" + , "benchmark/detail/catch_timing.hpp" + , "generators/catch_generator_exception.hpp" + , "generators/catch_generators.hpp" + , "generators/catch_generators_adapters.hpp" + , "generators/catch_generators_all.hpp" + , "generators/catch_generators_random.hpp" + , "generators/catch_generators_range.hpp" + , "interfaces/catch_interfaces_all.hpp" + , "interfaces/catch_interfaces_capture.hpp" + , "interfaces/catch_interfaces_config.hpp" + , "interfaces/catch_interfaces_enum_values_registry.hpp" + , "interfaces/catch_interfaces_exception.hpp" + , "interfaces/catch_interfaces_generatortracker.hpp" + , "interfaces/catch_interfaces_registry_hub.hpp" + , "interfaces/catch_interfaces_reporter.hpp" + , "interfaces/catch_interfaces_reporter_factory.hpp" + , "interfaces/catch_interfaces_reporter_registry.hpp" + , "interfaces/catch_interfaces_tag_alias_registry.hpp" + , "interfaces/catch_interfaces_testcase.hpp" + , "internal/catch_assertion_handler.hpp" + , "internal/catch_case_insensitive_comparisons.hpp" + , "internal/catch_case_sensitive.hpp" + , "internal/catch_clara.hpp" + , "internal/catch_commandline.hpp" + , "internal/catch_compare_traits.hpp" + , "internal/catch_compiler_capabilities.hpp" + , "internal/catch_config_android_logwrite.hpp" + , "internal/catch_config_counter.hpp" + , "internal/catch_config_uncaught_exceptions.hpp" + , "internal/catch_config_wchar.hpp" + , "internal/catch_console_colour.hpp" + , "internal/catch_console_width.hpp" + , "internal/catch_container_nonmembers.hpp" + , "internal/catch_context.hpp" + , "internal/catch_debug_console.hpp" + , "internal/catch_debugger.hpp" + , "internal/catch_decomposer.hpp" + , "internal/catch_enforce.hpp" + , "internal/catch_enum_values_registry.hpp" + , "internal/catch_errno_guard.hpp" + , "internal/catch_exception_translator_registry.hpp" + , "internal/catch_fatal_condition_handler.hpp" + , "internal/catch_floating_point_helpers.hpp" + , "internal/catch_getenv.hpp" + , "internal/catch_istream.hpp" + , "internal/catch_is_permutation.hpp" + , "internal/catch_lazy_expr.hpp" + , "internal/catch_leak_detector.hpp" + , "internal/catch_list.hpp" + , "internal/catch_logical_traits.hpp" + , "internal/catch_message_info.hpp" + , "internal/catch_meta.hpp" + , "internal/catch_move_and_forward.hpp" + , "internal/catch_noncopyable.hpp" + , "internal/catch_optional.hpp" + , "internal/catch_output_redirect.hpp" + , "internal/catch_parse_numbers.hpp" + , "internal/catch_platform.hpp" + , "internal/catch_polyfills.hpp" + , "internal/catch_preprocessor.hpp" + , "internal/catch_preprocessor_remove_parens.hpp" + , "internal/catch_random_number_generator.hpp" + , "internal/catch_random_seed_generation.hpp" + , "internal/catch_reporter_registry.hpp" + , "internal/catch_reporter_spec_parser.hpp" + , "internal/catch_result_type.hpp" + , "internal/catch_reusable_string_stream.hpp" + , "internal/catch_run_context.hpp" + , "internal/catch_section.hpp" + , "internal/catch_sharding.hpp" + , "internal/catch_singletons.hpp" + , "internal/catch_source_line_info.hpp" + , "internal/catch_startup_exception_registry.hpp" + , "internal/catch_stdstreams.hpp" + , "internal/catch_stream_end_stop.hpp" + , "internal/catch_string_manip.hpp" + , "internal/catch_stringref.hpp" + , "internal/catch_tag_alias_registry.hpp" + , "internal/catch_template_test_registry.hpp" + , "internal/catch_test_case_info_hasher.hpp" + , "internal/catch_test_case_registry_impl.hpp" + , "internal/catch_test_case_tracker.hpp" + , "internal/catch_test_failure_exception.hpp" + , "internal/catch_test_macro_impl.hpp" + , "internal/catch_test_registry.hpp" + , "internal/catch_test_spec_parser.hpp" + , "internal/catch_textflow.hpp" + , "internal/catch_to_string.hpp" + , "internal/catch_uncaught_exceptions.hpp" + , "internal/catch_unique_name.hpp" + , "internal/catch_unique_ptr.hpp" + , "internal/catch_void_type.hpp" + , "internal/catch_wildcard_pattern.hpp" + , "internal/catch_windows_h_proxy.hpp" + , "internal/catch_xmlwriter.hpp" + , "matchers/catch_matchers.hpp" + , "matchers/catch_matchers_all.hpp" + , "matchers/catch_matchers_container_properties.hpp" + , "matchers/catch_matchers_contains.hpp" + , "matchers/catch_matchers_range_equals.hpp" + , "matchers/catch_matchers_exception.hpp" + , "matchers/catch_matchers_floating_point.hpp" + , "matchers/catch_matchers_predicate.hpp" + , "matchers/catch_matchers_quantifiers.hpp" + , "matchers/catch_matchers_string.hpp" + , "matchers/catch_matchers_templated.hpp" + , "matchers/catch_matchers_vector.hpp" + , "matchers/internal/catch_matchers_impl.hpp" + , "catch_all.hpp" + , "catch_approx.hpp" + , "catch_assertion_info.hpp" + , "catch_assertion_result.hpp" + , "catch_config.hpp" + , "catch_get_random_seed.hpp" + , "catch_message.hpp" + , "catch_section_info.hpp" + , "catch_session.hpp" + , "catch_tag_alias.hpp" + , "catch_tag_alias_autoregistrar.hpp" + , "catch_template_test_macros.hpp" + , "catch_test_case_info.hpp" + , "catch_test_macros.hpp" + , "catch_test_spec.hpp" + , "catch_timer.hpp" + , "catch_tostring.hpp" + , "catch_totals.hpp" + , "catch_translate_exception.hpp" + , "catch_version.hpp" + , "catch_version_macros.hpp" + , "reporters/catch_reporter_automake.hpp" + , "reporters/catch_reporter_common_base.hpp" + , "reporters/catch_reporter_compact.hpp" + , "reporters/catch_reporter_console.hpp" + , "reporters/catch_reporter_cumulative_base.hpp" + , "reporters/catch_reporter_event_listener.hpp" + , "reporters/catch_reporter_helpers.hpp" + , "reporters/catch_reporter_junit.hpp" + , "reporters/catch_reporter_multi.hpp" + , "reporters/catch_reporter_registrars.hpp" + , "reporters/catch_reporter_sonarqube.hpp" + , "reporters/catch_reporter_streaming_base.hpp" + , "reporters/catch_reporter_tap.hpp" + , "reporters/catch_reporter_teamcity.hpp" + , "reporters/catch_reporter_xml.hpp" + , "reporters/catch_reporters_all.hpp" + ] + , "stage": ["catch2"] + } +, "srcs": + { "type": ["@", "rules", "data", "staged"] + , "srcs": + [ "benchmark/catch_chronometer.cpp" + , "benchmark/detail/catch_benchmark_function.cpp" + , "benchmark/detail/catch_run_for_at_least.cpp" + , "benchmark/detail/catch_stats.cpp" + , "generators/catch_generator_exception.cpp" + , "generators/catch_generators.cpp" + , "generators/catch_generators_random.cpp" + , "interfaces/catch_interfaces_capture.cpp" + , "interfaces/catch_interfaces_config.cpp" + , "interfaces/catch_interfaces_exception.cpp" + , "interfaces/catch_interfaces_generatortracker.cpp" + , "interfaces/catch_interfaces_registry_hub.cpp" + , "interfaces/catch_interfaces_reporter.cpp" + , "interfaces/catch_interfaces_reporter_factory.cpp" + , "interfaces/catch_interfaces_reporter_registry.cpp" + , "interfaces/catch_interfaces_testcase.cpp" + , "internal/catch_assertion_handler.cpp" + , "internal/catch_case_insensitive_comparisons.cpp" + , "internal/catch_clara.cpp" + , "internal/catch_commandline.cpp" + , "internal/catch_console_colour.cpp" + , "internal/catch_context.cpp" + , "internal/catch_debug_console.cpp" + , "internal/catch_debugger.cpp" + , "internal/catch_decomposer.cpp" + , "internal/catch_enforce.cpp" + , "internal/catch_enum_values_registry.cpp" + , "internal/catch_errno_guard.cpp" + , "internal/catch_exception_translator_registry.cpp" + , "internal/catch_fatal_condition_handler.cpp" + , "internal/catch_floating_point_helpers.cpp" + , "internal/catch_getenv.cpp" + , "internal/catch_istream.cpp" + , "internal/catch_lazy_expr.cpp" + , "internal/catch_leak_detector.cpp" + , "internal/catch_list.cpp" + , "internal/catch_message_info.cpp" + , "internal/catch_output_redirect.cpp" + , "internal/catch_parse_numbers.cpp" + , "internal/catch_polyfills.cpp" + , "internal/catch_random_number_generator.cpp" + , "internal/catch_random_seed_generation.cpp" + , "internal/catch_reporter_registry.cpp" + , "internal/catch_reporter_spec_parser.cpp" + , "internal/catch_result_type.cpp" + , "internal/catch_reusable_string_stream.cpp" + , "internal/catch_run_context.cpp" + , "internal/catch_section.cpp" + , "internal/catch_singletons.cpp" + , "internal/catch_source_line_info.cpp" + , "internal/catch_startup_exception_registry.cpp" + , "internal/catch_stdstreams.cpp" + , "internal/catch_string_manip.cpp" + , "internal/catch_stringref.cpp" + , "internal/catch_tag_alias_registry.cpp" + , "internal/catch_test_case_info_hasher.cpp" + , "internal/catch_test_case_registry_impl.cpp" + , "internal/catch_test_case_tracker.cpp" + , "internal/catch_test_failure_exception.cpp" + , "internal/catch_test_registry.cpp" + , "internal/catch_test_spec_parser.cpp" + , "internal/catch_textflow.cpp" + , "internal/catch_uncaught_exceptions.cpp" + , "internal/catch_wildcard_pattern.cpp" + , "internal/catch_xmlwriter.cpp" + , "matchers/catch_matchers.cpp" + , "matchers/catch_matchers_container_properties.cpp" + , "matchers/catch_matchers_exception.cpp" + , "matchers/catch_matchers_floating_point.cpp" + , "matchers/catch_matchers_predicate.cpp" + , "matchers/catch_matchers_quantifiers.cpp" + , "matchers/catch_matchers_string.cpp" + , "matchers/catch_matchers_templated.cpp" + , "matchers/internal/catch_matchers_impl.cpp" + , "catch_approx.cpp" + , "catch_assertion_result.cpp" + , "catch_config.cpp" + , "catch_get_random_seed.cpp" + , "catch_message.cpp" + , "catch_registry_hub.cpp" + , "catch_session.cpp" + , "catch_tag_alias_autoregistrar.cpp" + , "catch_test_case_info.cpp" + , "catch_test_spec.cpp" + , "catch_timer.cpp" + , "catch_tostring.cpp" + , "catch_totals.cpp" + , "catch_version.cpp" + , "reporters/catch_reporter_automake.cpp" + , "reporters/catch_reporter_common_base.cpp" + , "reporters/catch_reporter_compact.cpp" + , "reporters/catch_reporter_console.cpp" + , "reporters/catch_reporter_cumulative_base.cpp" + , "reporters/catch_reporter_event_listener.cpp" + , "reporters/catch_reporter_helpers.cpp" + , "reporters/catch_reporter_junit.cpp" + , "reporters/catch_reporter_multi.cpp" + , "reporters/catch_reporter_registrars.cpp" + , "reporters/catch_reporter_sonarqube.cpp" + , "reporters/catch_reporter_streaming_base.cpp" + , "reporters/catch_reporter_tap.cpp" + , "reporters/catch_reporter_teamcity.cpp" + , "reporters/catch_reporter_xml.cpp" + ] + , "stage": ["catch2"] + } +, "main": + { "type": ["@", "rules", "data", "staged"] + , "srcs": ["internal/catch_main.cpp"] + , "stage": ["catch2"] + } +} diff --git a/etc/repos.json b/etc/repos.json index a0256ddf..ffdf84e1 100644 --- a/etc/repos.json +++ b/etc/repos.json @@ -403,11 +403,11 @@ , "catch2": { "repository": { "type": "archive" - , "content": "a154ae9e2daad22c95cff6186b18637d4e5f338c" - , "fetch": "https://github.com/catchorg/Catch2/archive/v2.13.1.tar.gz" - , "sha256": "36bcc9e6190923961be11e589d747e606515de95f10779e29853cfeae560bd6c" - , "sha512": "2c5394d4ca8346d7d64203048f4ba503c2f813aa2ea7d065ffb9c63f532b7f18daee3e1a4a37314575e33f14259182edd1db030ed254b97a2e3f11d295555397" - , "subdir": "Catch2-2.13.1/single_include/catch2" + , "content": "fd54249eeb20894ece50696a84ef674a0052b6da" + , "fetch": "https://github.com/catchorg/Catch2/archive/refs/tags/v3.3.2.tar.gz" + , "sha256": "8361907f4d9bff3ae7c1edb027f813659f793053c99b67837a0c0375f065bae2" + , "sha512": "3d0c5666509a19be54ea0c48a3c8e1c4a951a2d991a7c9f7fe6d326661464538f1ab9dc573b1b2647f49fb6bef45bbd866142a4ce0fba38545ad182b8d55f61f" + , "subdir": "Catch2-3.3.2" } , "target_root": "import targets" , "target_file_name": "TARGETS.catch2" diff --git a/test/buildtool/build_engine/base_maps/directory_map.test.cpp b/test/buildtool/build_engine/base_maps/directory_map.test.cpp index 82227c28..1b9fe6cd 100644 --- a/test/buildtool/build_engine/base_maps/directory_map.test.cpp +++ b/test/buildtool/build_engine/base_maps/directory_map.test.cpp @@ -14,7 +14,7 @@ #include <filesystem> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/build_engine/base_maps/directory_map.hpp" #include "src/buildtool/common/repository_config.hpp" #include "src/buildtool/multithreading/task_system.hpp" diff --git a/test/buildtool/build_engine/base_maps/entity_name.test.cpp b/test/buildtool/build_engine/base_maps/entity_name.test.cpp index feb80b2d..223de0fc 100644 --- a/test/buildtool/build_engine/base_maps/entity_name.test.cpp +++ b/test/buildtool/build_engine/base_maps/entity_name.test.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/build_engine/base_maps/entity_name.hpp" TEST_CASE("Normal module names") { diff --git a/test/buildtool/build_engine/base_maps/expression_map.test.cpp b/test/buildtool/build_engine/base_maps/expression_map.test.cpp index 58d1161b..89b73d33 100644 --- a/test/buildtool/build_engine/base_maps/expression_map.test.cpp +++ b/test/buildtool/build_engine/base_maps/expression_map.test.cpp @@ -15,7 +15,7 @@ #include <filesystem> #include <functional> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/build_engine/base_maps/expression_map.hpp" #include "src/buildtool/build_engine/base_maps/json_file_map.hpp" #include "src/buildtool/common/repository_config.hpp" diff --git a/test/buildtool/build_engine/base_maps/json_file_map.test.cpp b/test/buildtool/build_engine/base_maps/json_file_map.test.cpp index f57fd5ff..15ff87cd 100644 --- a/test/buildtool/build_engine/base_maps/json_file_map.test.cpp +++ b/test/buildtool/build_engine/base_maps/json_file_map.test.cpp @@ -15,7 +15,7 @@ #include <filesystem> #include <utility> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/build_engine/base_maps/json_file_map.hpp" #include "src/buildtool/multithreading/task_system.hpp" #include "test/buildtool/build_engine/base_maps/test_repo.hpp" diff --git a/test/buildtool/build_engine/base_maps/rule_map.test.cpp b/test/buildtool/build_engine/base_maps/rule_map.test.cpp index eb61c05a..4235d1f1 100644 --- a/test/buildtool/build_engine/base_maps/rule_map.test.cpp +++ b/test/buildtool/build_engine/base_maps/rule_map.test.cpp @@ -15,7 +15,7 @@ #include <filesystem> #include <functional> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/build_engine/base_maps/expression_map.hpp" #include "src/buildtool/build_engine/base_maps/json_file_map.hpp" #include "src/buildtool/build_engine/base_maps/rule_map.hpp" diff --git a/test/buildtool/build_engine/base_maps/source_map.test.cpp b/test/buildtool/build_engine/base_maps/source_map.test.cpp index 15b32ead..3b787ffe 100644 --- a/test/buildtool/build_engine/base_maps/source_map.test.cpp +++ b/test/buildtool/build_engine/base_maps/source_map.test.cpp @@ -15,7 +15,7 @@ #include <filesystem> #include <utility> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/build_engine/base_maps/directory_map.hpp" #include "src/buildtool/build_engine/base_maps/entity_name.hpp" #include "src/buildtool/build_engine/base_maps/source_map.hpp" diff --git a/test/buildtool/build_engine/expression/configuration.test.cpp b/test/buildtool/build_engine/expression/configuration.test.cpp index 2ca98a24..47ad8084 100644 --- a/test/buildtool/build_engine/expression/configuration.test.cpp +++ b/test/buildtool/build_engine/expression/configuration.test.cpp @@ -14,7 +14,7 @@ #include <vector> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/build_engine/expression/configuration.hpp" #include "test/utils/container_matchers.hpp" diff --git a/test/buildtool/build_engine/expression/expression.test.cpp b/test/buildtool/build_engine/expression/expression.test.cpp index 780b66e5..10edbcbd 100644 --- a/test/buildtool/build_engine/expression/expression.test.cpp +++ b/test/buildtool/build_engine/expression/expression.test.cpp @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" +#include "catch2/matchers/catch_matchers_all.hpp" #include "src/buildtool/build_engine/expression/configuration.hpp" #include "src/buildtool/build_engine/expression/expression.hpp" #include "src/buildtool/build_engine/expression/function_map.hpp" @@ -78,7 +79,8 @@ TEST_CASE("Expression access", "[expression]") { // NOLINT CHECK(result->Result() == result_t{boolean, number, string}); CHECK_THROWS_AS(result->String(), Expression::ExpressionTypeError); - CHECK_THAT(list->List(), Catch::Equals<ExpressionPtr>({number})); + CHECK_THAT(list->List(), + Catch::Matchers::Equals<ExpressionPtr>({number})); CHECK_THROWS_AS(list->Map(), Expression::ExpressionTypeError); REQUIRE(map->Map().at("3"s) == number); diff --git a/test/buildtool/build_engine/expression/linked_map.test.cpp b/test/buildtool/build_engine/expression/linked_map.test.cpp index 358ac229..dd15a5b0 100644 --- a/test/buildtool/build_engine/expression/linked_map.test.cpp +++ b/test/buildtool/build_engine/expression/linked_map.test.cpp @@ -14,7 +14,7 @@ #include <algorithm> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/build_engine/expression/linked_map.hpp" #include "test/utils/container_matchers.hpp" diff --git a/test/buildtool/build_engine/target_map/result_map.test.cpp b/test/buildtool/build_engine/target_map/result_map.test.cpp index bb901d36..07e12f80 100644 --- a/test/buildtool/build_engine/target_map/result_map.test.cpp +++ b/test/buildtool/build_engine/target_map/result_map.test.cpp @@ -18,7 +18,7 @@ #include <string> #include <vector> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/build_engine/target_map/result_map.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" diff --git a/test/buildtool/build_engine/target_map/target_map.test.cpp b/test/buildtool/build_engine/target_map/target_map.test.cpp index e111f98f..6d9cbbdd 100644 --- a/test/buildtool/build_engine/target_map/target_map.test.cpp +++ b/test/buildtool/build_engine/target_map/target_map.test.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/build_engine/base_maps/directory_map.hpp" #include "src/buildtool/build_engine/base_maps/entity_name.hpp" #include "src/buildtool/build_engine/base_maps/expression_map.hpp" diff --git a/test/buildtool/build_engine/target_map/target_map_internals.test.cpp b/test/buildtool/build_engine/target_map/target_map_internals.test.cpp index d0c67dde..c562b8fd 100644 --- a/test/buildtool/build_engine/target_map/target_map_internals.test.cpp +++ b/test/buildtool/build_engine/target_map/target_map_internals.test.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/build_engine/expression/expression.hpp" #include "src/buildtool/build_engine/target_map/utils.hpp" diff --git a/test/buildtool/common/action_description.test.cpp b/test/buildtool/common/action_description.test.cpp index 5f3b1b57..b32e6914 100644 --- a/test/buildtool/common/action_description.test.cpp +++ b/test/buildtool/common/action_description.test.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/common/action_description.hpp" #include "src/buildtool/common/artifact_factory.hpp" diff --git a/test/buildtool/common/artifact_description.test.cpp b/test/buildtool/common/artifact_description.test.cpp index 7de79dcf..434c0d91 100644 --- a/test/buildtool/common/artifact_description.test.cpp +++ b/test/buildtool/common/artifact_description.test.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/common/artifact_description.hpp" #include "src/buildtool/common/artifact_factory.hpp" diff --git a/test/buildtool/common/artifact_factory.test.cpp b/test/buildtool/common/artifact_factory.test.cpp index 47e3d0e5..a71a5b63 100644 --- a/test/buildtool/common/artifact_factory.test.cpp +++ b/test/buildtool/common/artifact_factory.test.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/common/artifact_factory.hpp" TEST_CASE("Description missing mandatory key/value pair", diff --git a/test/buildtool/common/repository_config.test.cpp b/test/buildtool/common/repository_config.test.cpp index 406ca2fe..29c89d50 100644 --- a/test/buildtool/common/repository_config.test.cpp +++ b/test/buildtool/common/repository_config.test.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/common/repository_config.hpp" #include "src/buildtool/storage/storage.hpp" #include "test/utils/hermeticity/local.hpp" diff --git a/test/buildtool/crypto/hash_function.test.cpp b/test/buildtool/crypto/hash_function.test.cpp index efee09fd..340384e7 100644 --- a/test/buildtool/crypto/hash_function.test.cpp +++ b/test/buildtool/crypto/hash_function.test.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/crypto/hash_function.hpp" TEST_CASE("Hash Function", "[crypto]") { diff --git a/test/buildtool/crypto/hasher.test.cpp b/test/buildtool/crypto/hasher.test.cpp index 45f24db7..26cc8568 100644 --- a/test/buildtool/crypto/hasher.test.cpp +++ b/test/buildtool/crypto/hasher.test.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/crypto/hasher.hpp" template <Hasher::HashType type> diff --git a/test/buildtool/execution_api/bazel/bazel_api.test.cpp b/test/buildtool/execution_api/bazel/bazel_api.test.cpp index 9eadb483..288b9bcc 100644 --- a/test/buildtool/execution_api/bazel/bazel_api.test.cpp +++ b/test/buildtool/execution_api/bazel/bazel_api.test.cpp @@ -15,7 +15,7 @@ #include <cstdlib> #include <string> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/execution_api/remote/bazel/bazel_api.hpp" #include "src/buildtool/execution_api/remote/config.hpp" #include "test/buildtool/execution_api/common/api_test.hpp" diff --git a/test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp b/test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp index 8b81307b..8d21dbb3 100644 --- a/test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp +++ b/test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp @@ -14,7 +14,7 @@ #include <string> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/execution_api/remote/bazel/bazel_cas_client.hpp" #include "src/buildtool/execution_api/remote/bazel/bazel_execution_client.hpp" #include "src/buildtool/execution_api/remote/config.hpp" diff --git a/test/buildtool/execution_api/bazel/bazel_execution_client.test.cpp b/test/buildtool/execution_api/bazel/bazel_execution_client.test.cpp index d136e818..cb79fc8d 100755 --- a/test/buildtool/execution_api/bazel/bazel_execution_client.test.cpp +++ b/test/buildtool/execution_api/bazel/bazel_execution_client.test.cpp @@ -14,7 +14,7 @@ #include <string> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/execution_api/remote/bazel/bazel_execution_client.hpp" #include "src/buildtool/execution_api/remote/config.hpp" #include "test/utils/remote_execution/bazel_action_creator.hpp" diff --git a/test/buildtool/execution_api/bazel/bazel_msg_factory.test.cpp b/test/buildtool/execution_api/bazel/bazel_msg_factory.test.cpp index 67deb467..4322a46b 100644 --- a/test/buildtool/execution_api/bazel/bazel_msg_factory.test.cpp +++ b/test/buildtool/execution_api/bazel/bazel_msg_factory.test.cpp @@ -14,7 +14,7 @@ #include <filesystem> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/common/artifact_factory.hpp" #include "src/buildtool/execution_api/bazel_msg/bazel_blob.hpp" #include "src/buildtool/execution_api/bazel_msg/bazel_blob_container.hpp" diff --git a/test/buildtool/execution_api/bazel/bazel_network.test.cpp b/test/buildtool/execution_api/bazel/bazel_network.test.cpp index b7f801f2..80714b97 100644 --- a/test/buildtool/execution_api/bazel/bazel_network.test.cpp +++ b/test/buildtool/execution_api/bazel/bazel_network.test.cpp @@ -14,7 +14,7 @@ #include <string> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/execution_api/remote/bazel/bazel_execution_client.hpp" #include "src/buildtool/execution_api/remote/bazel/bazel_network.hpp" #include "src/buildtool/execution_api/remote/config.hpp" diff --git a/test/buildtool/execution_api/bazel/bytestream_client.test.cpp b/test/buildtool/execution_api/bazel/bytestream_client.test.cpp index c7e4d7bc..e67afdb2 100644 --- a/test/buildtool/execution_api/bazel/bytestream_client.test.cpp +++ b/test/buildtool/execution_api/bazel/bytestream_client.test.cpp @@ -14,7 +14,7 @@ #include <string> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/execution_api/bazel_msg/bazel_blob.hpp" #include "src/buildtool/execution_api/common/execution_common.hpp" #include "src/buildtool/execution_api/remote/bazel/bytestream_client.hpp" diff --git a/test/buildtool/execution_api/common/api_test.hpp b/test/buildtool/execution_api/common/api_test.hpp index 2589bbdf..4e4c0793 100644 --- a/test/buildtool/execution_api/common/api_test.hpp +++ b/test/buildtool/execution_api/common/api_test.hpp @@ -15,7 +15,7 @@ #include <cstdlib> #include <string> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/common/artifact_factory.hpp" #include "src/buildtool/execution_api/common/execution_action.hpp" #include "src/buildtool/execution_api/common/execution_api.hpp" diff --git a/test/buildtool/execution_api/local/local_api.test.cpp b/test/buildtool/execution_api/local/local_api.test.cpp index cd1d866f..38c9007d 100644 --- a/test/buildtool/execution_api/local/local_api.test.cpp +++ b/test/buildtool/execution_api/local/local_api.test.cpp @@ -15,7 +15,7 @@ #include <cstdlib> #include <string> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/execution_api/local/local_api.hpp" #include "test/buildtool/execution_api/common/api_test.hpp" #include "test/utils/hermeticity/local.hpp" diff --git a/test/buildtool/execution_api/local/local_execution.test.cpp b/test/buildtool/execution_api/local/local_execution.test.cpp index b695df1e..9dbed876 100755 --- a/test/buildtool/execution_api/local/local_execution.test.cpp +++ b/test/buildtool/execution_api/local/local_execution.test.cpp @@ -16,7 +16,7 @@ #include <string> #include <vector> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/common/artifact_factory.hpp" #include "src/buildtool/execution_api/local/local_api.hpp" #include "test/utils/hermeticity/local.hpp" diff --git a/test/buildtool/execution_engine/dag/dag.test.cpp b/test/buildtool/execution_engine/dag/dag.test.cpp index 7a1ca1de..b793a2a7 100644 --- a/test/buildtool/execution_engine/dag/dag.test.cpp +++ b/test/buildtool/execution_engine/dag/dag.test.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/common/artifact_factory.hpp" #include "src/buildtool/execution_engine/dag/dag.hpp" #include "test/utils/container_matchers.hpp" diff --git a/test/buildtool/execution_engine/executor/executor.test.cpp b/test/buildtool/execution_engine/executor/executor.test.cpp index 0c5279a0..e4cdb3a1 100755 --- a/test/buildtool/execution_engine/executor/executor.test.cpp +++ b/test/buildtool/execution_engine/executor/executor.test.cpp @@ -16,7 +16,7 @@ #include <unordered_map> #include <vector> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/common/artifact_factory.hpp" #include "src/buildtool/execution_api/common/execution_api.hpp" #include "src/buildtool/execution_engine/executor/executor.hpp" diff --git a/test/buildtool/execution_engine/executor/executor_api.test.hpp b/test/buildtool/execution_engine/executor/executor_api.test.hpp index c83bc615..f432fb54 100755 --- a/test/buildtool/execution_engine/executor/executor_api.test.hpp +++ b/test/buildtool/execution_engine/executor/executor_api.test.hpp @@ -17,7 +17,7 @@ #include <functional> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/common/artifact.hpp" #include "src/buildtool/common/artifact_description.hpp" #include "src/buildtool/common/artifact_factory.hpp" diff --git a/test/buildtool/execution_engine/executor/executor_api_local.test.cpp b/test/buildtool/execution_engine/executor/executor_api_local.test.cpp index d09ad17f..3f5f2ac9 100755 --- a/test/buildtool/execution_engine/executor/executor_api_local.test.cpp +++ b/test/buildtool/execution_engine/executor/executor_api_local.test.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/execution_api/local/local_api.hpp" #include "src/buildtool/execution_api/remote/config.hpp" #include "src/buildtool/execution_engine/executor/executor.hpp" diff --git a/test/buildtool/execution_engine/executor/executor_api_remote_bazel.test.cpp b/test/buildtool/execution_engine/executor/executor_api_remote_bazel.test.cpp index 76d03aef..fb34749f 100755 --- a/test/buildtool/execution_engine/executor/executor_api_remote_bazel.test.cpp +++ b/test/buildtool/execution_engine/executor/executor_api_remote_bazel.test.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/execution_api/remote/bazel/bazel_api.hpp" #include "src/buildtool/execution_api/remote/config.hpp" #include "src/buildtool/execution_engine/executor/executor.hpp" diff --git a/test/buildtool/execution_engine/traverser/traverser.test.cpp b/test/buildtool/execution_engine/traverser/traverser.test.cpp index f002d34e..2354aaf1 100644 --- a/test/buildtool/execution_engine/traverser/traverser.test.cpp +++ b/test/buildtool/execution_engine/traverser/traverser.test.cpp @@ -20,7 +20,7 @@ #include <variant> #include <vector> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/common/artifact_factory.hpp" #include "src/buildtool/execution_engine/dag/dag.hpp" #include "src/buildtool/execution_engine/traverser/traverser.hpp" diff --git a/test/buildtool/file_system/directory_entries.test.cpp b/test/buildtool/file_system/directory_entries.test.cpp index 009a09f6..b2729b58 100644 --- a/test/buildtool/file_system/directory_entries.test.cpp +++ b/test/buildtool/file_system/directory_entries.test.cpp @@ -15,7 +15,7 @@ #include <atomic> #include <thread> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/common/artifact_description.hpp" #include "src/buildtool/file_system/file_root.hpp" #include "test/utils/container_matchers.hpp" diff --git a/test/buildtool/file_system/file_root.test.cpp b/test/buildtool/file_system/file_root.test.cpp index 7ac1c680..1255a263 100644 --- a/test/buildtool/file_system/file_root.test.cpp +++ b/test/buildtool/file_system/file_root.test.cpp @@ -15,7 +15,7 @@ #include <atomic> #include <thread> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/common/artifact_description.hpp" #include "src/buildtool/file_system/file_root.hpp" #include "test/utils/container_matchers.hpp" diff --git a/test/buildtool/file_system/file_system_manager.test.cpp b/test/buildtool/file_system/file_system_manager.test.cpp index 8958854d..f627bf02 100644 --- a/test/buildtool/file_system/file_system_manager.test.cpp +++ b/test/buildtool/file_system/file_system_manager.test.cpp @@ -18,7 +18,8 @@ #include <filesystem> #include <iostream> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" +#include "catch2/generators/catch_generators_all.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" class CopyFileFixture { diff --git a/test/buildtool/file_system/git_repo.test.cpp b/test/buildtool/file_system/git_repo.test.cpp index 01898c26..55e51148 100644 --- a/test/buildtool/file_system/git_repo.test.cpp +++ b/test/buildtool/file_system/git_repo.test.cpp @@ -14,7 +14,7 @@ #include <thread> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "nlohmann/json.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/file_system/git_repo.hpp" diff --git a/test/buildtool/file_system/git_tree.test.cpp b/test/buildtool/file_system/git_tree.test.cpp index ace61721..b6daea57 100644 --- a/test/buildtool/file_system/git_tree.test.cpp +++ b/test/buildtool/file_system/git_tree.test.cpp @@ -14,7 +14,7 @@ #include <thread> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/file_system/git_tree.hpp" #include "test/utils/container_matchers.hpp" diff --git a/test/buildtool/file_system/object_cas.test.cpp b/test/buildtool/file_system/object_cas.test.cpp index bf20a287..3692b5fb 100644 --- a/test/buildtool/file_system/object_cas.test.cpp +++ b/test/buildtool/file_system/object_cas.test.cpp @@ -14,7 +14,7 @@ #include <string> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/crypto/hash_function.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/file_system/object_cas.hpp" diff --git a/test/buildtool/graph_traverser/graph_traverser.test.hpp b/test/buildtool/graph_traverser/graph_traverser.test.hpp index b6dfbea4..c5ffb840 100644 --- a/test/buildtool/graph_traverser/graph_traverser.test.hpp +++ b/test/buildtool/graph_traverser/graph_traverser.test.hpp @@ -19,7 +19,7 @@ #include <sstream> #include <utility> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/common/statistics.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/file_system/jsonfs.hpp" diff --git a/test/buildtool/graph_traverser/graph_traverser_local.test.cpp b/test/buildtool/graph_traverser/graph_traverser_local.test.cpp index 0641c38b..bfb8a2e0 100644 --- a/test/buildtool/graph_traverser/graph_traverser_local.test.cpp +++ b/test/buildtool/graph_traverser/graph_traverser_local.test.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "test/buildtool/graph_traverser/graph_traverser.test.hpp" #include "test/utils/hermeticity/local.hpp" diff --git a/test/buildtool/graph_traverser/graph_traverser_remote.test.cpp b/test/buildtool/graph_traverser/graph_traverser_remote.test.cpp index 4cdabffc..48867d16 100644 --- a/test/buildtool/graph_traverser/graph_traverser_remote.test.cpp +++ b/test/buildtool/graph_traverser/graph_traverser_remote.test.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "test/buildtool/graph_traverser/graph_traverser.test.hpp" TEST_CASE("Remote: Output created and contents are correct", diff --git a/test/buildtool/logging/log_sink_file.test.cpp b/test/buildtool/logging/log_sink_file.test.cpp index 5fda1680..f2c7095e 100644 --- a/test/buildtool/logging/log_sink_file.test.cpp +++ b/test/buildtool/logging/log_sink_file.test.cpp @@ -13,9 +13,12 @@ // limitations under the License. #include <fstream> +#include <iostream> #include <thread> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" +#include "catch2/generators/catch_generators_all.hpp" +#include "catch2/matchers/catch_matchers_all.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/logging/log_config.hpp" #include "src/buildtool/logging/log_sink_cmdline.hpp" @@ -104,10 +107,11 @@ TEST_CASE("LogSinkFile", "[logging]") { CHECK(lines.size() == num_threads + 1); // check for corrupted content - using Catch::Matchers::Contains; for (auto const& line : lines) { - CHECK_THAT(line, - Contains("somecontent") or Contains("this is thread ")); + CHECK_THAT( + line, + Catch::Matchers::ContainsSubstring("somecontent") || + Catch::Matchers::ContainsSubstring("this is thread")); } } } diff --git a/test/buildtool/logging/logger.test.cpp b/test/buildtool/logging/logger.test.cpp index 93c916b8..fd8f3bda 100644 --- a/test/buildtool/logging/logger.test.cpp +++ b/test/buildtool/logging/logger.test.cpp @@ -16,7 +16,7 @@ #include <string> #include <unordered_map> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/logging/log_config.hpp" #include "src/buildtool/logging/log_sink.hpp" #include "src/buildtool/logging/logger.hpp" diff --git a/test/buildtool/main/install_cas.test.cpp b/test/buildtool/main/install_cas.test.cpp index 810b532b..6929d446 100644 --- a/test/buildtool/main/install_cas.test.cpp +++ b/test/buildtool/main/install_cas.test.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/main/install_cas.hpp" TEST_CASE("ObjectInfoFromLiberalString", "[artifact]") { diff --git a/test/buildtool/multithreading/async_map.test.cpp b/test/buildtool/multithreading/async_map.test.cpp index 589b799a..30a6322a 100644 --- a/test/buildtool/multithreading/async_map.test.cpp +++ b/test/buildtool/multithreading/async_map.test.cpp @@ -14,7 +14,7 @@ #include <string> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/multithreading/async_map.hpp" #include "src/buildtool/multithreading/async_map_node.hpp" #include "src/buildtool/multithreading/task_system.hpp" diff --git a/test/buildtool/multithreading/async_map_consumer.test.cpp b/test/buildtool/multithreading/async_map_consumer.test.cpp index f9cbc36b..4e8df652 100644 --- a/test/buildtool/multithreading/async_map_consumer.test.cpp +++ b/test/buildtool/multithreading/async_map_consumer.test.cpp @@ -16,7 +16,8 @@ #include <numeric> #include <string> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" +#include "catch2/matchers/catch_matchers_all.hpp" #include "src/buildtool/multithreading/async_map.hpp" #include "src/buildtool/multithreading/async_map_consumer.hpp" #include "src/buildtool/multithreading/task_system.hpp" diff --git a/test/buildtool/multithreading/async_map_node.test.cpp b/test/buildtool/multithreading/async_map_node.test.cpp index 8aa8f598..8dd9bf89 100644 --- a/test/buildtool/multithreading/async_map_node.test.cpp +++ b/test/buildtool/multithreading/async_map_node.test.cpp @@ -16,7 +16,8 @@ #include <string> #include <thread> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" +#include "catch2/matchers/catch_matchers_all.hpp" #include "src/buildtool/multithreading/async_map_node.hpp" #include "src/buildtool/multithreading/task_system.hpp" diff --git a/test/buildtool/multithreading/task.test.cpp b/test/buildtool/multithreading/task.test.cpp index c39067ed..cb540def 100644 --- a/test/buildtool/multithreading/task.test.cpp +++ b/test/buildtool/multithreading/task.test.cpp @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/multithreading/task.hpp" namespace { - +constexpr int kDummyValue{5}; struct StatelessCallable { void operator()() noexcept {} }; @@ -25,7 +25,7 @@ struct ValueCaptureCallable { explicit ValueCaptureCallable(int i) noexcept : number{i} {} // NOLINTNEXTLINE - void operator()() noexcept { number += 5; } + void operator()() noexcept { number += kDummyValue; } int number; }; @@ -125,12 +125,24 @@ TEST_CASE("Task constructed from lambda is not empty", "[task]") { SECTION("Value capture") { int a = 1; // NOLINTNEXTLINE - Task t_value{[num = a]() mutable { num += 5; }}; + Task t_value{[num = a]() mutable { + num += kDummyValue; + // get rid of "set but unused var" + static_cast<void>(num); + }}; // NOLINTNEXTLINE - auto lambda = [num = a]() mutable { num += 5; }; + auto lambda = [num = a]() mutable { + num += kDummyValue; + // get rid of "set but unused var" + static_cast<void>(num); + }; Task t_from_named_lambda_value_capture{lambda}; - CHECK(Task{[num = a]() mutable { num += 5; }}); + CHECK(Task{[num = a]() mutable { + num += kDummyValue; + // get rid of "set but unused var" + static_cast<void>(num); + }}); CHECK(Task{lambda}); CHECK(t_value); CHECK(t_from_named_lambda_value_capture); @@ -174,7 +186,11 @@ TEST_CASE("Task can be executed and doesn't steal contents", "[task]") { int const initial_value = 2; int num = initial_value; // NOLINTNEXTLINE - Task t_add_five{[a = num]() mutable { a += 5; }}; + Task t_add_five{[a = num]() mutable { + a += kDummyValue; + // get rid of "set but unused var" + static_cast<void>(a); + }}; t_add_five(); // Internal data can not be observed, external data does not change @@ -197,7 +213,11 @@ TEST_CASE("Task can be executed and doesn't steal contents", "[task]") { int const initial_value = 2; int num = initial_value; // NOLINTNEXTLINE - auto add_five = [a = num]() mutable { a += 5; }; + auto add_five = [a = num]() mutable { + a += kDummyValue; + // get rid of "set but unused var" + static_cast<void>(a); + }; Task t_add_five{add_five}; t_add_five(); @@ -227,7 +247,11 @@ TEST_CASE("Task can be executed and doesn't steal contents", "[task]") { int const initial_value = 2; int num = initial_value; // NOLINTNEXTLINE - std::function<void()> add_five{[a = num]() mutable { a += 5; }}; + std::function<void()> add_five{[a = num]() mutable { + a += kDummyValue; + // get rid of "set but unused var" + static_cast<void>(a); + }}; Task t_add_five{add_five}; t_add_five(); @@ -295,7 +319,11 @@ TEST_CASE("Task moving from named object can be executed", "[task]") { int const initial_value = 2; int num = initial_value; // NOLINTNEXTLINE - auto add_five = [a = num]() mutable { a += 5; }; + auto add_five = [a = num]() mutable { + a += kDummyValue; + // get rid of "set but unused var" + static_cast<void>(a); + }; Task t_add_five{std::move(add_five)}; t_add_five(); @@ -320,7 +348,11 @@ TEST_CASE("Task moving from named object can be executed", "[task]") { int const initial_value = 2; int num = initial_value; // NOLINTNEXTLINE - std::function<void()> add_five{[a = num]() mutable { a += 5; }}; + std::function<void()> add_five{[a = num]() mutable { + a += kDummyValue; + // get rid of "set but unused var" + static_cast<void>(a); + }}; Task t_add_five{std::move(add_five)}; t_add_five(); diff --git a/test/buildtool/multithreading/task_system.test.cpp b/test/buildtool/multithreading/task_system.test.cpp index 82b2e2a0..694158ba 100644 --- a/test/buildtool/multithreading/task_system.test.cpp +++ b/test/buildtool/multithreading/task_system.test.cpp @@ -19,7 +19,9 @@ #include <thread> #include <unordered_set> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" +#include "catch2/generators/catch_generators_all.hpp" +#include "catch2/matchers/catch_matchers_all.hpp" #include "src/buildtool/multithreading/task_system.hpp" #include "test/utils/container_matchers.hpp" diff --git a/test/buildtool/storage/local_ac.test.cpp b/test/buildtool/storage/local_ac.test.cpp index 19da0e59..f4867e32 100644 --- a/test/buildtool/storage/local_ac.test.cpp +++ b/test/buildtool/storage/local_ac.test.cpp @@ -14,7 +14,7 @@ #include <string> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "gsl-lite/gsl-lite.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/storage/storage.hpp" diff --git a/test/buildtool/storage/local_cas.test.cpp b/test/buildtool/storage/local_cas.test.cpp index 95d119bf..631d2eba 100644 --- a/test/buildtool/storage/local_cas.test.cpp +++ b/test/buildtool/storage/local_cas.test.cpp @@ -14,7 +14,7 @@ #include <string> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/storage/storage.hpp" #include "test/utils/hermeticity/local.hpp" diff --git a/test/buildtool/system/system_command.test.cpp b/test/buildtool/system/system_command.test.cpp index dbe73006..292f437f 100644 --- a/test/buildtool/system/system_command.test.cpp +++ b/test/buildtool/system/system_command.test.cpp @@ -15,7 +15,8 @@ #include <cstdlib> #include <iostream> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" +#include "catch2/matchers/catch_matchers_all.hpp" #include "src/buildtool/system/system_command.hpp" namespace { diff --git a/test/main.cpp b/test/main.cpp index 0bcae614..c93583f2 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -12,8 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#define CATCH_CONFIG_RUNNER -#include "catch2/catch.hpp" +#include "catch2/catch_session.hpp" #include "test/utils/logging/log_config.hpp" auto main(int argc, char* argv[]) -> int { diff --git a/test/other_tools/git_operations/critical_git_ops.test.cpp b/test/other_tools/git_operations/critical_git_ops.test.cpp index 04faa6b9..092a3293 100644 --- a/test/other_tools/git_operations/critical_git_ops.test.cpp +++ b/test/other_tools/git_operations/critical_git_ops.test.cpp @@ -14,7 +14,7 @@ #include <thread> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "nlohmann/json.hpp" #include "src/buildtool/execution_api/common/execution_common.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" diff --git a/test/other_tools/git_operations/git_repo_remote.test.cpp b/test/other_tools/git_operations/git_repo_remote.test.cpp index 4b7a2a77..6850355e 100644 --- a/test/other_tools/git_operations/git_repo_remote.test.cpp +++ b/test/other_tools/git_operations/git_repo_remote.test.cpp @@ -14,7 +14,7 @@ #include <thread> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "nlohmann/json.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/other_tools/git_operations/git_repo_remote.hpp" diff --git a/test/other_tools/utils/archive_usage.test.cpp b/test/other_tools/utils/archive_usage.test.cpp index 2fe38460..cfbbc5ae 100644 --- a/test/other_tools/utils/archive_usage.test.cpp +++ b/test/other_tools/utils/archive_usage.test.cpp @@ -15,7 +15,7 @@ #include <string> #include <unordered_map> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/other_tools/utils/archive_ops.hpp" diff --git a/test/other_tools/utils/curl_url.test.cpp b/test/other_tools/utils/curl_url.test.cpp index ebddeca9..61c979af 100644 --- a/test/other_tools/utils/curl_url.test.cpp +++ b/test/other_tools/utils/curl_url.test.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/other_tools/utils/curl_url_handle.hpp" TEST_CASE("Curl URL handle basics", "[curl_url_handle_basics]") { diff --git a/test/other_tools/utils/curl_usage.test.cpp b/test/other_tools/utils/curl_usage.test.cpp index eaa84c7d..742026b6 100644 --- a/test/other_tools/utils/curl_usage.test.cpp +++ b/test/other_tools/utils/curl_usage.test.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/other_tools/utils/curl_context.hpp" #include "src/other_tools/utils/curl_easy_handle.hpp" diff --git a/test/utils/container_matchers.hpp b/test/utils/container_matchers.hpp index cb2ce05d..35a334e3 100644 --- a/test/utils/container_matchers.hpp +++ b/test/utils/container_matchers.hpp @@ -16,19 +16,21 @@ #define INCLUDED_SRC_TEST_UTILS_CONTAINER_MATCHERS_HPP #include <algorithm> +#include <numeric> #include <sstream> #include <string> #include <type_traits> #include <unordered_set> #include <vector> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" +#include "catch2/matchers/catch_matchers_all.hpp" /// \brief Matcher to check if the sets of elements present in two different /// containers are the same template <class LeftContainer, class RightContainer> class UniqueElementsUnorderedMatcher - : public Catch::MatcherBase<LeftContainer> { + : public Catch::Matchers::MatcherBase<LeftContainer> { RightContainer rhs_; @@ -101,7 +103,8 @@ inline auto HasSameUniqueElementsAs(std::initializer_list<T> const& rc) /// \brief Matcher to compare the contents of two containers up to permutation template <class LeftContainer> -class ContainerUnorderedMatcher : public Catch::MatcherBase<LeftContainer> { +class ContainerUnorderedMatcher + : public Catch::Matchers::MatcherBase<LeftContainer> { public: using value_type = typename LeftContainer::value_type; using T = value_type; diff --git a/test/utils/cpp/file_locking.test.cpp b/test/utils/cpp/file_locking.test.cpp index 9e3924e8..b313a21f 100644 --- a/test/utils/cpp/file_locking.test.cpp +++ b/test/utils/cpp/file_locking.test.cpp @@ -14,7 +14,7 @@ #include <thread> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/utils/cpp/atomic.hpp" #include "src/utils/cpp/file_locking.hpp" diff --git a/test/utils/cpp/path.test.cpp b/test/utils/cpp/path.test.cpp index 27ccb419..d6d4eb85 100644 --- a/test/utils/cpp/path.test.cpp +++ b/test/utils/cpp/path.test.cpp @@ -14,7 +14,7 @@ #include <filesystem> -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/utils/cpp/path.hpp" TEST_CASE("normalization", "[path]") { diff --git a/test/utils/remote_execution/main-remote-execution.cpp b/test/utils/remote_execution/main-remote-execution.cpp index 703de7f4..7dd48d92 100644 --- a/test/utils/remote_execution/main-remote-execution.cpp +++ b/test/utils/remote_execution/main-remote-execution.cpp @@ -19,7 +19,8 @@ #include <sstream> #include <thread> -#include "catch2/catch.hpp" +#include "catch2/catch_session.hpp" +#include "catch2/catch_test_macros.hpp" #include "src/buildtool/compatibility/compatibility.hpp" #include "src/buildtool/execution_api/remote/config.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" |