From 60ef62a889f37ccdfd26c33541e36c137f68d977 Mon Sep 17 00:00:00 2001 From: Jens Johansen Date: Thu, 17 Sep 2020 13:09:30 +0000 Subject: [PATCH 1/2] [CFE] Only include git staged files in explicit creation test Change-Id: Ic1d006e6ce1596d5e4cb0f4e2222912d383c80ed Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163063 Reviewed-by: Johnni Winther Commit-Queue: Jens Johansen --- pkg/front_end/test/explicit_creation_test.dart | 7 ++++++- pkg/front_end/test/lint_suite.dart | 2 +- pkg/front_end/test/testing_utils.dart | 8 ++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/pkg/front_end/test/explicit_creation_test.dart b/pkg/front_end/test/explicit_creation_test.dart index 9416765da4b3..215f8240c448 100644 --- a/pkg/front_end/test/explicit_creation_test.dart +++ b/pkg/front_end/test/explicit_creation_test.dart @@ -39,6 +39,8 @@ import 'package:kernel/kernel.dart'; import 'package:kernel/target/targets.dart'; import "package:vm/target/vm.dart" show VmTarget; +import 'testing_utils.dart' show getGitFiles; + final Uri repoDir = _computeRepoDir(); Uri _computeRepoDir() { @@ -77,10 +79,13 @@ Future main(List args) async { } } for (Uri uri in libUris) { + Set gitFiles = await getGitFiles(uri); List entities = new Directory.fromUri(uri).listSync(recursive: true); for (FileSystemEntity entity in entities) { - if (entity is File && entity.path.endsWith(".dart")) { + if (entity is File && + entity.path.endsWith(".dart") && + gitFiles.contains(entity.uri)) { options.inputs.add(entity.uri); } } diff --git a/pkg/front_end/test/lint_suite.dart b/pkg/front_end/test/lint_suite.dart index 23b1f6b5baaa..28314341d80d 100644 --- a/pkg/front_end/test/lint_suite.dart +++ b/pkg/front_end/test/lint_suite.dart @@ -93,7 +93,7 @@ class Context extends ChainContext { Stream list(Chain suite) async* { Set gitFiles; if (onlyInGit) { - gitFiles = await getGitFiles(suite); + gitFiles = await getGitFiles(suite.uri); } Directory testRoot = new Directory.fromUri(suite.uri); diff --git a/pkg/front_end/test/testing_utils.dart b/pkg/front_end/test/testing_utils.dart index 0ab71ffcbc44..b966e7477e82 100644 --- a/pkg/front_end/test/testing_utils.dart +++ b/pkg/front_end/test/testing_utils.dart @@ -10,7 +10,7 @@ Stream filterList( Chain suite, bool onlyInGit, Stream base) async* { Set gitFiles; if (onlyInGit) { - gitFiles = await getGitFiles(suite); + gitFiles = await getGitFiles(suite.uri); } await for (TestDescription description in base) { if (onlyInGit && !gitFiles.contains(description.uri)) { @@ -20,14 +20,14 @@ Stream filterList( } } -Future> getGitFiles(Chain suite) async { +Future> getGitFiles(Uri uri) async { ProcessResult result = await Process.run("git", ["ls-files", "."], - workingDirectory: new Directory.fromUri(suite.uri).absolute.path, + workingDirectory: new Directory.fromUri(uri).absolute.path, runInShell: true); String stdout = result.stdout; return stdout .split(new RegExp('^', multiLine: true)) - .map((line) => suite.uri.resolve(line.trimRight())) + .map((line) => uri.resolve(line.trimRight())) .toSet(); } From aa705eb6f1f97855c6ce6c53c3d725197d9a97d4 Mon Sep 17 00:00:00 2001 From: Johnni Winther Date: Thu, 17 Sep 2020 14:22:20 +0000 Subject: [PATCH 2/2] [kernel] Remove @deprecated annotation Change-Id: I86b651978768b164e66b83ee319b226c106ae2d4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163203 Reviewed-by: Clement Skau Commit-Queue: Johnni Winther --- pkg/kernel/lib/ast.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/kernel/lib/ast.dart b/pkg/kernel/lib/ast.dart index 3adc4953a1a8..27a61e2f2b57 100644 --- a/pkg/kernel/lib/ast.dart +++ b/pkg/kernel/lib/ast.dart @@ -7111,7 +7111,6 @@ abstract class Name extends Node { // TODO(johnniwinther): Remove this when dependent code has been updated to // use [text]. - @deprecated String get name => text; bool operator ==(other) {