diff --git a/pkg/front_end/testing.json b/pkg/front_end/testing.json index 43b5fd4b065..db851870308 100644 --- a/pkg/front_end/testing.json +++ b/pkg/front_end/testing.json @@ -25,11 +25,13 @@ ".dart", ".crash_dart" ], - "exclude": [ - "/testcases/.*_part[0-9]*\\.dart$", - "/testcases/.*_lib[0-9]*\\.dart$", + "excludeContains": [ "/testcases/dartino/", "/testcases/expression/" + ], + "exclude": [ + "/testcases/.*_part[0-9]*\\.dart$", + "/testcases/.*_lib[0-9]*\\.dart$" ] }, { @@ -53,12 +55,14 @@ ".dart", ".crash_dart" ], - "exclude": [ - "/testcases/.*_part[0-9]*\\.dart$", - "/testcases/.*_lib[0-9]*\\.dart$", + "excludeContains": [ "/testcases/dartino/", "/testcases/dart2wasm/", "/testcases/expression/" + ], + "exclude": [ + "/testcases/.*_part[0-9]*\\.dart$", + "/testcases/.*_lib[0-9]*\\.dart$" ] }, { @@ -71,12 +75,14 @@ ".dart", ".crash_dart" ], - "exclude": [ - "/testcases/.*_part[0-9]*\\.dart$", - "/testcases/.*_lib[0-9]*\\.dart$", + "excludeContains": [ "/testcases/dartino/", "/testcases/expression/", "/testcases/nnbd_mixed/" + ], + "exclude": [ + "/testcases/.*_part[0-9]*\\.dart$", + "/testcases/.*_lib[0-9]*\\.dart$" ] }, { @@ -89,12 +95,14 @@ ".dart", ".crash_dart" ], - "exclude": [ - "/testcases/.*_part[0-9]*\\.dart$", - "/testcases/.*_lib[0-9]*\\.dart$", + "excludeContains": [ "/testcases/dartino/", "/testcases/dart2wasm/", "/testcases/expression/" + ], + "exclude": [ + "/testcases/.*_part[0-9]*\\.dart$", + "/testcases/.*_lib[0-9]*\\.dart$" ] }, { @@ -225,10 +233,12 @@ "includeEndsWith": [ ".dart" ], - "exclude": [ - "kernel/lib/transformations/.*\\.dart$", - "_fe_analyzer_shared/lib/src/messages/diagnostic\\.g\\.dart$", - "front_end/lib/src/codes/diagnostic\\.g\\.dart$" + "excludeContains": [ + "kernel/lib/transformations/" + ], + "excludeEndsWith": [ + "_fe_analyzer_shared/lib/src/messages/diagnostic.g.dart", + "front_end/lib/src/codes/diagnostic.g.dart" ] }, { @@ -273,9 +283,9 @@ "includeEndsWith": [ ".dart" ], - "exclude": [ - "_fe_analyzer_shared/lib/src/messages/diagnostic\\.g\\.dart$", - "front_end/lib/src/codes/diagnostic\\.g\\.dart$" + "excludeEndsWith": [ + "_fe_analyzer_shared/lib/src/messages/diagnostic.g.dart", + "front_end/lib/src/codes/diagnostic.g.dart" ] }, { @@ -287,44 +297,46 @@ "includeEndsWith": [ ".dart" ], - "exclude": [ - "lib/", - "test/types/subtypes_benchmark\\.dart$", - "test/memory_file_system_test\\.dart$", - "test/scanner_cfe_test\\.dart$", - "test/scanner_test\\.dart$", + "excludeContains": [ + "lib/" + ], + "excludeEndsWith": [ + "test/types/subtypes_benchmark.dart", + "test/memory_file_system_test.dart", + "test/scanner_cfe_test.dart", + "test/scanner_test.dart", "test/spell_checking_utils_test.dart", - "test/standard_file_system_test\\.dart$", - "test/tool/reload\\.dart$", - "test/type_labeler_test\\.dart$", - "test/unit_test_suites\\.dart$", - "test/unit_test_suites_impl\\.dart$", - "testcases/expression/main\\.dart$", - "testcases/general/DeltaBlue\\.dart$", - "testcases/general/annotation_variable_declaration\\.dart$", - "testcases/general/arithmetic\\.dart$", - "testcases/general/bad_type_variable_uses_in_supertypes\\.dart$", - "testcases/general/clone_function_type\\.dart$", - "testcases/general/co19_language_metadata_syntax_t04\\.dart$", - "testcases/general/complex_class_hierarchy\\.dart$", - "testcases/general/issue34899\\.dart$", - "testcases/general/micro\\.dart$", - "testcases/general/redirecting_factory\\.dart$", - "testcases/general/spread_collection_inference\\.dart$", - "testcases/inference/downwards_inference_initializing_formal_default_formal\\.dart$", - "testcases/inference/downwards_inference_on_generic_function_expressions\\.dart$", - "testcases/inference/for_in_loop_promotion\\.dart$", - "testcases/inference/future_union_upwards_generic_methods\\.dart$", - "testcases/inference/generic_methods_infer_generic_instantiation\\.dart$", - "testcases/inference/generic_methods_infer_generic_instantiation2\\.dart$", - "testcases/inference/overloaded_int_operators\\.dart$", - "testcases/instantiate_to_bound/non_simple_many\\.dart$", - "testcases/instantiate_to_bound/non_simple_suppress_consequence\\.dart$", - "testcases/rasta/switch_execution_case_t01\\.dart$", - "testcases/rasta/switch_execution_case_t02\\.dart$", - "testcases/set_literals/disambiguation_rule\\.dart$", - "testcases/set_literals/disambiguation_rule2\\.dart$", - "tool/abcompile\\.dart$" + "test/standard_file_system_test.dart", + "test/tool/reload.dart", + "test/type_labeler_test.dart", + "test/unit_test_suites.dart", + "test/unit_test_suites_impl.dart", + "testcases/expression/main.dart", + "testcases/general/DeltaBlue.dart", + "testcases/general/annotation_variable_declaration.dart", + "testcases/general/arithmetic.dart", + "testcases/general/bad_type_variable_uses_in_supertypes.dart", + "testcases/general/clone_function_type.dart", + "testcases/general/co19_language_metadata_syntax_t04.dart", + "testcases/general/complex_class_hierarchy.dart", + "testcases/general/issue34899.dart", + "testcases/general/micro.dart", + "testcases/general/redirecting_factory.dart", + "testcases/general/spread_collection_inference.dart", + "testcases/inference/downwards_inference_initializing_formal_default_formal.dart", + "testcases/inference/downwards_inference_on_generic_function_expressions.dart", + "testcases/inference/for_in_loop_promotion.dart", + "testcases/inference/future_union_upwards_generic_methods.dart", + "testcases/inference/generic_methods_infer_generic_instantiation.dart", + "testcases/inference/generic_methods_infer_generic_instantiation2.dart", + "testcases/inference/overloaded_int_operators.dart", + "testcases/instantiate_to_bound/non_simple_many.dart", + "testcases/instantiate_to_bound/non_simple_suppress_consequence.dart", + "testcases/rasta/switch_execution_case_t01.dart", + "testcases/rasta/switch_execution_case_t02.dart", + "testcases/set_literals/disambiguation_rule.dart", + "testcases/set_literals/disambiguation_rule2.dart", + "tool/abcompile.dart" ] }, { @@ -380,4 +392,4 @@ "test/text_representation/data/" ] } -} +} \ No newline at end of file diff --git a/pkg/testing/lib/src/chain.dart b/pkg/testing/lib/src/chain.dart index 04adbc55c79..e5c74e7dab9 100644 --- a/pkg/testing/lib/src/chain.dart +++ b/pkg/testing/lib/src/chain.dart @@ -28,16 +28,13 @@ typedef CreateContext = /// A test suite for tool chains, for example, a compiler. class Chain extends Suite { final Uri source; - final Uri root; - final List subRoots; - final List includeEndsWith; - final List pattern; - final List exclude; + final List excludeContains; + final List excludeEndsWith; Chain( String name, @@ -49,6 +46,8 @@ class Chain extends Suite { this.includeEndsWith, this.pattern, this.exclude, + this.excludeContains, + this.excludeEndsWith, ) : super(name, kind, statusFile); factory Chain.fromJsonMap(Uri base, Map json, String name, String kind) { @@ -80,6 +79,12 @@ class Chain extends Suite { List exclude = [ for (final e in json['exclude'] ?? const []) RegExp(e), ]; + List excludeContains = List.from( + json['excludeContains'] ?? const [], + ); + List excludeEndsWith = List.from( + json['excludeEndsWith'] ?? const [], + ); return Chain( name, kind, @@ -90,6 +95,8 @@ class Chain extends Suite { includeEndsWith, pattern, exclude, + excludeContains, + excludeEndsWith, ); } @@ -124,6 +131,8 @@ class Chain extends Suite { "pattern": [for (final r in pattern) r.pattern], "includeEndsWith": includeEndsWith, "exclude": [for (final r in exclude) r.pattern], + "excludeContains": excludeContains, + "excludeEndsWith": excludeEndsWith, }; } } @@ -351,7 +360,17 @@ abstract class ChainContext { // Use `.uri.path` instead of just `.path` to ensure forward slashes. String path = entity.uri.path; - if (suite.exclude.any((RegExp r) => path.contains(r))) continue; + if (suite.excludeContains.any((String s) => path.contains(s))) { + continue; + } + + if (suite.excludeEndsWith.any((String s) => path.endsWith(s))) { + continue; + } + + if (suite.exclude.any((RegExp r) => path.contains(r))) { + continue; + } bool include = false; if (suite.includeEndsWith.any((String end) => path.endsWith(end))) {