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 | 4 |
5 library dart_backend.test_helper; | 5 library dart_backend.test_helper; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'package:async_helper/async_helper.dart'; | 8 import 'package:async_helper/async_helper.dart'; |
9 import 'package:compiler/compiler.dart' as api; | 9 import 'package:compiler/compiler.dart' as api; |
10 import 'package:compiler/src/dart2jslib.dart'; | 10 import 'package:compiler/src/compiler.dart'; |
11 import '../../../../pkg/analyzer2dart/test/test_helper.dart'; | 11 import '../../../../pkg/analyzer2dart/test/test_helper.dart'; |
12 import '../compiler_helper.dart'; | 12 import '../compiler_helper.dart'; |
13 | 13 |
14 /// Compiles the given dart code (which must include a 'main' function) and | 14 /// Compiles the given dart code (which must include a 'main' function) and |
15 /// returns the compiler. | 15 /// returns the compiler. |
16 Future<Compiler> compilerFor(String code, | 16 Future<Compiler> compilerFor(String code, |
17 {api.CompilerOutputProvider outputProvider}) { | 17 {api.CompilerOutputProvider outputProvider}) { |
18 MockCompiler compiler = new MockCompiler.internal( | 18 MockCompiler compiler = new MockCompiler.internal( |
19 emitJavaScript: false, | 19 emitJavaScript: false, |
20 enableMinification: false, | 20 enableMinification: false, |
(...skipping 16 matching lines...) Expand all Loading... |
37 compiler.irBuilder.buildNodes(); | 37 compiler.irBuilder.buildNodes(); |
38 | 38 |
39 return compiler; | 39 return compiler; |
40 }); | 40 }); |
41 } | 41 } |
42 | 42 |
43 /// Test group using async_helper. | 43 /// Test group using async_helper. |
44 asyncTester(Group group, RunTest runTest) { | 44 asyncTester(Group group, RunTest runTest) { |
45 asyncTest(() => Future.forEach(group.results, runTest)); | 45 asyncTest(() => Future.forEach(group.results, runTest)); |
46 } | 46 } |
OLD | NEW |