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

Side by Side Diff: tests/compiler/dart2js/js_backend_cps_ir_test.dart

Issue 832363002: Remove Compiler.assembledCode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix unittest 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 // VMOptions=-DUSE_CPS_IR=true 4 // VMOptions=-DUSE_CPS_IR=true
5 5
6 // Test that the CPS IR code generator compiles programs and produces the 6 // Test that the CPS IR code generator compiles programs and produces the
7 // the expected output. 7 // the expected output.
8 8
9 import 'package:async_helper/async_helper.dart'; 9 import 'package:async_helper/async_helper.dart';
10 import 'package:expect/expect.dart'; 10 import 'package:expect/expect.dart';
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 } 46 }
47 47
48 main() { 48 main() {
49 Expect.isTrue(const bool.fromEnvironment("USE_CPS_IR")); 49 Expect.isTrue(const bool.fromEnvironment("USE_CPS_IR"));
50 50
51 for (TestEntry test in tests) { 51 for (TestEntry test in tests) {
52 Map files = {TEST_MAIN_FILE: test.source}; 52 Map files = {TEST_MAIN_FILE: test.source};
53 asyncTest(() { 53 asyncTest(() {
54 Compiler compiler = compilerFor(files); 54 Compiler compiler = compilerFor(files);
55 Uri uri = Uri.parse('memory:$TEST_MAIN_FILE'); 55 Uri uri = Uri.parse('memory:$TEST_MAIN_FILE');
56 return compiler.run(uri).then((_) { 56 return compiler.run(uri).then((bool success) {
57 Expect.isNotNull(compiler.assembledCode); 57 Expect.isTrue(success);
58 String expectation = test.expectation; 58 String expectation = test.expectation;
59 if (expectation != null) { 59 if (expectation != null) {
60 String expected = test.expectation; 60 String expected = test.expectation;
61 String found = getCodeForMain(compiler); 61 String found = getCodeForMain(compiler);
62 if (expected != found) { 62 if (expected != found) {
63 Expect.fail('Expected:\n$expected\nbut found\n$found'); 63 Expect.fail('Expected:\n$expected\nbut found\n$found');
64 } 64 }
65 } 65 }
66 }).catchError((e) { 66 }).catchError((e) {
67 print(e); 67 print(e);
68 Expect.fail('The following test failed to compile:\n' 68 Expect.fail('The following test failed to compile:\n'
69 '${formatTest(files)}'); 69 '${formatTest(files)}');
70 }); 70 });
71 }); 71 });
72 } 72 }
73 } 73 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/incremental/hello_test.dart ('k') | tests/compiler/dart2js/memory_compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698