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

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: 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
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 'memory_compiler.dart';
12
13 const String TEST_MAIN_FILE = 'test.dart';
14
15 /// The list of tests to run.
16 const List<String> RAW_TESTS = const [
17 "main() {}",
18 "main() { return 42; }",
19 ];
20
21 String formatTest(Map test) {
22 return test[TEST_MAIN_FILE];
23 }
24
25 main() {
26 Expect.isTrue(const bool.fromEnvironment("USE_CPS_IR"));
27
28 List<Map> tests =
29 RAW_TESTS.map((String text) => {TEST_MAIN_FILE: text});
30
31 for (Map test in tests) {
32 asyncTest(() {
33 Compiler compiler = compilerFor(test);
34 Uri uri = Uri.parse('memory:$TEST_MAIN_FILE');
35 return compiler.run(uri).then((_) {
36 Expect.isTrue(compiler.assembledCode != null);
floitsch 2014/11/17 15:03:30 Expect.isNotNull(...)
floitsch 2014/11/17 15:03:30 indent+, or indent- in the next line.
karlklose 2014/11/17 16:11:58 Done.
karlklose 2014/11/17 16:11:58 Done.
37 }).catchError((_) {
38 print('The following test failed to compile:\n'
39 '${formatTest(test)}');
40 Expect.isTrue(false);
floitsch 2014/11/17 15:03:30 Expect.fail(...)
karlklose 2014/11/17 16:11:58 Done.
41 });
42 });
43 }
44 }
OLDNEW
« pkg/compiler/lib/src/ssa/codegen.dart ('K') | « pkg/compiler/lib/src/ssa/codegen.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698