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

Unified Diff: tests/try/poi/compiler_test_case.dart

Issue 2232273004: Delete site/try (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
Index: tests/try/poi/compiler_test_case.dart
diff --git a/tests/try/poi/compiler_test_case.dart b/tests/try/poi/compiler_test_case.dart
deleted file mode 100644
index 711e47edd21e09924b5470f29f5cd65dade0e985..0000000000000000000000000000000000000000
--- a/tests/try/poi/compiler_test_case.dart
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright (c) 2014, the Dart 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 file.
-
-// Helper class for writing compiler tests.
-library trydart.compiler_test_case;
-
-import 'dart:async' show
- Future;
-
-export 'dart:async' show
- Future;
-
-import 'package:async_helper/async_helper.dart' show
- asyncTest;
-
-import '../../compiler/dart2js/mock_compiler.dart' show
- MockCompiler,
- compilerFor;
-
-export 'package:expect/expect.dart' show
- Expect;
-
-import 'package:compiler/src/elements/elements.dart' show
- LibraryElement;
-
-export 'package:compiler/src/elements/elements.dart' show
- LibraryElement;
-
-const String CONSTANT_CLASS = 'class Constant { const Constant(); }';
-
-const String SCHEME = 'org.trydart.compiler-test-case';
-
-Uri customUri(String path) => Uri.parse('$SCHEME:/$path');
-
-Future runTests(List<CompilerTestCase> tests) {
- asyncTest(() => Future.forEach(tests, runTest));
-}
-
-Future runTest(CompilerTestCase test) {
- print('\n{{{\n$test\n\n=== Test Output:\n');
- return test.run().then((_) {
- print('}}}');
- });
-}
-
-abstract class CompilerTestCase {
- final String source;
-
- final Uri scriptUri;
-
- final MockCompiler compiler;
-
- CompilerTestCase.init(this.source, this.scriptUri, this.compiler);
-
- CompilerTestCase.intermediate(String source, Uri scriptUri)
- : this.init(source, scriptUri, compilerFor(source, scriptUri));
-
- CompilerTestCase(String source, [String path])
- : this.intermediate(source, customUri(path == null ? 'main.dart' : path));
-
- Future<LibraryElement> loadMainApp() {
- return compiler.libraryLoader.loadLibrary(scriptUri)
- .then((LibraryElement library) {
- if (compiler.mainApp == null) {
- compiler.mainApp = library;
- } else if (compiler.mainApp != library) {
- throw
- "Inconsistent use of compiler"
- " (${compiler.mainApp} != $library).";
- }
- return library;
- });
- }
-
- Future run();
-
- /// Returns a future for the mainApp after running the compiler.
- Future<LibraryElement> compile() {
- return loadMainApp().then((LibraryElement library) {
- return compiler.run(scriptUri).then((_) => library);
- });
- }
-
- String toString() => source;
-}

Powered by Google App Engine
This is Rietveld 408576698