[cfe+dart2js+analyzer] Remove support for libs in id testing
We now have support for a test as a directory instead. Change-Id: I3c43e2e57ecda8e3c9d97aa8842be7093c1df5ab Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113035 Reviewed-by: Jens Johansen <jensj@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
committed by
commit-bot@chromium.org
parent
7551b9cee3
commit
024052f367
@@ -56,16 +56,15 @@ Future<bool> checkTests<T>(
|
||||
computeExpectedMap(testFileUri, testFileName, code, expectedMaps,
|
||||
onFailure: onFailure);
|
||||
Map<Uri, AnnotatedCode> codeMap = {testFileUri: code};
|
||||
var libFileNames = <String>[];
|
||||
var testData = TestData(testFileUri, testFileUri, memorySourceFiles, codeMap,
|
||||
expectedMaps, libFileNames);
|
||||
var testData = TestData(testFileName, testFileUri, testFileUri,
|
||||
memorySourceFiles, codeMap, expectedMaps);
|
||||
var config =
|
||||
TestConfig(marker, 'provisional test config', featureSet: featureSet);
|
||||
return runTestForConfig<T>(testData, dataComputer, config);
|
||||
}
|
||||
|
||||
/// Creates the testing URI used for [fileName] in annotated tests.
|
||||
Uri createUriForFileName(String fileName, {bool isLib}) => _toTestUri(fileName);
|
||||
Uri createUriForFileName(String fileName) => _toTestUri(fileName);
|
||||
|
||||
void onFailure(String message) {
|
||||
throw StateError(message);
|
||||
|
||||
@@ -167,8 +167,24 @@ abstract class DataExtractor<T> extends Visitor with DataRegistry<T> {
|
||||
}
|
||||
|
||||
@override
|
||||
defaultMember(Member node) {
|
||||
super.defaultMember(node);
|
||||
visitProcedure(Procedure node) {
|
||||
// Avoid visiting annotations.
|
||||
node.function.accept(this);
|
||||
computeForMember(node);
|
||||
}
|
||||
|
||||
@override
|
||||
visitConstructor(Constructor node) {
|
||||
// Avoid visiting annotations.
|
||||
visitList(node.initializers, this);
|
||||
node.function.accept(this);
|
||||
computeForMember(node);
|
||||
}
|
||||
|
||||
@override
|
||||
visitField(Field node) {
|
||||
// Avoid visiting annotations.
|
||||
node.initializer?.accept(this);
|
||||
computeForMember(node);
|
||||
}
|
||||
|
||||
@@ -213,7 +229,8 @@ abstract class DataExtractor<T> extends Visitor with DataRegistry<T> {
|
||||
// Skip synthetic variables and function declaration variables.
|
||||
computeForNode(node, computeDefaultNodeId(node));
|
||||
}
|
||||
super.visitVariableDeclaration(node);
|
||||
// Avoid visiting annotations.
|
||||
node.initializer?.accept(this);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -189,17 +189,21 @@ void computeExpectedMap(Uri sourceUri, String filename, AnnotatedCode code,
|
||||
///
|
||||
/// If [testLibDirectory] is not `null`, files in [testLibDirectory] with the
|
||||
/// [testFile] name as a prefix are included.
|
||||
TestData computeTestData(FileSystemEntity testFile, Directory testLibDirectory,
|
||||
TestData computeTestData(FileSystemEntity testFile,
|
||||
{Iterable<String> supportedMarkers,
|
||||
Uri createUriForFileName(String fileName, {bool isLib}),
|
||||
Uri createUriForFileName(String fileName),
|
||||
void onFailure(String message)}) {
|
||||
Uri entryPoint = createUriForFileName('main.dart', isLib: false);
|
||||
Uri entryPoint = createUriForFileName('main.dart');
|
||||
|
||||
String testName;
|
||||
File mainTestFile;
|
||||
Uri testFileUri = testFile.uri;
|
||||
Map<String, File> additionalFiles;
|
||||
if (testFile is File) {
|
||||
testName = testFileUri.pathSegments.last;
|
||||
mainTestFile = testFile;
|
||||
} else if (testFile is Directory) {
|
||||
testName = testFileUri.pathSegments[testFileUri.pathSegments.length - 2];
|
||||
additionalFiles = new Map<String, File>();
|
||||
for (FileSystemEntity entry in testFile.listSync(recursive: true)) {
|
||||
if (entry is! File) continue;
|
||||
@@ -228,55 +232,37 @@ TestData computeTestData(FileSystemEntity testFile, Directory testLibDirectory,
|
||||
entryPoint.path: code[entryPoint].sourceCode
|
||||
};
|
||||
|
||||
List<String> libFileNames;
|
||||
|
||||
addSupportingFile(String libFileName, File libEntity, bool isLib) {
|
||||
libFileNames ??= [];
|
||||
libFileNames.add(libFileName);
|
||||
Uri libFileUri = createUriForFileName(libFileName, isLib: isLib);
|
||||
String libCode = libEntity.readAsStringSync();
|
||||
AnnotatedCode annotatedLibCode =
|
||||
new AnnotatedCode.fromText(libCode, commentStart, commentEnd);
|
||||
memorySourceFiles[libFileUri.path] = annotatedLibCode.sourceCode;
|
||||
code[libFileUri] = annotatedLibCode;
|
||||
computeExpectedMap(libFileUri, libFileName, annotatedLibCode, expectedMaps,
|
||||
onFailure: onFailure);
|
||||
}
|
||||
|
||||
if (testLibDirectory != null) {
|
||||
String name = testFile.uri.pathSegments.last;
|
||||
String filePrefix = name.substring(0, name.lastIndexOf('.'));
|
||||
for (FileSystemEntity libEntity in testLibDirectory.listSync()) {
|
||||
String libFileName = libEntity.uri.pathSegments.last;
|
||||
if (libFileName.startsWith(filePrefix)) {
|
||||
addSupportingFile(libFileName, libEntity, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (additionalFiles != null) {
|
||||
for (MapEntry<String, File> additionalFileData in additionalFiles.entries) {
|
||||
addSupportingFile(
|
||||
additionalFileData.key, additionalFileData.value, false);
|
||||
String libFileName = additionalFileData.key;
|
||||
File libEntity = additionalFileData.value;
|
||||
Uri libFileUri = createUriForFileName(libFileName);
|
||||
String libCode = libEntity.readAsStringSync();
|
||||
AnnotatedCode annotatedLibCode =
|
||||
new AnnotatedCode.fromText(libCode, commentStart, commentEnd);
|
||||
memorySourceFiles[libFileUri.path] = annotatedLibCode.sourceCode;
|
||||
code[libFileUri] = annotatedLibCode;
|
||||
computeExpectedMap(
|
||||
libFileUri, libFileName, annotatedLibCode, expectedMaps,
|
||||
onFailure: onFailure);
|
||||
}
|
||||
}
|
||||
|
||||
return new TestData(testFile.uri, entryPoint, memorySourceFiles, code,
|
||||
expectedMaps, libFileNames);
|
||||
return new TestData(
|
||||
testName, testFileUri, entryPoint, memorySourceFiles, code, expectedMaps);
|
||||
}
|
||||
|
||||
/// Data for an annotated test.
|
||||
class TestData {
|
||||
final String name;
|
||||
final Uri testFileUri;
|
||||
final Uri entryPoint;
|
||||
final Map<String, String> memorySourceFiles;
|
||||
final Map<Uri, AnnotatedCode> code;
|
||||
final Map<String, MemberAnnotations<IdValue>> expectedMaps;
|
||||
final List<String> libFileNames;
|
||||
|
||||
TestData(this.testFileUri, this.entryPoint, this.memorySourceFiles, this.code,
|
||||
this.expectedMaps, this.libFileNames);
|
||||
|
||||
String get name => testFileUri.pathSegments.last;
|
||||
TestData(this.name, this.testFileUri, this.entryPoint, this.memorySourceFiles,
|
||||
this.code, this.expectedMaps);
|
||||
}
|
||||
|
||||
/// The actual result computed for an annotated test.
|
||||
@@ -594,24 +580,14 @@ Future<bool> checkCode<T>(
|
||||
typedef Future<bool> RunTestFunction(TestData testData,
|
||||
{bool testAfterFailures, bool verbose, bool succinct, bool printCode});
|
||||
|
||||
/// Check code for all test files int [data] using [computeFromAst] and
|
||||
/// [computeFromKernel] from the respective front ends. If [skipForKernel]
|
||||
/// contains the name of the test file it isn't tested for kernel.
|
||||
///
|
||||
/// [libDirectory] contains the directory for any supporting libraries that need
|
||||
/// to be loaded. We expect supporting libraries to have the same prefix as the
|
||||
/// original test in [dataDir]. So, for example, if testing `foo.dart` in
|
||||
/// [dataDir], then this function will consider any files named `foo.*\.dart`,
|
||||
/// such as `foo2.dart`, `foo_2.dart`, and `foo_blah_blah_blah.dart` in
|
||||
/// [libDirectory] to be supporting library files for `foo.dart`.
|
||||
/// Check code for all tests in [dataDir] using [runTest].
|
||||
Future runTests(Directory dataDir,
|
||||
{List<String> args: const <String>[],
|
||||
Directory libDirectory: null,
|
||||
int shards: 1,
|
||||
int shardIndex: 0,
|
||||
void onTest(Uri uri),
|
||||
Iterable<String> supportedMarkers,
|
||||
Uri createUriForFileName(String fileName, {bool isLib}),
|
||||
Uri createUriForFileName(String fileName),
|
||||
void onFailure(String message),
|
||||
RunTestFunction runTest}) async {
|
||||
// TODO(johnniwinther): Support --show to show actual data for an input.
|
||||
@@ -647,18 +623,11 @@ Future runTests(Directory dataDir,
|
||||
}
|
||||
print('----------------------------------------------------------------');
|
||||
|
||||
TestData testData = computeTestData(
|
||||
entity, entity is File ? libDirectory : null,
|
||||
TestData testData = computeTestData(entity,
|
||||
supportedMarkers: supportedMarkers,
|
||||
createUriForFileName: createUriForFileName,
|
||||
onFailure: onFailure);
|
||||
print('Test file: ${testData.testFileUri}');
|
||||
if (!succinct && testData.libFileNames != null) {
|
||||
print('Supporting libraries:');
|
||||
for (String libFileName in testData.libFileNames) {
|
||||
print(' - libs/$libFileName');
|
||||
}
|
||||
}
|
||||
print('Test: ${testData.testFileUri}');
|
||||
|
||||
if (await runTest(testData,
|
||||
testAfterFailures: testAfterFailures,
|
||||
|
||||
@@ -171,7 +171,7 @@ abstract class CfeDataExtractor<T> extends DataExtractor<T> {
|
||||
}
|
||||
|
||||
/// Create the testing URI used for [fileName] in annotated tests.
|
||||
Uri createUriForFileName(String fileName, {bool isLib}) => toTestUri(fileName);
|
||||
Uri createUriForFileName(String fileName) => toTestUri(fileName);
|
||||
|
||||
void onFailure(String message) => throw new StateError(message);
|
||||
|
||||
|
||||
@@ -2869,6 +2869,7 @@ virtual
|
||||
visible
|
||||
visit
|
||||
visited
|
||||
visiting
|
||||
visitor
|
||||
visual
|
||||
vm
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import '../libs/basic_deferred_lib.dart' deferred as lib;
|
||||
import 'lib.dart' deferred as lib;
|
||||
|
||||
/*member: main:
|
||||
OutputUnit(main, {}),
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// Imported by deferred_class.dart.
|
||||
// Imported by main.dart.
|
||||
|
||||
library deferred_class_library;
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import '../libs/deferred_class_library.dart' deferred as lib;
|
||||
import 'lib.dart' deferred as lib;
|
||||
|
||||
/*member: main:OutputUnit(main, {})*/
|
||||
main() {
|
||||
+1
-1
@@ -4,4 +4,4 @@
|
||||
|
||||
library deferred_constants1_lib1;
|
||||
|
||||
export 'deferred_constant1_lib3.dart' show C, C1;
|
||||
export 'lib3.dart' show C, C1;
|
||||
+1
-1
@@ -4,4 +4,4 @@
|
||||
|
||||
library deferred_constants1_lib2;
|
||||
|
||||
export 'deferred_constant1_lib3.dart' show C2, C3, C4, C5, C6, C7;
|
||||
export 'lib3.dart' show C2, C3, C4, C5, C6, C7;
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import '../libs/deferred_constant1_lib1.dart';
|
||||
import '../libs/deferred_constant1_lib2.dart' deferred as lib2;
|
||||
import 'lib1.dart';
|
||||
import 'lib2.dart' deferred as lib2;
|
||||
|
||||
/*member: main:
|
||||
OutputUnit(main, {}),
|
||||
+3
@@ -12,8 +12,11 @@ class Constant {
|
||||
const Constant(this.value);
|
||||
|
||||
/*member: Constant.==:OutputUnit(1, {lib})*/
|
||||
@override
|
||||
operator ==(other) => other is Constant && value == other.value;
|
||||
|
||||
/*member: Constant.hashCode:OutputUnit(1, {lib})*/
|
||||
@override
|
||||
get hashCode => 0;
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
import '../libs/deferred_constant2_lib.dart' deferred as lib;
|
||||
import 'lib.dart' deferred as lib;
|
||||
|
||||
/*member: main:
|
||||
OutputUnit(main, {}),
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'deferred_constant3_shared.dart';
|
||||
import 'deferred_constant3_lib2.dart' deferred as l2;
|
||||
import 'shared.dart';
|
||||
import 'lib2.dart' deferred as l2;
|
||||
|
||||
const c2 = const C(2);
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'deferred_constant3_shared.dart';
|
||||
import 'shared.dart';
|
||||
|
||||
const c3 = const C(1);
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import '../libs/deferred_constant3_shared.dart';
|
||||
import '../libs/deferred_constant3_lib1.dart' deferred as l1;
|
||||
import 'shared.dart';
|
||||
import 'lib1.dart' deferred as l1;
|
||||
|
||||
const c1 = const C(1);
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
|
||||
// Test that when a deferred import fails to load, it is possible to retry.
|
||||
|
||||
import "../libs/deferred_fail_and_retry_lib.dart" deferred as lib;
|
||||
import 'lib.dart' deferred as lib;
|
||||
import "package:expect/expect.dart";
|
||||
import "package:async_helper/async_helper.dart";
|
||||
import "dart:js" as js;
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// Imported by deferred_function.dart and
|
||||
// Imported by main.dart and
|
||||
|
||||
library deferred_function_library;
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// Test that loading of a library (with top-level functions only) can
|
||||
// be deferred.
|
||||
|
||||
import '../libs/deferred_function_lib.dart' deferred as lib;
|
||||
import 'lib.dart' deferred as lib;
|
||||
|
||||
/*member: readFoo:
|
||||
OutputUnit(main, {}),
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import "../libs/deferred_overlapping_lib1.dart" deferred as lib1;
|
||||
import "../libs/deferred_overlapping_lib2.dart" deferred as lib2;
|
||||
import 'lib1.dart' deferred as lib1;
|
||||
import 'lib2.dart' deferred as lib2;
|
||||
|
||||
// lib1.C1 and lib2.C2 has a shared base class. It will go in its own hunk.
|
||||
/*member: main:OutputUnit(main, {})*/
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import '../libs/deferred_typed_map_lib1.dart' deferred as lib;
|
||||
import 'lib1.dart' deferred as lib;
|
||||
|
||||
/*member: main:
|
||||
OutputUnit(main, {}),
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import '../libs/deferred_typedef_lib1.dart' deferred as lib1;
|
||||
import 'lib1.dart' deferred as lib1;
|
||||
|
||||
/*member: main:
|
||||
OutputUnit(main, {}),
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'dont_inline_deferred_constants_lib1.dart' deferred as lib1;
|
||||
import 'dont_inline_deferred_constants_lib2.dart' deferred as lib2;
|
||||
import 'lib1.dart' deferred as lib1;
|
||||
import 'lib2.dart' deferred as lib2;
|
||||
|
||||
const c = "string3";
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import "dont_inline_deferred_constants_main.dart" show C;
|
||||
import "dont_inline_deferred_constants_main.dart" as main;
|
||||
import 'exported_main.dart' show C;
|
||||
import 'exported_main.dart' as main;
|
||||
|
||||
const C1 = "string1";
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import "dont_inline_deferred_constants_main.dart" show C;
|
||||
import "dont_inline_deferred_constants_main.dart" as main;
|
||||
import 'exported_main.dart' show C;
|
||||
import 'exported_main.dart' as main;
|
||||
|
||||
const C4 = "string4";
|
||||
|
||||
+1
-1
@@ -4,4 +4,4 @@
|
||||
|
||||
// TODO(sigmund): remove this indirection and move the main code here. This is
|
||||
// needed because of the id-equivalence frameworks overrides the entrypoint URI.
|
||||
export '../libs/dont_inline_deferred_constants_main.dart';
|
||||
export 'exported_main.dart';
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import '../libs/dont_inline_deferred_global_lib.dart' deferred as lib;
|
||||
import 'lib.dart' deferred as lib;
|
||||
|
||||
/*member: main:OutputUnit(main, {})*/
|
||||
void main() {
|
||||
+1
-1
@@ -2,6 +2,6 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'future_or_lib2.dart';
|
||||
import 'lib2.dart';
|
||||
|
||||
const dynamic field = const A();
|
||||
+2
-2
@@ -3,8 +3,8 @@
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'dart:async';
|
||||
import '../libs/future_or_lib1.dart' deferred as lib1;
|
||||
import '../libs/future_or_lib2.dart' as lib2;
|
||||
import 'lib1.dart' deferred as lib1;
|
||||
import 'lib2.dart' as lib2;
|
||||
|
||||
/*member: main:
|
||||
OutputUnit(main, {}),
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
/*class: global#Instantiation:OutputUnit(1, {b})*/
|
||||
/*class: global#Instantiation1:OutputUnit(1, {b})*/
|
||||
|
||||
import '../libs/instantiation0_strong_lib1.dart' deferred as b;
|
||||
import 'lib1.dart' deferred as b;
|
||||
|
||||
/*member: main:OutputUnit(main, {})*/
|
||||
main() async {
|
||||
+2
-2
@@ -9,8 +9,8 @@
|
||||
/*class: global#Instantiation1:OutputUnit(1, {b})*/
|
||||
/*class: global#Instantiation2:OutputUnit(3, {c})*/
|
||||
|
||||
import '../libs/instantiation1_strong_lib1.dart' deferred as b;
|
||||
import '../libs/instantiation1_strong_lib2.dart' deferred as c;
|
||||
import 'lib1.dart' deferred as b;
|
||||
import 'lib2.dart' deferred as c;
|
||||
|
||||
/*member: main:OutputUnit(main, {})*/
|
||||
main() async {
|
||||
+2
-2
@@ -8,8 +8,8 @@
|
||||
/*class: global#Instantiation:OutputUnit(1, {b, c})*/
|
||||
/*class: global#Instantiation1:OutputUnit(1, {b, c})*/
|
||||
|
||||
import '../libs/instantiation2_strong_lib1.dart' deferred as b;
|
||||
import '../libs/instantiation2_strong_lib2.dart' deferred as c;
|
||||
import 'lib1.dart' deferred as b;
|
||||
import 'lib2.dart' deferred as c;
|
||||
|
||||
/*member: main:OutputUnit(main, {})*/
|
||||
main() async {
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
|
||||
/*member: global#instantiate1:OutputUnit(1, {b})*/
|
||||
|
||||
import '../libs/instantiation3_strong_lib1.dart' deferred as b;
|
||||
import 'lib1.dart' deferred as b;
|
||||
|
||||
/*member: main:OutputUnit(main, {})*/
|
||||
main() async {
|
||||
+2
-2
@@ -12,8 +12,8 @@
|
||||
/*member: global#instantiate1:OutputUnit(1, {b})*/
|
||||
/*member: global#instantiate2:OutputUnit(3, {c})*/
|
||||
|
||||
import '../libs/instantiation4_strong_lib1.dart' deferred as b;
|
||||
import '../libs/instantiation4_strong_lib2.dart' deferred as c;
|
||||
import 'lib1.dart' deferred as b;
|
||||
import 'lib2.dart' deferred as c;
|
||||
|
||||
/*member: main:OutputUnit(main, {})*/
|
||||
main() async {
|
||||
+2
-2
@@ -10,8 +10,8 @@
|
||||
|
||||
/*member: global#instantiate1:OutputUnit(1, {b, c})*/
|
||||
|
||||
import '../libs/instantiation5_strong_lib1.dart' deferred as b;
|
||||
import '../libs/instantiation5_strong_lib2.dart' deferred as c;
|
||||
import 'lib1.dart' deferred as b;
|
||||
import 'lib2.dart' deferred as c;
|
||||
|
||||
/*member: main:OutputUnit(main, {})*/
|
||||
main() async {
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'shared_constant_shared.dart' deferred as s1;
|
||||
import 'shared.dart' deferred as s1;
|
||||
|
||||
/*member: doA:
|
||||
OutputUnit(main, {}),
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'shared_constant_shared.dart' deferred as s2;
|
||||
import 'shared.dart' deferred as s2;
|
||||
|
||||
/*member: doB:
|
||||
OutputUnit(main, {}),
|
||||
+2
-2
@@ -8,8 +8,8 @@
|
||||
/// deferred import URI, the deferred-constant initializer was incorrectly moved
|
||||
/// to the main output unit.
|
||||
|
||||
import '../libs/shared_constant_a.dart';
|
||||
import '../libs/shared_constant_b.dart';
|
||||
import 'lib_a.dart';
|
||||
import 'lib_b.dart';
|
||||
|
||||
/*member: main:OutputUnit(main, {})*/
|
||||
main() async {
|
||||
+1
-1
@@ -2,6 +2,6 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'shared_constant_c.dart';
|
||||
import 'lib_c.dart';
|
||||
|
||||
const constant = const C();
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
library lib2;
|
||||
|
||||
import "package:expect/expect.dart";
|
||||
import "static_separate_lib1.dart";
|
||||
import "lib1.dart";
|
||||
|
||||
/*member: foo:
|
||||
OutputUnit(3, {lib2}),
|
||||
+2
-2
@@ -9,8 +9,8 @@
|
||||
|
||||
import "package:expect/expect.dart";
|
||||
import "package:async_helper/async_helper.dart";
|
||||
import "../libs/static_separate_lib1.dart" deferred as lib1;
|
||||
import "../libs/static_separate_lib2.dart" deferred as lib2;
|
||||
import 'lib1.dart' deferred as lib1;
|
||||
import 'lib2.dart' deferred as lib2;
|
||||
|
||||
/*member: main:OutputUnit(main, {})*/
|
||||
void main() {
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'type_argument_dependency_lib2.dart';
|
||||
import 'lib2.dart';
|
||||
|
||||
/*member: doCast:OutputUnit(main, {})*/
|
||||
doCast(List<dynamic> l) => l.cast<B>().map(/*OutputUnit(main, {})*/ (x) => 1);
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import '../libs/type_argument_dependency_lib1.dart';
|
||||
import '../libs/type_argument_dependency_lib2.dart' deferred as c;
|
||||
import 'lib1.dart';
|
||||
import 'lib2.dart' deferred as c;
|
||||
|
||||
/*member: main:OutputUnit(main, {})*/
|
||||
main() async {
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'type_arguments_lib3.dart';
|
||||
import 'lib3.dart';
|
||||
|
||||
/*class: A:OutputUnit(1, {lib1})*/
|
||||
class A<T> {
|
||||
+3
-3
@@ -2,9 +2,9 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import '../libs/type_arguments_lib1.dart' deferred as lib1;
|
||||
import '../libs/type_arguments_lib2.dart' as lib2;
|
||||
import '../libs/type_arguments_lib3.dart' deferred as lib3;
|
||||
import 'lib1.dart' deferred as lib1;
|
||||
import 'lib2.dart' as lib2;
|
||||
import 'lib3.dart' deferred as lib3;
|
||||
|
||||
/*member: main:
|
||||
OutputUnit(main, {}),
|
||||
@@ -32,9 +32,7 @@ main(List<String> args) {
|
||||
asyncTest(() async {
|
||||
Directory dataDir = new Directory.fromUri(Platform.script.resolve('data'));
|
||||
await checkTests(dataDir, const OutputUnitDataComputer(),
|
||||
libDirectory: new Directory.fromUri(Platform.script.resolve('libs')),
|
||||
options: compilerOptions,
|
||||
args: args, setUpFunction: () {
|
||||
options: compilerOptions, args: args, setUpFunction: () {
|
||||
importPrefixes.clear();
|
||||
}, testedConfigs: allStrongConfigs);
|
||||
});
|
||||
|
||||
@@ -131,7 +131,7 @@ Future<CompiledData<T>> computeData<T>(Uri entryPoint,
|
||||
OutputCollector outputCollector = new OutputCollector();
|
||||
DiagnosticCollector diagnosticCollector = new DiagnosticCollector();
|
||||
Uri packageConfig;
|
||||
Uri wantedPackageConfig = createUriForFileName(".packages", isLib: false);
|
||||
Uri wantedPackageConfig = createUriForFileName(".packages");
|
||||
for (String key in memorySourceFiles.keys) {
|
||||
if (key == wantedPackageConfig.path) {
|
||||
packageConfig = wantedPackageConfig;
|
||||
@@ -389,11 +389,10 @@ class TestConfig {
|
||||
/// If [forUserSourceFilesOnly] is true, we examine the elements in the main
|
||||
/// file and any supporting libraries.
|
||||
Future checkTests<T>(Directory dataDir, DataComputer<T> dataComputer,
|
||||
{List<String> skipForStrong: const <String>[],
|
||||
{List<String> skip: const <String>[],
|
||||
bool filterActualData(IdValue idValue, ActualData<T> actualData),
|
||||
List<String> options: const <String>[],
|
||||
List<String> args: const <String>[],
|
||||
Directory libDirectory: null,
|
||||
bool forUserLibrariesOnly: true,
|
||||
Callback setUpFunction,
|
||||
int shards: 1,
|
||||
@@ -430,7 +429,8 @@ Future checkTests<T>(Directory dataDir, DataComputer<T> dataComputer,
|
||||
|
||||
if (setUpFunction != null) setUpFunction();
|
||||
|
||||
if (skipForStrong.contains(name)) {
|
||||
print('name="${name}"');
|
||||
if (skip.contains(name)) {
|
||||
print('--skipped ------------------------------------------------------');
|
||||
} else {
|
||||
for (TestConfig testConfiguration in testedConfigs) {
|
||||
@@ -455,22 +455,16 @@ Future checkTests<T>(Directory dataDir, DataComputer<T> dataComputer,
|
||||
shards: shards,
|
||||
shardIndex: shardIndex,
|
||||
onTest: onTest,
|
||||
libDirectory: libDirectory,
|
||||
supportedMarkers: supportedMarkers,
|
||||
createUriForFileName: createUriForFileName,
|
||||
onFailure: Expect.fail,
|
||||
runTest: checkTest);
|
||||
}
|
||||
|
||||
Uri createUriForFileName(String fileName, {bool isLib}) {
|
||||
String commonTestPath = 'sdk/tests/compiler';
|
||||
if (isLib) {
|
||||
return Uri.parse('memory:$commonTestPath/libs/$fileName');
|
||||
} else {
|
||||
// Pretend this is a dart2js_native test to allow use of 'native'
|
||||
// keyword and import of private libraries.
|
||||
return Uri.parse('memory:$commonTestPath/dart2js_native/$fileName');
|
||||
}
|
||||
Uri createUriForFileName(String fileName) {
|
||||
// Pretend this is a dart2js_native test to allow use of 'native'
|
||||
// keyword and import of private libraries.
|
||||
return Uri.parse('memory:sdk/tests/compiler/dart2js_native/$fileName');
|
||||
}
|
||||
|
||||
Future<bool> runTestForConfiguration<T>(TestConfig testConfiguration,
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import '../libs/constants_lib.dart';
|
||||
import '../libs/constants_lib.dart' deferred as defer;
|
||||
import 'lib.dart';
|
||||
import 'lib.dart' deferred as defer;
|
||||
|
||||
/*member: main:static=**/
|
||||
main() {
|
||||
@@ -19,19 +19,16 @@ import '../equivalence/id_equivalence_helper.dart';
|
||||
main(List<String> args) {
|
||||
asyncTest(() async {
|
||||
Directory dataDir = new Directory.fromUri(Platform.script.resolve('data'));
|
||||
Directory libDirectory =
|
||||
new Directory.fromUri(Platform.script.resolve('libs'));
|
||||
print('Testing direct computation of ResolutionImpact');
|
||||
print('==================================================================');
|
||||
useImpactDataForTesting = false;
|
||||
await checkTests(dataDir, const ImpactDataComputer(),
|
||||
libDirectory: libDirectory, args: args, testedConfigs: [strongConfig]);
|
||||
args: args, testedConfigs: [strongConfig]);
|
||||
|
||||
print('Testing computation of ResolutionImpact through ImpactData');
|
||||
print('==================================================================');
|
||||
useImpactDataForTesting = true;
|
||||
await checkTests(dataDir, const ImpactDataComputer(),
|
||||
libDirectory: libDirectory,
|
||||
args: args,
|
||||
testedConfigs: allStrongConfigs);
|
||||
});
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
// to D without optional parameters is inferred using D's context, the default
|
||||
// value `_SECRET` will not be visible and compilation will fail.
|
||||
|
||||
import '../libs/mixin_constructor_default_parameter_values_lib.dart';
|
||||
import 'lib.dart';
|
||||
|
||||
class Mixin {
|
||||
/*member: Mixin.foo:[exact=JSString]*/
|
||||
@@ -18,9 +18,9 @@ import 'package:kernel/ast.dart' as ir;
|
||||
import '../equivalence/id_equivalence.dart';
|
||||
import '../equivalence/id_equivalence_helper.dart';
|
||||
|
||||
const List<String> skipForStrong = const <String>[
|
||||
const List<String> skip = const <String>[
|
||||
// TODO(johnniwinther): Remove this when issue 31767 is fixed.
|
||||
'mixin_constructor_default_parameter_values.dart',
|
||||
'mixin_constructor_default_parameter_values',
|
||||
];
|
||||
|
||||
main(List<String> args) {
|
||||
@@ -31,12 +31,11 @@ runTests(List<String> args, [int shardIndex]) {
|
||||
asyncTest(() async {
|
||||
Directory dataDir = new Directory.fromUri(Platform.script.resolve('data'));
|
||||
await checkTests(dataDir, const TypeMaskDataComputer(),
|
||||
libDirectory: new Directory.fromUri(Platform.script.resolve('libs')),
|
||||
forUserLibrariesOnly: true,
|
||||
args: args,
|
||||
options: [stopAfterTypeInference],
|
||||
testedConfigs: allInternalConfigs,
|
||||
skipForStrong: skipForStrong,
|
||||
skip: skip,
|
||||
shardIndex: shardIndex ?? 0,
|
||||
shards: shardIndex != null ? 4 : 1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user