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 733053004: cps-ir: Add a test for codegeneration. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix two checked mode issues. Created 6 years, 1 month 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
« no previous file with comments | « pkg/compiler/lib/src/js_backend/codegen/task.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4 // VMOptions=-DUSE_CPS_IR=true
5
6 // Test that the CPS IR code generator is able to compile the provided
7 // example programs.
8
9 import 'package:async_helper/async_helper.dart';
10 import 'package:expect/expect.dart';
11 import 'package:compiler/src/apiimpl.dart'
12 show Compiler;
13 import 'memory_compiler.dart';
14
15 const String TEST_MAIN_FILE = 'test.dart';
16
17 /// The list of tests to run.
18 const List<String> RAW_TESTS = const [
19 "main() {}",
20 "main() { return 42; }",
21 ];
22
23 String formatTest(Map test) {
24 return test[TEST_MAIN_FILE];
25 }
26
27 main() {
28 Expect.isTrue(const bool.fromEnvironment("USE_CPS_IR"));
29
30 Iterable<Map> tests =
31 RAW_TESTS.map((String text) => {TEST_MAIN_FILE: text});
32
33 for (Map test in tests) {
34 asyncTest(() {
35 Compiler compiler = compilerFor(test);
36 Uri uri = Uri.parse('memory:$TEST_MAIN_FILE');
37 return compiler.run(uri).then((_) {
38 Expect.isNotNull(compiler.assembledCode);
39 }).catchError((e) {
40 Expect.fail('The following test failed to compile:\n'
41 '${formatTest(test)}');
42 });
43 });
44 }
45 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/codegen/task.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698