Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 'dart:math'; | |
|
floitsch
2014/11/24 16:37:47
why?
sigurdm
2014/11/25 08:29:50
I used it for debugging.
Removed.
| |
| 10 | |
| 9 import 'package:async_helper/async_helper.dart'; | 11 import 'package:async_helper/async_helper.dart'; |
| 10 import 'package:expect/expect.dart'; | 12 import 'package:expect/expect.dart'; |
| 11 import 'package:compiler/src/apiimpl.dart' | 13 import 'package:compiler/src/apiimpl.dart' |
| 12 show Compiler; | 14 show Compiler; |
| 13 import 'memory_compiler.dart'; | 15 import 'memory_compiler.dart'; |
| 14 import 'package:compiler/src/js/js.dart' as js; | 16 import 'package:compiler/src/js/js.dart' as js; |
| 15 import 'package:compiler/src/common.dart' show Element; | 17 import 'package:compiler/src/common.dart' show Element; |
| 16 | 18 |
| 17 import 'js_backend_cps_ir_basic.dart' as basic; | 19 import 'js_backend_cps_ir_basic.dart' as basic; |
| 18 import 'js_backend_cps_ir_literals.dart' as literals; | 20 import 'js_backend_cps_ir_literals.dart' as literals; |
| 19 import 'js_backend_cps_ir_operators.dart' as operators; | 21 import 'js_backend_cps_ir_operators.dart' as operators; |
| 22 import 'js_backend_cps_ir_control_flow.dart' as control_flow; | |
| 20 | 23 |
| 21 const String TEST_MAIN_FILE = 'test.dart'; | 24 const String TEST_MAIN_FILE = 'test.dart'; |
| 22 | 25 |
| 23 List<TestEntry> tests = <TestEntry>[] | 26 List<TestEntry> tests = <TestEntry>[] |
| 24 ..addAll(basic.tests) | 27 ..addAll(basic.tests) |
| 25 ..addAll(literals.tests) | 28 ..addAll(literals.tests) |
| 29 ..addAll(control_flow.tests) | |
| 26 ..addAll(operators.tests); | 30 ..addAll(operators.tests); |
| 27 | 31 |
| 28 class TestEntry { | 32 class TestEntry { |
| 29 final String source; | 33 final String source; |
| 30 final String expectation; | 34 final String expectation; |
| 31 const TestEntry(this.source, [this.expectation]); | 35 const TestEntry(this.source, [this.expectation]); |
| 32 } | 36 } |
| 33 | 37 |
| 34 String formatTest(Map test) { | 38 String formatTest(Map test) { |
| 35 return test[TEST_MAIN_FILE]; | 39 return test[TEST_MAIN_FILE]; |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 60 } | 64 } |
| 61 } | 65 } |
| 62 }).catchError((e) { | 66 }).catchError((e) { |
| 63 print(e); | 67 print(e); |
| 64 Expect.fail('The following test failed to compile:\n' | 68 Expect.fail('The following test failed to compile:\n' |
| 65 '${formatTest(files)}'); | 69 '${formatTest(files)}'); |
| 66 }); | 70 }); |
| 67 }); | 71 }); |
| 68 } | 72 } |
| 69 } | 73 } |
| OLD | NEW |