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

Side by Side Diff: tools/testing/dart/test_runner.dart

Issue 11593008: Enable the "skip command compilation if output is already up-to-date" feature in dart2dart (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Classes and methods for executing tests. 6 * Classes and methods for executing tests.
7 * 7 *
8 * This module includes: 8 * This module includes:
9 * - Managing parallel execution of tests, including timeout checks. 9 * - Managing parallel execution of tests, including timeout checks.
10 * - Evaluating the output of each test as pass/fail/crash/timeout. 10 * - Evaluating the output of each test as pass/fail/crash/timeout.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 executable = executable.replaceAll('/', '\\'); 44 executable = executable.replaceAll('/', '\\');
45 } 45 }
46 commandLine = "$executable ${Strings.join(arguments, ' ')}"; 46 commandLine = "$executable ${Strings.join(arguments, ' ')}";
47 } 47 }
48 48
49 String toString() => commandLine; 49 String toString() => commandLine;
50 50
51 Future<bool> get outputIsUpToDate => new Future.immediate(false); 51 Future<bool> get outputIsUpToDate => new Future.immediate(false);
52 } 52 }
53 53
54 class Dart2JsCommand extends Command { 54 class CompilationCommand extends Command {
55 String _jsOutputFile; 55 String _outputFile;
56 bool _neverSkipCompilation; 56 bool _neverSkipCompilation;
57 List<Uri> _bootstrapDependencies; 57 List<Uri> _bootstrapDependencies;
58 58
59 Dart2JsCommand(this._jsOutputFile, 59 CompilationCommand(this._outputFile,
60 this._neverSkipCompilation, 60 this._neverSkipCompilation,
61 this._bootstrapDependencies, 61 this._bootstrapDependencies,
62 String executable, 62 String executable,
63 List<String> arguments) 63 List<String> arguments)
64 : super(executable, arguments); 64 : super(executable, arguments);
65 65
66 Future<bool> get outputIsUpToDate { 66 Future<bool> get outputIsUpToDate {
67 if (_neverSkipCompilation) return new Future.immediate(false); 67 if (_neverSkipCompilation) return new Future.immediate(false);
68 68
69 Future<List<Uri>> readDepsFile(String path) { 69 Future<List<Uri>> readDepsFile(String path) {
70 var file = new File(new Path(path).toNativePath()); 70 var file = new File(new Path(path).toNativePath());
71 if (!file.existsSync()) { 71 if (!file.existsSync()) {
72 return new Future.immediate(null); 72 return new Future.immediate(null);
73 } 73 }
74 return file.readAsLines().transform((List<String> lines) { 74 return file.readAsLines().transform((List<String> lines) {
75 var dependencies = new List<Uri>(); 75 var dependencies = new List<Uri>();
76 for (var line in lines) { 76 for (var line in lines) {
77 line = line.trim(); 77 line = line.trim();
78 if (line.length > 0) { 78 if (line.length > 0) {
79 dependencies.add(new Uri(line)); 79 dependencies.add(new Uri(line));
80 } 80 }
81 } 81 }
82 return dependencies; 82 return dependencies;
83 }); 83 });
84 } 84 }
85 85
86 return readDepsFile("$_jsOutputFile.deps").transform((dependencies) { 86 return readDepsFile("$_outputFile.deps").transform((dependencies) {
87 if (dependencies != null) { 87 if (dependencies != null) {
88 dependencies.addAll(_bootstrapDependencies); 88 dependencies.addAll(_bootstrapDependencies);
89 var jsOutputLastModified = TestUtils.lastModifiedCache.getLastModified( 89 var jsOutputLastModified = TestUtils.lastModifiedCache.getLastModified(
90 new Uri.fromComponents(scheme: 'file', path: _jsOutputFile)); 90 new Uri.fromComponents(scheme: 'file', path: _outputFile));
91 if (jsOutputLastModified != null) { 91 if (jsOutputLastModified != null) {
92 for (var dependency in dependencies) { 92 for (var dependency in dependencies) {
93 var dependencyLastModified = 93 var dependencyLastModified =
94 TestUtils.lastModifiedCache.getLastModified(dependency); 94 TestUtils.lastModifiedCache.getLastModified(dependency);
95 if (dependencyLastModified == null || 95 if (dependencyLastModified == null ||
96 dependencyLastModified > jsOutputLastModified) { 96 dependencyLastModified > jsOutputLastModified) {
97 return false; 97 return false;
98 } 98 }
99 } 99 }
100 return true; 100 return true;
(...skipping 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 // the developer doesn't waste his or her time trying to fix a bunch of 1521 // the developer doesn't waste his or her time trying to fix a bunch of
1522 // tests that appear to be broken but were actually just flakes that 1522 // tests that appear to be broken but were actually just flakes that
1523 // didn't get retried because there had already been one failure. 1523 // didn't get retried because there had already been one failure.
1524 bool allowRetry = _MAX_FAILED_NO_RETRY > _progress.numFailedTests; 1524 bool allowRetry = _MAX_FAILED_NO_RETRY > _progress.numFailedTests;
1525 new RunningProcess(test, allowRetry, this).start(); 1525 new RunningProcess(test, allowRetry, this).start();
1526 } 1526 }
1527 _numProcesses++; 1527 _numProcesses++;
1528 } 1528 }
1529 } 1529 }
1530 } 1530 }
OLDNEW
« no previous file with comments | « tests/standalone/io/skipping_dart2js_compilations_test.dart ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698