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

Unified Diff: tests/standalone/io/skipping_dart2js_compilations_test.dart

Issue 21001003: test.py: First step towards support of caching dart2js compilations across runtimes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebased Created 7 years, 4 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 | « no previous file | tests/standalone/io/test_runner_test.dart » ('j') | tools/testing/dart/test_runner.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/skipping_dart2js_compilations_test.dart
diff --git a/tests/standalone/io/skipping_dart2js_compilations_test.dart b/tests/standalone/io/skipping_dart2js_compilations_test.dart
index 063caedd2b48b5eae2ba5439098481501a0ee4e7..d2be72ede24c2ddadef94be8c2fb7df318e7d560 100644
--- a/tests/standalone/io/skipping_dart2js_compilations_test.dart
+++ b/tests/standalone/io/skipping_dart2js_compilations_test.dart
@@ -122,17 +122,15 @@ class FileUtils {
}
}
-class TestCompletedHandler {
+class CommandCompletedHandler {
FileUtils fileUtils;
DateTime _expectedTimestamp;
bool _shouldHaveRun;
- TestCompletedHandler(FileUtils this.fileUtils, bool this._shouldHaveRun);
+ CommandCompletedHandler(FileUtils this.fileUtils, bool this._shouldHaveRun);
- void processCompletedTest(runner.TestCase testCase) {
- var output = testCase.lastCommandOutput;
-
- Expect.isFalse(output.unexpectedOutput);
+ void processCompletedTest(CommandOutput output) {
+ Expect.isTrue(output.exitCode == 0);
Expect.isTrue(output.stderr.length == 0);
if (_shouldHaveRun) {
Expect.isTrue(output.stdout.length == 0);
@@ -145,7 +143,7 @@ class TestCompletedHandler {
}
}
-runner.TestCase makeTestCase(String testName, FileUtils fileUtils) {
+runner.Command makeCompilationCommand(String testName, FileUtils fileUtils) {
var config = new options.TestOptionsParser().parse(['--timeout', '2'])[0];
var createFileScript = join(dirname(Platform.script),
'skipping_dart2js_compilations_helper.dart');
@@ -153,19 +151,14 @@ runner.TestCase makeTestCase(String testName, FileUtils fileUtils) {
var arguments = [createFileScript, fileUtils.scriptOutputPath.toNativePath()];
var bootstrapDeps = [
Uri.parse("file://${fileUtils.testSnapshotFilePath}")];
- var commands = [new runner.CompilationCommand(
+ return runner.CommandBuilder.instance.getCompilationCommand(
'dart2js',
fileUtils.testJsFilePath.toNativePath(),
false,
bootstrapDeps,
executable,
- arguments)];
- return new runner.TestCase(
- testName,
- commands,
- config,
- (_) {},
- new Set<String>.from([status.PASS]));
+ arguments,
+ 'ReleaseIA32');
}
void main() {
@@ -213,11 +206,11 @@ void main() {
fs_upToDate.touchFile(fs_upToDate.testJs);
Future runTest(String name, FileUtils fileUtils, bool shouldRun) {
- var completedHandler = new TestCompletedHandler(fileUtils, shouldRun);
- var testCase = makeTestCase(name, fileUtils);
- var process = new runner.RunningProcess(testCase, testCase.commands[0]);
- return process.start().then((_) {
- completedHandler.processCompletedTest(testCase);
+ var completedHandler = new CommandCompletedHandler(fileUtils, shouldRun);
+ var command = makeCompilationCommand(name, fileUtils);
+ var process = new runner.RunningProcess(command, 60);
+ return process.run().then((CommandOutput output) {
+ completedHandler.processCompletedTest(output);
});
}
// We run the tests in sequence, so that if one of them failes we clean up
« no previous file with comments | « no previous file | tests/standalone/io/test_runner_test.dart » ('j') | tools/testing/dart/test_runner.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698