diff --git a/pkg/_fe_analyzer_shared/lib/src/testing/id_testing.dart b/pkg/_fe_analyzer_shared/lib/src/testing/id_testing.dart index 4db476aeb94..8610190f21f 100644 --- a/pkg/_fe_analyzer_shared/lib/src/testing/id_testing.dart +++ b/pkg/_fe_analyzer_shared/lib/src/testing/id_testing.dart @@ -628,20 +628,95 @@ typedef Future>> RunTestFunction(TestData testData, Map> skipMap, Uri nullUri}); +class MarkerOptions { + final Map markers; + + MarkerOptions.internal(this.markers); + + factory MarkerOptions.fromFile(File file, {bool isUsingShards: false}) { + File script = new File.fromUri(Platform.script); + if (!file.existsSync()) { + throw new ArgumentError("Marker option file '$file' doesn't exist."); + } + + Map markers = {}; + String text = file.readAsStringSync(); + bool isScriptFound = false; + for (String line in text.split('\n')) { + line = line.trim(); + if (line.isEmpty || line.startsWith('#')) continue; + int eqPos = line.indexOf('='); + if (eqPos == -1) { + throw new ArgumentError( + "Unsupported marker option '$line' in ${file.uri}"); + } + String marker = line.substring(0, eqPos); + String tester = line.substring(eqPos + 1); + File testerFile = new File(tester); + if (!testerFile.existsSync()) { + throw new ArgumentError( + "Tester '$tester' does not exist for marker '$marker' in " + "${file.uri}"); + } + if (markers.containsKey(marker)) { + throw new ArgumentError("Duplicate marker '$marker' in ${file.uri}"); + } + markers[marker] = testerFile.uri; + if (testerFile.absolute.uri == script.absolute.uri) { + isScriptFound = true; + } + } + if (!isUsingShards && !isScriptFound) { + throw new ArgumentError( + "Script '${script.uri}' not found in ${file.uri}"); + } + return new MarkerOptions.internal(markers); + } + + Iterable get supportedMarkers => markers.keys; + + Future runAll(List args) async { + Set testers = markers.values.toSet(); + bool allOk = true; + for (Uri tester in testers) { + print('================================================================'); + print('Running tester: $tester ${args.join(' ')}'); + print('================================================================'); + Process process = await Process.start( + Platform.resolvedExecutable, [tester.toString(), ...args], + mode: ProcessStartMode.inheritStdio); + if (await process.exitCode != 0) { + allOk = false; + } + } + if (!allOk) { + throw "Error(s) occurred."; + } + } +} + /// Check code for all tests in [dataDir] using [runTest]. Future runTests(Directory dataDir, {List args: const [], int shards: 1, int shardIndex: 0, void onTest(Uri uri), - Iterable supportedMarkers, Uri createUriForFileName(String fileName), void onFailure(String message), RunTestFunction runTest, List skipList, Map> skipMap}) async { + File markerOptionsFile = + new File.fromUri(dataDir.uri.resolve('marker.options')); + MarkerOptions markerOptions = + new MarkerOptions.fromFile(markerOptionsFile, isUsingShards: shards != 1); // TODO(johnniwinther): Support --show to show actual data for an input. args = args.toList(); + bool runAll = args.remove('--run-all'); + if (runAll) { + await markerOptions.runAll(args); + return; + } bool verbose = args.remove('-v'); bool succinct = args.remove('-s'); bool shouldContinue = args.remove('-c'); @@ -653,8 +728,11 @@ Future runTests(Directory dataDir, String relativeDir = dataDir.uri.path.replaceAll(Uri.base.path, ''); print('Data dir: ${relativeDir}'); - List entities = - dataDir.listSync().where((entity) => !entity.path.endsWith('~')).toList(); + List entities = dataDir + .listSync() + .where((entity) => + !entity.path.endsWith('~') && !entity.path.endsWith('marker.options')) + .toList(); if (shards > 1) { int start = entities.length * shardIndex ~/ shards; int end = entities.length * (shardIndex + 1) ~/ shards; @@ -688,7 +766,7 @@ Future runTests(Directory dataDir, } TestData testData = computeTestData(entity, - supportedMarkers: supportedMarkers, + supportedMarkers: markerOptions.supportedMarkers, createTestUri: createTestUri, onFailure: onFailure); print('Test: ${testData.testFileUri}'); diff --git a/pkg/_fe_analyzer_shared/test/constants/data/marker.options b/pkg/_fe_analyzer_shared/test/constants/data/marker.options new file mode 100644 index 00000000000..f713e639acd --- /dev/null +++ b/pkg/_fe_analyzer_shared/test/constants/data/marker.options @@ -0,0 +1,3 @@ +cfe=pkg/front_end/test/id_tests/constant_test.dart +analyzer=pkg/analyzer/test/id_tests/constant_test.dart +dart2js=tests/compiler/dart2js/model/cfe_constant_test.dart \ No newline at end of file diff --git a/pkg/_fe_analyzer_shared/test/flow_analysis/assigned_variables/data/marker.options b/pkg/_fe_analyzer_shared/test/flow_analysis/assigned_variables/data/marker.options new file mode 100644 index 00000000000..fed573942aa --- /dev/null +++ b/pkg/_fe_analyzer_shared/test/flow_analysis/assigned_variables/data/marker.options @@ -0,0 +1,2 @@ +cfe=pkg/front_end/test/id_tests/assigned_variables_test.dart +analyzer=pkg/analyzer/test/id_tests/assigned_variables_test.dart \ No newline at end of file diff --git a/pkg/_fe_analyzer_shared/test/flow_analysis/definite_assignment/data/marker.options b/pkg/_fe_analyzer_shared/test/flow_analysis/definite_assignment/data/marker.options new file mode 100644 index 00000000000..22cc06da202 --- /dev/null +++ b/pkg/_fe_analyzer_shared/test/flow_analysis/definite_assignment/data/marker.options @@ -0,0 +1,2 @@ +cfe=pkg/front_end/test/id_tests/definite_assignment_test.dart +analyzer=pkg/analyzer/test/id_tests/definite_assignment_test.dart \ No newline at end of file diff --git a/pkg/_fe_analyzer_shared/test/flow_analysis/nullability/data/marker.options b/pkg/_fe_analyzer_shared/test/flow_analysis/nullability/data/marker.options new file mode 100644 index 00000000000..c6ca880b6f3 --- /dev/null +++ b/pkg/_fe_analyzer_shared/test/flow_analysis/nullability/data/marker.options @@ -0,0 +1,2 @@ +cfe=pkg/front_end/test/id_tests/nullability_test.dart +analyzer=pkg/analyzer/test/id_tests/nullability_test.dart \ No newline at end of file diff --git a/pkg/_fe_analyzer_shared/test/flow_analysis/reachability/data/marker.options b/pkg/_fe_analyzer_shared/test/flow_analysis/reachability/data/marker.options new file mode 100644 index 00000000000..f56ffa97a70 --- /dev/null +++ b/pkg/_fe_analyzer_shared/test/flow_analysis/reachability/data/marker.options @@ -0,0 +1,2 @@ +cfe=pkg/front_end/test/id_tests/reachability_test.dart +analyzer=pkg/analyzer/test/id_tests/reachability_test.dart \ No newline at end of file diff --git a/pkg/_fe_analyzer_shared/test/flow_analysis/type_promotion/data/marker.options b/pkg/_fe_analyzer_shared/test/flow_analysis/type_promotion/data/marker.options new file mode 100644 index 00000000000..7aaeae95bda --- /dev/null +++ b/pkg/_fe_analyzer_shared/test/flow_analysis/type_promotion/data/marker.options @@ -0,0 +1,2 @@ +cfe=pkg/front_end/test/id_tests/type_promotion_test.dart +analyzer=pkg/analyzer/test/id_tests/type_promotion_test.dart \ No newline at end of file diff --git a/pkg/_fe_analyzer_shared/test/inheritance/data/marker.options b/pkg/_fe_analyzer_shared/test/inheritance/data/marker.options new file mode 100644 index 00000000000..233b037e61b --- /dev/null +++ b/pkg/_fe_analyzer_shared/test/inheritance/data/marker.options @@ -0,0 +1,2 @@ +cfe=pkg/front_end/test/id_tests/inheritance_test.dart +cfe:builder=pkg/front_end/test/id_tests/inheritance_test.dart \ No newline at end of file diff --git a/pkg/analyzer/test/id_tests/assigned_variables_test.dart b/pkg/analyzer/test/id_tests/assigned_variables_test.dart index a46ec06d17c..9ac842cd1ce 100644 --- a/pkg/analyzer/test/id_tests/assigned_variables_test.dart +++ b/pkg/analyzer/test/id_tests/assigned_variables_test.dart @@ -23,7 +23,6 @@ main(List args) async { await NullSafetyUnderstandingFlag.enableNullSafetyTypes(() { return runTests<_Data>(dataDir, args: args, - supportedMarkers: cfeAnalyzerMarkers, createUriForFileName: createUriForFileName, onFailure: onFailure, runTest: runTestFor( diff --git a/pkg/analyzer/test/id_tests/constant_test.dart b/pkg/analyzer/test/id_tests/constant_test.dart index 5ea6df50449..e249afe2873 100644 --- a/pkg/analyzer/test/id_tests/constant_test.dart +++ b/pkg/analyzer/test/id_tests/constant_test.dart @@ -22,7 +22,6 @@ main(List args) async { await NullSafetyUnderstandingFlag.enableNullSafetyTypes(() { return runTests(dataDir, args: args, - supportedMarkers: sharedMarkers, createUriForFileName: createUriForFileName, onFailure: onFailure, runTest: runTestFor( diff --git a/pkg/analyzer/test/id_tests/definite_assignment_test.dart b/pkg/analyzer/test/id_tests/definite_assignment_test.dart index 999e039070f..929b8df0587 100644 --- a/pkg/analyzer/test/id_tests/definite_assignment_test.dart +++ b/pkg/analyzer/test/id_tests/definite_assignment_test.dart @@ -22,7 +22,6 @@ main(List args) async { await NullSafetyUnderstandingFlag.enableNullSafetyTypes(() { return runTests(dataDir, args: args, - supportedMarkers: cfeAnalyzerMarkers, createUriForFileName: createUriForFileName, onFailure: onFailure, runTest: runTestFor( diff --git a/pkg/analyzer/test/id_tests/nullability_test.dart b/pkg/analyzer/test/id_tests/nullability_test.dart index e15edc8c84a..4d9128a1228 100644 --- a/pkg/analyzer/test/id_tests/nullability_test.dart +++ b/pkg/analyzer/test/id_tests/nullability_test.dart @@ -25,7 +25,6 @@ main(List args) async { await NullSafetyUnderstandingFlag.enableNullSafetyTypes(() { return runTests(dataDir, args: args, - supportedMarkers: cfeAnalyzerMarkers, createUriForFileName: createUriForFileName, onFailure: onFailure, runTest: diff --git a/pkg/analyzer/test/id_tests/reachability_test.dart b/pkg/analyzer/test/id_tests/reachability_test.dart index 6b85af8d199..093d824bd5f 100644 --- a/pkg/analyzer/test/id_tests/reachability_test.dart +++ b/pkg/analyzer/test/id_tests/reachability_test.dart @@ -22,7 +22,6 @@ main(List args) async { await NullSafetyUnderstandingFlag.enableNullSafetyTypes(() { return runTests>(dataDir, args: args, - supportedMarkers: cfeAnalyzerMarkers, createUriForFileName: createUriForFileName, onFailure: onFailure, runTest: runTestFor( diff --git a/pkg/analyzer/test/id_tests/type_promotion_test.dart b/pkg/analyzer/test/id_tests/type_promotion_test.dart index 617f906f57c..4e7705a1b20 100644 --- a/pkg/analyzer/test/id_tests/type_promotion_test.dart +++ b/pkg/analyzer/test/id_tests/type_promotion_test.dart @@ -23,7 +23,6 @@ main(List args) async { await NullSafetyUnderstandingFlag.enableNullSafetyTypes(() { return runTests(dataDir, args: args, - supportedMarkers: sharedMarkers, createUriForFileName: createUriForFileName, onFailure: onFailure, runTest: runTestFor( diff --git a/pkg/analyzer/test/util/id_testing_helper.dart b/pkg/analyzer/test/util/id_testing_helper.dart index 6058bbfe762..1944306a8f4 100644 --- a/pkg/analyzer/test/util/id_testing_helper.dart +++ b/pkg/analyzer/test/util/id_testing_helper.dart @@ -82,6 +82,13 @@ Future>> runTest(TestData testData, Iterable globalIds = const [], void Function(String message) onFailure, Map> skipMap}) async { + for (TestConfig config in testedConfigs) { + if (!testData.expectedMaps.containsKey(config.marker)) { + throw ArgumentError("Unexpected test marker '${config.marker}'. " + "Supported markers: ${testData.expectedMaps.keys}."); + } + } + Map> results = {}; for (TestConfig config in testedConfigs) { if (skipForConfig(testData.name, config.marker, skipMap)) { diff --git a/pkg/front_end/lib/src/testing/id_testing_helper.dart b/pkg/front_end/lib/src/testing/id_testing_helper.dart index f1ccd163241..17be13759e8 100644 --- a/pkg/front_end/lib/src/testing/id_testing_helper.dart +++ b/pkg/front_end/lib/src/testing/id_testing_helper.dart @@ -235,6 +235,13 @@ Future>> runTest(TestData testData, void onFailure(String message), Map> skipMap, Uri nullUri}) async { + for (TestConfig config in testedConfigs) { + if (!testData.expectedMaps.containsKey(config.marker)) { + throw new ArgumentError("Unexpected test marker '${config.marker}'. " + "Supported markers: ${testData.expectedMaps.keys}."); + } + } + Map> results = {}; for (TestConfig config in testedConfigs) { if (skipForConfig(testData.name, config.marker, skipMap)) { diff --git a/pkg/front_end/test/covariance_check/covariance_check_test.dart b/pkg/front_end/test/covariance_check/covariance_check_test.dart index 397169f18bf..99dcbbca703 100644 --- a/pkg/front_end/test/covariance_check/covariance_check_test.dart +++ b/pkg/front_end/test/covariance_check/covariance_check_test.dart @@ -15,7 +15,6 @@ main(List args) async { Directory dataDir = new Directory.fromUri(Platform.script.resolve('data')); await runTests(dataDir, args: args, - supportedMarkers: [cfeMarker], createUriForFileName: createUriForFileName, onFailure: onFailure, runTest: diff --git a/pkg/front_end/test/covariance_check/data/marker.options b/pkg/front_end/test/covariance_check/data/marker.options new file mode 100644 index 00000000000..b2053bac00b --- /dev/null +++ b/pkg/front_end/test/covariance_check/data/marker.options @@ -0,0 +1 @@ +cfe=pkg/front_end/test/covariance_check/covariance_check_test.dart \ No newline at end of file diff --git a/pkg/front_end/test/extensions/data/marker.options b/pkg/front_end/test/extensions/data/marker.options new file mode 100644 index 00000000000..a6b109485f6 --- /dev/null +++ b/pkg/front_end/test/extensions/data/marker.options @@ -0,0 +1 @@ +cfe=pkg/front_end/test/extensions/extensions_test.dart diff --git a/pkg/front_end/test/extensions/extensions_test.dart b/pkg/front_end/test/extensions/extensions_test.dart index f4b0f2e8cef..27e21fcb66b 100644 --- a/pkg/front_end/test/extensions/extensions_test.dart +++ b/pkg/front_end/test/extensions/extensions_test.dart @@ -24,7 +24,6 @@ main(List args) async { Directory dataDir = new Directory.fromUri(Platform.script.resolve('data')); await runTests(dataDir, args: args, - supportedMarkers: [cfeMarker], createUriForFileName: createUriForFileName, onFailure: onFailure, runTest: runTestFor(const ExtensionsDataComputer(), [ diff --git a/pkg/front_end/test/id_testing/data/marker.options b/pkg/front_end/test/id_testing/data/marker.options new file mode 100644 index 00000000000..bb35ae52765 --- /dev/null +++ b/pkg/front_end/test/id_testing/data/marker.options @@ -0,0 +1,2 @@ +cfe=pkg/front_end/test/id_testing/id_testing_test.dart +dart2js=tests/compiler/dart2js/equivalence/id_testing_test.dart diff --git a/pkg/front_end/test/id_testing/id_testing_test.dart b/pkg/front_end/test/id_testing/id_testing_test.dart index 248223c812f..6de53f551ff 100644 --- a/pkg/front_end/test/id_testing/id_testing_test.dart +++ b/pkg/front_end/test/id_testing/id_testing_test.dart @@ -32,7 +32,6 @@ main(List args) async { Directory dataDir = new Directory.fromUri(Platform.script.resolve('data')); await runTests(dataDir, args: args, - supportedMarkers: [cfeMarker, dart2jsMarker], createUriForFileName: createUriForFileName, onFailure: onFailure, runTest: runTestFor(const IdTestingDataComputer(), [defaultCfeConfig])); diff --git a/pkg/front_end/test/id_tests/assigned_variables_test.dart b/pkg/front_end/test/id_tests/assigned_variables_test.dart index 31fe46c1fc9..cdff0ce1a3c 100644 --- a/pkg/front_end/test/id_tests/assigned_variables_test.dart +++ b/pkg/front_end/test/id_tests/assigned_variables_test.dart @@ -23,7 +23,6 @@ main(List args) async { 'data')); await runTests<_Data>(dataDir, args: args, - supportedMarkers: cfeAnalyzerMarkers, createUriForFileName: createUriForFileName, onFailure: onFailure, runTest: runTestFor<_Data>( diff --git a/pkg/front_end/test/id_tests/constant_test.dart b/pkg/front_end/test/id_tests/constant_test.dart index 7c83a4092b1..8de3c2e4855 100644 --- a/pkg/front_end/test/id_tests/constant_test.dart +++ b/pkg/front_end/test/id_tests/constant_test.dart @@ -27,7 +27,6 @@ main(List args) async { .resolve('../../../_fe_analyzer_shared/test/constants/data')); await runTests(dataDir, args: args, - supportedMarkers: sharedMarkers, createUriForFileName: createUriForFileName, onFailure: onFailure, runTest: runTestFor(const ConstantsDataComputer(), [defaultCfeConfig])); diff --git a/pkg/front_end/test/id_tests/definite_assignment_test.dart b/pkg/front_end/test/id_tests/definite_assignment_test.dart index 3a69242834b..02067af6a5d 100644 --- a/pkg/front_end/test/id_tests/definite_assignment_test.dart +++ b/pkg/front_end/test/id_tests/definite_assignment_test.dart @@ -20,7 +20,6 @@ main(List args) async { 'data')); await runTests(dataDir, args: args, - supportedMarkers: cfeAnalyzerMarkers, createUriForFileName: createUriForFileName, onFailure: onFailure, runTest: runTestFor( diff --git a/pkg/front_end/test/id_tests/inheritance_test.dart b/pkg/front_end/test/id_tests/inheritance_test.dart index 98389b7aade..b9d421fa2f9 100644 --- a/pkg/front_end/test/id_tests/inheritance_test.dart +++ b/pkg/front_end/test/id_tests/inheritance_test.dart @@ -20,7 +20,6 @@ main(List args) async { .resolve('../../../_fe_analyzer_shared/test/inheritance/data')); await runTests(dataDir, args: args, - supportedMarkers: [cfeMarker, cfeFromBuilderMarker], createUriForFileName: createUriForFileName, onFailure: onFailure, runTest: runTestFor(const InheritanceDataComputer(), [ diff --git a/pkg/front_end/test/id_tests/nullability_test.dart b/pkg/front_end/test/id_tests/nullability_test.dart index b22dd52c93b..7b1e6039866 100644 --- a/pkg/front_end/test/id_tests/nullability_test.dart +++ b/pkg/front_end/test/id_tests/nullability_test.dart @@ -15,7 +15,6 @@ main(List args) async { '../../../_fe_analyzer_shared/test/flow_analysis/nullability/data')); await runTests(dataDir, args: args, - supportedMarkers: cfeAnalyzerMarkers, createUriForFileName: createUriForFileName, onFailure: onFailure, runTest: runTestFor( diff --git a/pkg/front_end/test/id_tests/reachability_test.dart b/pkg/front_end/test/id_tests/reachability_test.dart index 442be6cb212..6c469facdf4 100644 --- a/pkg/front_end/test/id_tests/reachability_test.dart +++ b/pkg/front_end/test/id_tests/reachability_test.dart @@ -19,7 +19,6 @@ main(List args) async { '../../../_fe_analyzer_shared/test/flow_analysis/reachability/data')); await runTests>(dataDir, args: args, - supportedMarkers: cfeAnalyzerMarkers, createUriForFileName: createUriForFileName, onFailure: onFailure, runTest: runTestFor( diff --git a/pkg/front_end/test/id_tests/type_promotion_test.dart b/pkg/front_end/test/id_tests/type_promotion_test.dart index 5d643527f52..d5a89b0dc83 100644 --- a/pkg/front_end/test/id_tests/type_promotion_test.dart +++ b/pkg/front_end/test/id_tests/type_promotion_test.dart @@ -17,7 +17,6 @@ main(List args) async { 'data')); await runTests(dataDir, args: args, - supportedMarkers: cfeAnalyzerMarkers, createUriForFileName: createUriForFileName, onFailure: onFailure, runTest: runTestFor( diff --git a/pkg/front_end/test/language_versioning/data/marker.options b/pkg/front_end/test/language_versioning/data/marker.options new file mode 100644 index 00000000000..0b24526b226 --- /dev/null +++ b/pkg/front_end/test/language_versioning/data/marker.options @@ -0,0 +1 @@ +cfe=pkg/front_end/test/language_versioning/language_versioning_test.dart diff --git a/pkg/front_end/test/language_versioning/language_versioning_test.dart b/pkg/front_end/test/language_versioning/language_versioning_test.dart index 7833f209b88..8b4b12bb748 100644 --- a/pkg/front_end/test/language_versioning/language_versioning_test.dart +++ b/pkg/front_end/test/language_versioning/language_versioning_test.dart @@ -29,7 +29,6 @@ main(List args) async { Directory dataDir = new Directory.fromUri(Platform.script.resolve('data')); await runTests(dataDir, args: args, - supportedMarkers: [cfeMarker], createUriForFileName: createUriForFileName, onFailure: onFailure, runTest: runTestFor(const LanguageVersioningDataComputer(), [cfeConfig]), diff --git a/pkg/front_end/test/patching/data/marker.options b/pkg/front_end/test/patching/data/marker.options new file mode 100644 index 00000000000..3811799a467 --- /dev/null +++ b/pkg/front_end/test/patching/data/marker.options @@ -0,0 +1,2 @@ +cfe=pkg/front_end/test/patching/patching_test.dart +cfe:nnbd=pkg/front_end/test/patching/patching_test.dart diff --git a/pkg/front_end/test/patching/patching_test.dart b/pkg/front_end/test/patching/patching_test.dart index 956206842f9..5e9b0a4a3f1 100644 --- a/pkg/front_end/test/patching/patching_test.dart +++ b/pkg/front_end/test/patching/patching_test.dart @@ -22,7 +22,6 @@ main(List args) async { Directory dataDir = new Directory.fromUri(Platform.script.resolve('data')); await runTests(dataDir, args: args, - supportedMarkers: [cfeMarker, cfeWithNnbdMarker], createUriForFileName: createUriForFileName, onFailure: onFailure, runTest: runTestFor(const PatchingDataComputer(), [ diff --git a/pkg/front_end/test/spell_checking_list_code.txt b/pkg/front_end/test/spell_checking_list_code.txt index cc5c7df1934..fbc9c46d1f4 100644 --- a/pkg/front_end/test/spell_checking_list_code.txt +++ b/pkg/front_end/test/spell_checking_list_code.txt @@ -949,6 +949,7 @@ stale statics stderr stdin +stdio stdout stmt str @@ -1015,6 +1016,7 @@ termcap terminator test tester +testers testing tex tflite diff --git a/pkg/front_end/test/static_types/data/marker.options b/pkg/front_end/test/static_types/data/marker.options new file mode 100644 index 00000000000..b28ef481a4e --- /dev/null +++ b/pkg/front_end/test/static_types/data/marker.options @@ -0,0 +1,2 @@ +cfe=pkg/front_end/test/static_types/static_type_test.dart +cfe:nnbd=pkg/front_end/test/static_types/static_type_test.dart diff --git a/pkg/front_end/test/static_types/static_type_test.dart b/pkg/front_end/test/static_types/static_type_test.dart index 3f64311ffa2..0c97378a48c 100644 --- a/pkg/front_end/test/static_types/static_type_test.dart +++ b/pkg/front_end/test/static_types/static_type_test.dart @@ -17,7 +17,6 @@ main(List args) async { Directory dataDir = new Directory.fromUri(Platform.script.resolve('data')); await runTests(dataDir, args: args, - supportedMarkers: cfeMarkersWithNnbd, createUriForFileName: createUriForFileName, onFailure: onFailure, runTest: runTestFor(const StaticTypeDataComputer(), diff --git a/tests/compiler/dart2js/annotations/data/marker.options b/tests/compiler/dart2js/annotations/data/marker.options new file mode 100644 index 00000000000..730d5c78437 --- /dev/null +++ b/tests/compiler/dart2js/annotations/data/marker.options @@ -0,0 +1,2 @@ +strong=tests/compiler/dart2js/annotations/annotations_test.dart +omit=tests/compiler/dart2js/annotations/annotations_test.dart \ No newline at end of file diff --git a/tests/compiler/dart2js/closure/data/marker.options b/tests/compiler/dart2js/closure/data/marker.options new file mode 100644 index 00000000000..f2978278a40 --- /dev/null +++ b/tests/compiler/dart2js/closure/data/marker.options @@ -0,0 +1,2 @@ +strong=tests/compiler/dart2js/closure/closure_test.dart +omit=tests/compiler/dart2js/closure/closure_test.dart \ No newline at end of file diff --git a/tests/compiler/dart2js/codegen/model_data/marker.options b/tests/compiler/dart2js/codegen/model_data/marker.options new file mode 100644 index 00000000000..f7d45f73bd2 --- /dev/null +++ b/tests/compiler/dart2js/codegen/model_data/marker.options @@ -0,0 +1,2 @@ +strong=tests/compiler/dart2js/codegen/model_test.dart +omit=tests/compiler/dart2js/codegen/model_test.dart \ No newline at end of file diff --git a/tests/compiler/dart2js/deferred_loading/data/marker.options b/tests/compiler/dart2js/deferred_loading/data/marker.options new file mode 100644 index 00000000000..94f06365ca0 --- /dev/null +++ b/tests/compiler/dart2js/deferred_loading/data/marker.options @@ -0,0 +1 @@ +strong=tests/compiler/dart2js/deferred_loading/deferred_loading_test.dart \ No newline at end of file diff --git a/tests/compiler/dart2js/deferred_loading/deferred_loading_test.dart b/tests/compiler/dart2js/deferred_loading/deferred_loading_test.dart index 4f3e3d17fef..2a1c31c02d8 100644 --- a/tests/compiler/dart2js/deferred_loading/deferred_loading_test.dart +++ b/tests/compiler/dart2js/deferred_loading/deferred_loading_test.dart @@ -34,7 +34,7 @@ main(List args) { await checkTests(dataDir, const OutputUnitDataComputer(), options: compilerOptions, args: args, - supportedMarkers: [strongMarker], setUpFunction: () { + setUpFunction: () { importPrefixes.clear(); }, testedConfigs: allStrongConfigs); }); diff --git a/tests/compiler/dart2js/equivalence/id_equivalence_helper.dart b/tests/compiler/dart2js/equivalence/id_equivalence_helper.dart index fc8f5ecf118..341dd6ee5ea 100644 --- a/tests/compiler/dart2js/equivalence/id_equivalence_helper.dart +++ b/tests/compiler/dart2js/equivalence/id_equivalence_helper.dart @@ -398,7 +398,6 @@ Future checkTests(Directory dataDir, DataComputer dataComputer, int shards: 1, int shardIndex: 0, void onTest(Uri uri), - Iterable supportedMarkers = allInternalMarkers, List testedConfigs = defaultInternalConfigs}) async { Set testedMarkers = testedConfigs.map((config) => config.marker).toSet(); @@ -406,12 +405,6 @@ Future checkTests(Directory dataDir, DataComputer dataComputer, testedConfigs.length == testedMarkers.length, "Unexpected test markers $testedMarkers. " "Tested configs: $testedConfigs."); - Iterable unknownMarkers = - testedMarkers.where((marker) => !supportedMarkers.contains(marker)); - Expect.isTrue( - unknownMarkers.isEmpty, - "Unexpected test markers $unknownMarkers. " - "Supported markers: $supportedMarkers."); dataComputer.setup(); @@ -422,6 +415,13 @@ Future checkTests(Directory dataDir, DataComputer dataComputer, bool printCode, Map> skipMap, Uri nullUri}) async { + for (TestConfig testConfiguration in testedConfigs) { + Expect.isTrue( + testData.expectedMaps.containsKey(testConfiguration.marker), + "Unexpected test marker '${testConfiguration.marker}'. " + "Supported markers: ${testData.expectedMaps.keys}."); + } + String name = testData.name; List testOptions = options.toList(); if (name.endsWith('_ea.dart')) { @@ -457,7 +457,6 @@ Future checkTests(Directory dataDir, DataComputer dataComputer, shards: shards, shardIndex: shardIndex, onTest: onTest, - supportedMarkers: supportedMarkers, createUriForFileName: createUriForFileName, onFailure: Expect.fail, runTest: checkTest); diff --git a/tests/compiler/dart2js/equivalence/id_testing_test.dart b/tests/compiler/dart2js/equivalence/id_testing_test.dart index 644fb642c08..e8c40228ba7 100644 --- a/tests/compiler/dart2js/equivalence/id_testing_test.dart +++ b/tests/compiler/dart2js/equivalence/id_testing_test.dart @@ -24,9 +24,7 @@ main(List args) { Directory dataDir = new Directory.fromUri(Platform.script .resolve('../../../../pkg/front_end/test/id_testing/data')); await checkTests(dataDir, new IdTestingDataComputer(), - args: args, - testedConfigs: [sharedConfig], - supportedMarkers: [cfeMarker, dart2jsMarker]); + args: args, testedConfigs: [sharedConfig]); }); } diff --git a/tests/compiler/dart2js/field_analysis/jdata/marker.options b/tests/compiler/dart2js/field_analysis/jdata/marker.options new file mode 100644 index 00000000000..e9de6cf7f04 --- /dev/null +++ b/tests/compiler/dart2js/field_analysis/jdata/marker.options @@ -0,0 +1,2 @@ +strong=tests/compiler/dart2js/field_analysis/jfield_analysis_test.dart +omit=tests/compiler/dart2js/field_analysis/jfield_analysis_test.dart \ No newline at end of file diff --git a/tests/compiler/dart2js/field_analysis/kdata/marker.options b/tests/compiler/dart2js/field_analysis/kdata/marker.options new file mode 100644 index 00000000000..16bd06478d8 --- /dev/null +++ b/tests/compiler/dart2js/field_analysis/kdata/marker.options @@ -0,0 +1,2 @@ +strong=tests/compiler/dart2js/field_analysis/kfield_analysis_test.dart +omit=tests/compiler/dart2js/field_analysis/kfield_analysis_test.dart \ No newline at end of file diff --git a/tests/compiler/dart2js/impact/data/marker.options b/tests/compiler/dart2js/impact/data/marker.options new file mode 100644 index 00000000000..f001ac82506 --- /dev/null +++ b/tests/compiler/dart2js/impact/data/marker.options @@ -0,0 +1 @@ +strong=tests/compiler/dart2js/impact/impact_test.dart \ No newline at end of file diff --git a/tests/compiler/dart2js/impact/impact_test.dart b/tests/compiler/dart2js/impact/impact_test.dart index b1d9e3d531c..09a15660779 100644 --- a/tests/compiler/dart2js/impact/impact_test.dart +++ b/tests/compiler/dart2js/impact/impact_test.dart @@ -24,7 +24,6 @@ main(List args) { useImpactDataForTesting = false; await checkTests(dataDir, const ImpactDataComputer(), args: args, - supportedMarkers: [strongMarker], testedConfigs: [strongConfig]); print('Testing computation of ResolutionImpact through ImpactData'); @@ -32,7 +31,6 @@ main(List args) { useImpactDataForTesting = true; await checkTests(dataDir, const ImpactDataComputer(), args: args, - supportedMarkers: [strongMarker], testedConfigs: [strongConfig]); }); } diff --git a/tests/compiler/dart2js/inference/callers/marker.options b/tests/compiler/dart2js/inference/callers/marker.options new file mode 100644 index 00000000000..10b39a718f8 --- /dev/null +++ b/tests/compiler/dart2js/inference/callers/marker.options @@ -0,0 +1,2 @@ +strong=tests/compiler/dart2js/inference/callers_test.dart +omit=tests/compiler/dart2js/inference/callers_test.dart \ No newline at end of file diff --git a/tests/compiler/dart2js/inference/data/marker.options b/tests/compiler/dart2js/inference/data/marker.options new file mode 100644 index 00000000000..ed13f4291a8 --- /dev/null +++ b/tests/compiler/dart2js/inference/data/marker.options @@ -0,0 +1,2 @@ +strong=tests/compiler/dart2js/inference/inference_test_helper.dart +omit=tests/compiler/dart2js/inference/inference_test_helper.dart \ No newline at end of file diff --git a/tests/compiler/dart2js/inference/inference_data/marker.options b/tests/compiler/dart2js/inference/inference_data/marker.options new file mode 100644 index 00000000000..c90afd3cbdc --- /dev/null +++ b/tests/compiler/dart2js/inference/inference_data/marker.options @@ -0,0 +1 @@ +strong=tests/compiler/dart2js/inference/inference_data_test.dart diff --git a/tests/compiler/dart2js/inference/inference_data_test.dart b/tests/compiler/dart2js/inference/inference_data_test.dart index c9aad1d300b..e89e33e3cd9 100644 --- a/tests/compiler/dart2js/inference/inference_data_test.dart +++ b/tests/compiler/dart2js/inference/inference_data_test.dart @@ -24,7 +24,6 @@ main(List args) { await checkTests(dataDir, const InferenceDataComputer(), args: args, testedConfigs: [strongConfig], - supportedMarkers: [strongMarker], options: [stopAfterTypeInference]); }); } diff --git a/tests/compiler/dart2js/inference/side_effects/marker.options b/tests/compiler/dart2js/inference/side_effects/marker.options new file mode 100644 index 00000000000..03ae8ceefb5 --- /dev/null +++ b/tests/compiler/dart2js/inference/side_effects/marker.options @@ -0,0 +1,2 @@ +strong=tests/compiler/dart2js/inference/side_effects_test.dart +omit=tests/compiler/dart2js/inference/side_effects_test.dart \ No newline at end of file diff --git a/tests/compiler/dart2js/inlining/data/marker.options b/tests/compiler/dart2js/inlining/data/marker.options new file mode 100644 index 00000000000..4750f8f6d79 --- /dev/null +++ b/tests/compiler/dart2js/inlining/data/marker.options @@ -0,0 +1,2 @@ +strong=tests/compiler/dart2js/inlining/inlining_test.dart +omit=tests/compiler/dart2js/inlining/inlining_test.dart \ No newline at end of file diff --git a/tests/compiler/dart2js/jumps/data/marker.options b/tests/compiler/dart2js/jumps/data/marker.options new file mode 100644 index 00000000000..37aec9d66e6 --- /dev/null +++ b/tests/compiler/dart2js/jumps/data/marker.options @@ -0,0 +1,2 @@ +strong=tests/compiler/dart2js/jumps/jump_test.dart +omit=tests/compiler/dart2js/jumps/jump_test.dart \ No newline at end of file diff --git a/tests/compiler/dart2js/member_usage/data/marker.options b/tests/compiler/dart2js/member_usage/data/marker.options new file mode 100644 index 00000000000..91b789de3d5 --- /dev/null +++ b/tests/compiler/dart2js/member_usage/data/marker.options @@ -0,0 +1,2 @@ +strong=tests/compiler/dart2js/member_usage/member_usage_test.dart +omit=tests/compiler/dart2js/member_usage/member_usage_test.dart \ No newline at end of file diff --git a/tests/compiler/dart2js/model/cfe_constant_test.dart b/tests/compiler/dart2js/model/cfe_constant_test.dart index 3f522df816f..34309888fc6 100644 --- a/tests/compiler/dart2js/model/cfe_constant_test.dart +++ b/tests/compiler/dart2js/model/cfe_constant_test.dart @@ -25,8 +25,7 @@ main(List args) { .resolve('../../../../pkg/_fe_analyzer_shared/test/constants/data')); await checkTests(dataDir, new ConstantDataComputer(), args: args, - testedConfigs: [sharedConfig], - supportedMarkers: sharedMarkers); + testedConfigs: [sharedConfig]); }); } diff --git a/tests/compiler/dart2js/optimization/data/marker.options b/tests/compiler/dart2js/optimization/data/marker.options new file mode 100644 index 00000000000..3b03def5bef --- /dev/null +++ b/tests/compiler/dart2js/optimization/data/marker.options @@ -0,0 +1,2 @@ +strong=tests/compiler/dart2js/optimization/optimization_test.dart +omit=tests/compiler/dart2js/optimization/optimization_test.dart \ No newline at end of file diff --git a/tests/compiler/dart2js/rti/data/marker.options b/tests/compiler/dart2js/rti/data/marker.options new file mode 100644 index 00000000000..b77684b3cde --- /dev/null +++ b/tests/compiler/dart2js/rti/data/marker.options @@ -0,0 +1,2 @@ +strong=tests/compiler/dart2js/rti/rti_need_test_helper.dart +omit=tests/compiler/dart2js/rti/rti_need_test_helper.dart \ No newline at end of file diff --git a/tests/compiler/dart2js/rti/emission/marker.options b/tests/compiler/dart2js/rti/emission/marker.options new file mode 100644 index 00000000000..bc690575255 --- /dev/null +++ b/tests/compiler/dart2js/rti/emission/marker.options @@ -0,0 +1,2 @@ +strong=tests/compiler/dart2js/rti/rti_emission_test.dart +omit=tests/compiler/dart2js/rti/rti_emission_test.dart \ No newline at end of file diff --git a/tests/compiler/dart2js/static_type/data/marker.options b/tests/compiler/dart2js/static_type/data/marker.options new file mode 100644 index 00000000000..95c2117f8c1 --- /dev/null +++ b/tests/compiler/dart2js/static_type/data/marker.options @@ -0,0 +1,2 @@ +strong=tests/compiler/dart2js/static_type/static_type_test.dart +omit=tests/compiler/dart2js/static_type/static_type_test.dart \ No newline at end of file diff --git a/tests/compiler/dart2js/static_type/type_promotion_data/marker.options b/tests/compiler/dart2js/static_type/type_promotion_data/marker.options new file mode 100644 index 00000000000..c280594721c --- /dev/null +++ b/tests/compiler/dart2js/static_type/type_promotion_data/marker.options @@ -0,0 +1,2 @@ +strong=tests/compiler/dart2js/static_type/type_promotion_test.dart +omit=tests/compiler/dart2js/static_type/type_promotion_test.dart \ No newline at end of file diff --git a/tools/bots/test_matrix.json b/tools/bots/test_matrix.json index 22ecbdb662b..2844a36eb4e 100644 --- a/tools/bots/test_matrix.json +++ b/tools/bots/test_matrix.json @@ -11,6 +11,7 @@ "analyzer_unit_tests": [ ".packages", "pkg/", + "tests/compiler/dart2js/", "third_party/pkg/", "third_party/pkg_tested/", "tools/",