From 02785c694af914de9d8894faac6c1b4390f82418 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 2 Oct 2022 18:53:34 -0700 Subject: [PATCH] meson: switch arrays to files Allows muon to alphabetically sort files. switch headers back to arrays as split() can only be used on strings. Signed-off-by: Rosen Penev --- src/catch2/meson.build | 226 ++++++++++++++++----------------- tests/meson.build | 20 +-- tools/scripts/releaseCommon.py | 2 +- 3 files changed, 124 insertions(+), 124 deletions(-) diff --git a/src/catch2/meson.build b/src/catch2/meson.build index eb89fc2fdd..8f1e4331ad 100644 --- a/src/catch2/meson.build +++ b/src/catch2/meson.build @@ -41,40 +41,45 @@ benchmark_headers = [ 'benchmark/detail/catch_timing.hpp', ] -benchmark_sources = [ +benchmark_sources = files( 'benchmark/catch_chronometer.cpp', 'benchmark/detail/catch_benchmark_function.cpp', 'benchmark/detail/catch_run_for_at_least.cpp', 'benchmark/detail/catch_stats.cpp', -] +) internal_headers = [ - 'catch_all.hpp', - 'matchers/catch_matchers_all.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', - 'matchers/internal/catch_matchers_impl.hpp', - 'internal/catch_case_insensitive_comparisons.hpp', - 'internal/catch_console_width.hpp', - 'internal/catch_container_nonmembers.hpp', - 'internal/catch_noncopyable.hpp', - 'catch_approx.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', - 'catch_assertion_info.hpp', - 'catch_assertion_result.hpp', - 'internal/catch_test_macro_impl.hpp', - 'internal/catch_test_failure_exception.hpp', + 'internal/catch_case_insensitive_comparisons.hpp', 'internal/catch_case_sensitive.hpp', 'internal/catch_clara.hpp', 'internal/catch_commandline.hpp', - 'internal/catch_source_line_info.hpp', 'internal/catch_compiler_capabilities.hpp', - 'catch_config.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', @@ -86,41 +91,13 @@ internal_headers = [ 'internal/catch_fatal_condition_handler.hpp', 'internal/catch_floating_point_helpers.hpp', 'internal/catch_istream.hpp', - 'internal/catch_unique_name.hpp', - 'internal/catch_sharding.hpp', - 'generators/catch_generator_exception.hpp', - 'generators/catch_generators.hpp', - 'generators/catch_generators_adapters.hpp', - 'generators/catch_generators_random.hpp', - 'generators/catch_generators_range.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_lazy_expr.hpp', 'internal/catch_leak_detector.hpp', 'internal/catch_list.hpp', - 'matchers/catch_matchers.hpp', - 'matchers/catch_matchers_container_properties.hpp', - 'matchers/catch_matchers_contains.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', - 'catch_message.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_platform.hpp', @@ -132,133 +109,155 @@ internal_headers = [ '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_stdstreams.hpp', - 'catch_section_info.hpp', - 'catch_session.hpp', + 'internal/catch_sharding.hpp', 'internal/catch_singletons.hpp', + 'internal/catch_source_line_info.hpp', 'internal/catch_startup_exception_registry.hpp', - 'internal/catch_reusable_string_stream.hpp', + 'internal/catch_stdstreams.hpp', 'internal/catch_stream_end_stop.hpp', 'internal/catch_string_manip.hpp', 'internal/catch_stringref.hpp', - 'catch_tag_alias.hpp', - 'catch_get_random_seed.hpp', - 'catch_tag_alias_autoregistrar.hpp', 'internal/catch_tag_alias_registry.hpp', - 'catch_test_case_info.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', - 'catch_template_test_macros.hpp', - 'catch_test_macros.hpp', - 'internal/catch_template_test_registry.hpp', + 'internal/catch_test_failure_exception.hpp', + 'internal/catch_test_macro_impl.hpp', 'internal/catch_test_registry.hpp', - 'catch_test_spec.hpp', 'internal/catch_test_spec_parser.hpp', 'internal/catch_textflow.hpp', - 'catch_timer.hpp', 'internal/catch_to_string.hpp', - 'catch_tostring.hpp', - 'catch_totals.hpp', - 'catch_translate_exception.hpp', 'internal/catch_uncaught_exceptions.hpp', + 'internal/catch_unique_name.hpp', 'internal/catch_unique_ptr.hpp', 'internal/catch_void_type.hpp', - 'catch_version.hpp', - 'catch_version_macros.hpp', 'internal/catch_wildcard_pattern.hpp', 'internal/catch_windows_h_proxy.hpp', 'internal/catch_xmlwriter.hpp', - 'internal/catch_test_case_info_hasher.hpp', + 'matchers/catch_matchers.hpp', + 'matchers/catch_matchers_all.hpp', + 'matchers/catch_matchers_container_properties.hpp', + 'matchers/catch_matchers_contains.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', ] -internal_sources = [ - 'catch_approx.cpp', +internal_sources = files( + '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', - 'catch_assertion_result.cpp', + 'internal/catch_case_insensitive_comparisons.cpp', 'internal/catch_clara.cpp', 'internal/catch_commandline.cpp', - 'internal/catch_source_line_info.cpp', - 'catch_config.cpp', - 'internal/catch_case_insensitive_comparisons.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_istream.cpp', - 'interfaces/catch_interfaces_generatortracker.cpp', - 'interfaces/catch_interfaces_reporter.cpp', + 'internal/catch_lazy_expr.cpp', + 'internal/catch_leak_detector.cpp', 'internal/catch_list.cpp', - 'matchers/catch_matchers_floating_point.cpp', - 'matchers/catch_matchers_quantifiers.cpp', - 'matchers/catch_matchers_string.cpp', - 'matchers/catch_matchers_templated.cpp', - 'catch_message.cpp', + 'internal/catch_message_info.cpp', 'internal/catch_output_redirect.cpp', - 'catch_registry_hub.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_stdstreams.cpp', - 'catch_session.cpp', 'internal/catch_singletons.cpp', - 'internal/catch_reusable_string_stream.cpp', - 'internal/catch_stringref.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', - 'catch_test_case_info.cpp', + 'internal/catch_test_case_info_hasher.cpp', 'internal/catch_test_case_registry_impl.cpp', 'internal/catch_test_case_tracker.cpp', 'internal/catch_test_registry.cpp', - 'internal/catch_textflow.cpp', - 'catch_test_spec.cpp', 'internal/catch_test_spec_parser.cpp', - 'catch_timer.cpp', - 'catch_tostring.cpp', - 'catch_totals.cpp', - 'catch_version.cpp', + 'internal/catch_textflow.cpp', + 'internal/catch_uncaught_exceptions.cpp', 'internal/catch_wildcard_pattern.cpp', 'internal/catch_xmlwriter.cpp', - 'internal/catch_test_case_info_hasher.cpp', - 'generators/catch_generators_random.cpp', - 'generators/catch_generator_exception.cpp', - 'generators/catch_generators.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_tag_alias_autoregistrar.cpp', + 'catch_approx.cpp', + 'catch_assertion_result.cpp', + 'catch_config.cpp', 'catch_get_random_seed.cpp', - 'internal/catch_decomposer.cpp', - 'internal/catch_errno_guard.cpp', - 'internal/catch_lazy_expr.cpp', - 'internal/catch_leak_detector.cpp', - 'internal/catch_message_info.cpp', - 'internal/catch_polyfills.cpp', - 'internal/catch_startup_exception_registry.cpp', - 'internal/catch_uncaught_exceptions.cpp', - 'interfaces/catch_interfaces_capture.cpp', - 'interfaces/catch_interfaces_config.cpp', - 'interfaces/catch_interfaces_exception.cpp', - 'interfaces/catch_interfaces_registry_hub.cpp', - 'interfaces/catch_interfaces_reporter_factory.cpp', - 'interfaces/catch_interfaces_reporter_registry.cpp', - 'interfaces/catch_interfaces_testcase.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', +) reporter_headers = [ - 'reporters/catch_reporters_all.hpp', 'reporters/catch_reporter_automake.hpp', 'reporters/catch_reporter_common_base.hpp', 'reporters/catch_reporter_compact.hpp', @@ -274,9 +273,10 @@ reporter_headers = [ 'reporters/catch_reporter_tap.hpp', 'reporters/catch_reporter_teamcity.hpp', 'reporters/catch_reporter_xml.hpp', + 'reporters/catch_reporters_all.hpp', ] -reporter_sources = [ +reporter_sources = files( 'reporters/catch_reporter_automake.cpp', 'reporters/catch_reporter_common_base.cpp', 'reporters/catch_reporter_compact.cpp', @@ -292,7 +292,7 @@ reporter_sources = [ 'reporters/catch_reporter_tap.cpp', 'reporters/catch_reporter_teamcity.cpp', 'reporters/catch_reporter_xml.cpp', -] +) headers = benchmark_headers + internal_headers + reporter_headers sources = benchmark_sources + internal_sources + reporter_sources diff --git a/tests/meson.build b/tests/meson.build index 0145d78ec1..9da8eb525b 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -7,8 +7,7 @@ # define the sources of the self test # Please keep these ordered alphabetically -self_test_sources = [ - 'SelfTest/TestRegistrations.cpp', +self_test_sources = files( 'SelfTest/IntrospectiveTests/Clara.tests.cpp', 'SelfTest/IntrospectiveTests/CmdLine.tests.cpp', 'SelfTest/IntrospectiveTests/CmdLineHelpers.tests.cpp', @@ -20,17 +19,18 @@ self_test_sources = [ 'SelfTest/IntrospectiveTests/PartTracker.tests.cpp', 'SelfTest/IntrospectiveTests/RandomNumberGeneration.tests.cpp', 'SelfTest/IntrospectiveTests/Reporters.tests.cpp', - 'SelfTest/IntrospectiveTests/Tag.tests.cpp', - 'SelfTest/IntrospectiveTests/TestCaseInfoHasher.tests.cpp', - 'SelfTest/IntrospectiveTests/TestSpecParser.tests.cpp', - 'SelfTest/IntrospectiveTests/TextFlow.tests.cpp', 'SelfTest/IntrospectiveTests/Sharding.tests.cpp', 'SelfTest/IntrospectiveTests/Stream.tests.cpp', 'SelfTest/IntrospectiveTests/String.tests.cpp', 'SelfTest/IntrospectiveTests/StringManip.tests.cpp', - 'SelfTest/IntrospectiveTests/Xml.tests.cpp', + 'SelfTest/IntrospectiveTests/Tag.tests.cpp', + 'SelfTest/IntrospectiveTests/TestCaseInfoHasher.tests.cpp', + 'SelfTest/IntrospectiveTests/TestSpecParser.tests.cpp', + 'SelfTest/IntrospectiveTests/TextFlow.tests.cpp', 'SelfTest/IntrospectiveTests/ToString.tests.cpp', 'SelfTest/IntrospectiveTests/UniquePtr.tests.cpp', + 'SelfTest/IntrospectiveTests/Xml.tests.cpp', + 'SelfTest/TestRegistrations.cpp', 'SelfTest/TimingTests/Sleep.tests.cpp', 'SelfTest/UsageTests/Approx.tests.cpp', 'SelfTest/UsageTests/BDD.tests.cpp', @@ -42,6 +42,8 @@ self_test_sources = [ 'SelfTest/UsageTests/EnumToString.tests.cpp', 'SelfTest/UsageTests/Exception.tests.cpp', 'SelfTest/UsageTests/Generators.tests.cpp', + 'SelfTest/UsageTests/Matchers.tests.cpp', + 'SelfTest/UsageTests/MatchersRanges.tests.cpp', 'SelfTest/UsageTests/Message.tests.cpp', 'SelfTest/UsageTests/Misc.tests.cpp', 'SelfTest/UsageTests/ToStringByte.tests.cpp', @@ -55,9 +57,7 @@ self_test_sources = [ 'SelfTest/UsageTests/ToStringWhich.tests.cpp', 'SelfTest/UsageTests/Tricky.tests.cpp', 'SelfTest/UsageTests/VariadicMacros.tests.cpp', - 'SelfTest/UsageTests/MatchersRanges.tests.cpp', - 'SelfTest/UsageTests/Matchers.tests.cpp', -] +) # This isn't as good as the CMake tests, but it proves that we've # actually put something in the library files. diff --git a/tools/scripts/releaseCommon.py b/tools/scripts/releaseCommon.py index 30a07658d5..4d73431c8a 100644 --- a/tools/scripts/releaseCommon.py +++ b/tools/scripts/releaseCommon.py @@ -94,7 +94,7 @@ def updateMesonFile(version): with open(mesonPath, 'rb') as file: lines = file.readlines() replacementRegex = re.compile(b'''version\s*:\s*'(\\d+.\\d+.\\d+)', # CML version placeholder, don't delete''') - replacement = '''version : '{0}', # CML version placeholder, don't delete'''.format(version.getVersionString()).encode('ascii') + replacement = '''version: '{0}', # CML version placeholder, don't delete'''.format(version.getVersionString()).encode('ascii') with open(mesonPath, 'wb') as file: for line in lines: file.write(replacementRegex.sub(replacement, line))