Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Unified Diff: tools/migration/bin/migrate_batch.dart

Issue 2987223002: Add a script to run the tests in a migration block. (Closed)
Patch Set: Merge branch 'master' into run-tests Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/migration/.packages ('k') | tools/migration/bin/run_tests.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/migration/bin/migrate_batch.dart
diff --git a/tools/migration/bin/migrate_batch.dart b/tools/migration/bin/migrate_batch.dart
index cb96e0950c3b993604b733aa33def596e2130e49..7a1827a0c1e73b0d0fc6755b8874a7bb4d2b54a1 100644
--- a/tools/migration/bin/migrate_batch.dart
+++ b/tools/migration/bin/migrate_batch.dart
@@ -10,13 +10,10 @@
import 'dart:io';
-import 'package:path/path.dart' as p;
-
import 'package:migration/src/fork.dart';
import 'package:migration/src/io.dart';
import 'package:migration/src/log.dart';
import 'package:migration/src/migrate_statuses.dart';
-import 'package:migration/src/test_directories.dart';
const simpleDirs = const ["corelib", "language", "lib"];
@@ -32,8 +29,7 @@ void main(List<String> arguments) {
stderr.writeln();
stderr.writeln("Example:");
stderr.writeln();
- stderr.writeln(
- " \$ dart migrate_batch.dart corelib/map_to_string corelib/queue");
+ stderr.writeln(" \$ dart migrate_batch.dart map_to_string queue");
exit(1);
}
@@ -95,57 +91,3 @@ void main(List<String> arguments) {
allTodos[todoTest].forEach(todo);
}
}
-
-int findFork(List<Fork> forks, String description) {
- var matches = <int>[];
-
- for (var i = 0; i < forks.length; i++) {
- if (forks[i].twoPath.contains(description)) matches.add(i);
- }
-
- if (matches.isEmpty) {
- print('Could not find a test matching "${bold(description)}".');
- return null;
- } else if (matches.length == 1) {
- return matches.first;
- } else {
- print('Description "${bold(description)}" is ambiguous. Could be any of:');
- for (var i in matches) {
- print("- ${forks[i].twoPath.replaceAll(description, bold(description))}");
- }
-
- print("Please use a more precise description.");
- return null;
- }
-}
-
-/// Loads all of the unforked test files.
-///
-/// Creates an list of [Fork]s, ordered by their destination paths. Handles
-/// tests that only appear in one fork or the other, or both.
-List<Fork> scanTests() {
- var tests = <String, Fork>{};
-
- for (var fromDir in fromRootDirs) {
- var twoDir = toTwoDirectory(fromDir);
- for (var path in listFiles(fromDir)) {
- var fromPath = p.relative(path, from: testRoot);
- var twoPath = p.join(twoDir, p.relative(fromPath, from: fromDir));
-
- tests.putIfAbsent(twoPath, () => new Fork(twoPath));
- }
- }
-
- // Include tests that have already been migrated too so we can show what
- // works remains to be done in them.
- for (var dir in twoRootDirs) {
- for (var path in listFiles(dir)) {
- var twoPath = p.relative(path, from: testRoot);
- tests.putIfAbsent(twoPath, () => new Fork(twoPath));
- }
- }
-
- var sorted = tests.values.toList();
- sorted.sort((a, b) => a.twoPath.compareTo(b.twoPath));
- return sorted;
-}
« no previous file with comments | « tools/migration/.packages ('k') | tools/migration/bin/run_tests.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698