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

Unified Diff: tests/fletchc/incremental/common.dart

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments Created 4 years, 11 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 | « tests/fletchc/driver/test_vm_connection.dart ('k') | tests/fletchc/incremental/compiler_test_case.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/fletchc/incremental/common.dart
diff --git a/tests/fletchc/incremental/common.dart b/tests/fletchc/incremental/common.dart
deleted file mode 100644
index 1243f4b8ec288149ffef4ba4e3b61e56059990ff..0000000000000000000000000000000000000000
--- a/tests/fletchc/incremental/common.dart
+++ /dev/null
@@ -1,94 +0,0 @@
-// Copyright (c) 2016, the Dartino project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE.md file.
-
-library tests.fletchc.incremental.common;
-
-export 'dart:async' show
- Future;
-
-export 'feature_test.dart' show
- NoArgFuture;
-
-export 'program_result.dart' show
- EncodedResult;
-
-import 'dart:async' show
- Future;
-
-import 'dart:isolate' show
- ReceivePort;
-
-import 'feature_test.dart' show
- NoArgFuture;
-
-import 'program_result.dart' show
- EncodedResult,
- computeTests;
-
-import 'tests_with_expectations.dart' as tests_with_expectations;
-
-abstract class IncrementalTestSuite {
- final String suiteName;
-
- static final Map<String, EncodedResult> allTests =
- computeTests(tests_with_expectations.tests);
-
- const IncrementalTestSuite(this.suiteName);
-
- Future<Map<String, NoArgFuture>> list() {
- return new Future<Map<String, NoArgFuture>>.value(listSync());
- }
-
- Map<String, NoArgFuture> listSync() {
- Map<String, NoArgFuture> result = <String, NoArgFuture>{};
- allTests.forEach((String testName, EncodedResult encodedResult) {
- result["incremental/$suiteName/$testName"] =
- () => run(testName, encodedResult);
- });
- return result;
- }
-
- Future<Null> run(String testName, EncodedResult encodedResult);
-
- Future<Null> runFromMain(List<String> arguments) {
- Map<String, NoArgFuture> tests = listSync();
- if (arguments.isEmpty) {
- arguments = tests.keys.toList();
- }
- List<String> missingTests = <String>[];
- List<NoArgFuture> testsToRun = <NoArgFuture>[];
- for (String testName in arguments) {
- if (testName.startsWith("$suiteName/")) {
- testName = "incremental/$testName";
- } else if (!testName.startsWith("incremental/$suiteName/")) {
- testName = "incremental/$suiteName/$testName";
- }
- NoArgFuture testClosure = tests[testName];
- if (testClosure == null) {
- missingTests.add(testName);
- } else {
- testsToRun.add(testClosure);
- }
- }
- if (missingTests.isNotEmpty) {
- throw "The following tests couldn't be found: ${missingTests.join(' ')}";
- }
- Iterator testIterator = testsToRun.iterator;
- if (testIterator.moveNext()) {
- // Create a ReceivePort to ensure the Dart VM doesn't exit before all
- // futures have completed.
- ReceivePort done = new ReceivePort();
- return Future.doWhile(() async {
- await (testIterator.current)();
- return testIterator.moveNext();
- }).whenComplete(() {
- // The test is done, the Dart VM may exit. So we close the port.
- done.close();
- });
- } else {
- // This can't happen.
- throw "No tests specified.";
- }
- }
-}
« no previous file with comments | « tests/fletchc/driver/test_vm_connection.dart ('k') | tests/fletchc/incremental/compiler_test_case.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698