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

Unified Diff: tests/compiler/dart2js/js_backend_cps_ir_test.dart

Issue 810183003: Split js_backend_cps_ir tests into multiple test units. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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/compiler/dart2js/js_backend_cps_ir_operators_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/js_backend_cps_ir_test.dart
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_test.dart
deleted file mode 100644
index 4acdd28c74a228380163fa80996431379b9e2589..0000000000000000000000000000000000000000
--- a/tests/compiler/dart2js/js_backend_cps_ir_test.dart
+++ /dev/null
@@ -1,75 +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.
-// VMOptions=-DUSE_CPS_IR=true
-
-// Test that the CPS IR code generator compiles programs and produces the
-// the expected output.
-
-import 'package:async_helper/async_helper.dart';
-import 'package:expect/expect.dart';
-import 'package:compiler/src/apiimpl.dart'
- show Compiler;
-import 'memory_compiler.dart';
-import 'package:compiler/src/js/js.dart' as js;
-import 'package:compiler/src/common.dart' show Element;
-
-import 'js_backend_cps_ir_basic.dart' as basic;
-import 'js_backend_cps_ir_literals.dart' as literals;
-import 'js_backend_cps_ir_operators.dart' as operators;
-import 'js_backend_cps_ir_control_flow.dart' as control_flow;
-import 'js_backend_cps_ir_interceptors.dart' as interceptors;
-import 'js_backend_cps_ir_closures.dart' as closures;
-
-const String TEST_MAIN_FILE = 'test.dart';
-
-List<TestEntry> tests = <TestEntry>[]
- ..addAll(basic.tests)
- ..addAll(literals.tests)
- ..addAll(control_flow.tests)
- ..addAll(operators.tests)
- ..addAll(interceptors.tests)
- ..addAll(closures.tests);
-
-class TestEntry {
- final String source;
- final String expectation;
- const TestEntry(this.source, [this.expectation]);
-}
-
-String formatTest(Map test) {
- return test[TEST_MAIN_FILE];
-}
-
-String getCodeForMain(Compiler compiler) {
- Element mainFunction = compiler.mainFunction;
- js.Node ast = compiler.enqueuer.codegen.generatedCode[mainFunction];
- return js.prettyPrint(ast, compiler).getText();
-}
-
-main() {
- Expect.isTrue(const bool.fromEnvironment("USE_CPS_IR"));
-
- for (TestEntry test in tests) {
- Map files = {TEST_MAIN_FILE: test.source};
- asyncTest(() {
- Compiler compiler = compilerFor(files);
- Uri uri = Uri.parse('memory:$TEST_MAIN_FILE');
- return compiler.run(uri).then((bool success) {
- Expect.isTrue(success);
- String expectation = test.expectation;
- if (expectation != null) {
- String expected = test.expectation;
- String found = getCodeForMain(compiler);
- if (expected != found) {
- Expect.fail('Expected:\n$expected\nbut found\n$found');
- }
- }
- }).catchError((e) {
- print(e);
- Expect.fail('The following test failed to compile:\n'
- '${formatTest(files)}');
- });
- });
- }
-}
« no previous file with comments | « tests/compiler/dart2js/js_backend_cps_ir_operators_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698