OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// Tests that run the checker end-to-end using the file system, but with a mock | 5 /// Tests that run the checker end-to-end using the file system, but with a mock |
6 /// SDK. | 6 /// SDK. |
7 library dev_compiler.test.end_to_end; | 7 library dev_compiler.test.end_to_end; |
8 | 8 |
9 import 'package:dev_compiler/devc.dart' show Compiler; | 9 import 'package:dev_compiler/devc.dart' show Compiler; |
10 import 'package:dev_compiler/src/options.dart'; | 10 import 'package:dev_compiler/src/options.dart'; |
11 import 'package:test/test.dart'; | 11 import 'package:test/test.dart'; |
12 import 'test_util.dart' show testDirectory; | 12 import 'test_util.dart' show testDirectory; |
13 | 13 |
14 main() { | 14 main() { |
15 _check(testFile) { | 15 _check(testFile) { |
16 var options = new CompilerOptions( | 16 var options = new CompilerOptions( |
17 entryPointFile: '$testDirectory/$testFile.dart', useMockSdk: true); | 17 sourceOptions: new SourceResolverOptions( |
| 18 useMockSdk: true, entryPointFile: '$testDirectory/$testFile.dart')); |
18 new Compiler(options).run(); | 19 new Compiler(options).run(); |
19 } | 20 } |
20 | 21 |
21 test('checker runs correctly (end-to-end)', () { | 22 test('checker runs correctly (end-to-end)', () { |
22 _check('samples/funwithtypes'); | 23 _check('samples/funwithtypes'); |
23 }); | 24 }); |
24 | 25 |
25 test('checker accepts files with imports', () { | 26 test('checker accepts files with imports', () { |
26 _check('samples/import_test'); | 27 _check('samples/import_test'); |
27 }); | 28 }); |
28 | 29 |
29 test('checker tests function types', () { | 30 test('checker tests function types', () { |
30 // TODO(vsm): Check for correct down casts. | 31 // TODO(vsm): Check for correct down casts. |
31 _check('samples/function_type_test'); | 32 _check('samples/function_type_test'); |
32 }); | 33 }); |
33 | 34 |
34 test('checker tests runtime checks', () { | 35 test('checker tests runtime checks', () { |
35 // TODO(sigmund,vsm): Check output for invalid checks. | 36 // TODO(sigmund,vsm): Check output for invalid checks. |
36 _check('samples/runtimetypechecktest'); | 37 _check('samples/runtimetypechecktest'); |
37 }); | 38 }); |
38 | 39 |
39 test('checker tests return values', () { | 40 test('checker tests return values', () { |
40 // TODO(vsm): Check for conversions. | 41 // TODO(vsm): Check for conversions. |
41 _check('samples/return_test'); | 42 _check('samples/return_test'); |
42 }); | 43 }); |
43 } | 44 } |
OLD | NEW |