| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
| 6 * This is a helper for run.sh. We try to run all of the Dart code in one | 6 * This is a helper for run.sh. We try to run all of the Dart code in one |
| 7 * instance of the Dart VM to reduce warm-up time. | 7 * instance of the Dart VM to reduce warm-up time. |
| 8 */ | 8 */ |
| 9 library run_impl; | 9 library run_impl; |
| 10 | 10 |
| 11 import 'dart:io'; | 11 import 'dart:io'; |
| 12 import 'package:unittest/compact_vm_config.dart'; | 12 import 'package:unittest/compact_vm_config.dart'; |
| 13 import 'package:unittest/unittest.dart'; | 13 import 'package:unittest/unittest.dart'; |
| 14 import 'package:polymer/testing/content_shell_test.dart'; | 14 import 'package:polymer/testing/content_shell_test.dart'; |
| 15 | 15 |
| 16 import 'css_test.dart' as css_test; | 16 import 'css_test.dart' as css_test; |
| 17 import 'compiler_test.dart' as compiler_test; | 17 import 'compiler_test.dart' as compiler_test; |
| 18 import 'paths_test.dart' as paths_test; | 18 import 'paths_test.dart' as paths_test; |
| 19 import 'utils_test.dart' as utils_test; | 19 import 'utils_test.dart' as utils_test; |
| 20 import 'transform/code_extractor_test.dart' as code_extractor_test; |
| 21 import 'transform/import_inliner_test.dart' as import_inliner_test; |
| 22 import 'transform/script_compactor_test.dart' as script_compactor_test; |
| 20 | 23 |
| 21 main() { | 24 main() { |
| 22 var args = new Options().arguments; | 25 var args = new Options().arguments; |
| 23 var pattern = new RegExp(args.length > 0 ? args[0] : '.'); | 26 var pattern = new RegExp(args.length > 0 ? args[0] : '.'); |
| 24 | 27 |
| 25 useCompactVMConfiguration(); | 28 useCompactVMConfiguration(); |
| 26 | 29 |
| 27 void addGroup(testFile, testMain) { | 30 void addGroup(testFile, testMain) { |
| 28 if (pattern.hasMatch(testFile)) { | 31 if (pattern.hasMatch(testFile)) { |
| 29 group(testFile.replaceAll('_test.dart', ':'), testMain); | 32 group(testFile.replaceAll('_test.dart', ':'), testMain); |
| 30 } | 33 } |
| 31 } | 34 } |
| 32 | 35 |
| 33 addGroup('compiler_test.dart', compiler_test.main); | 36 addGroup('compiler_test.dart', compiler_test.main); |
| 34 addGroup('css_test.dart', css_test.main); | 37 addGroup('css_test.dart', css_test.main); |
| 35 addGroup('paths_test.dart', paths_test.main); | 38 addGroup('paths_test.dart', paths_test.main); |
| 36 addGroup('utils_test.dart', utils_test.main); | 39 addGroup('utils_test.dart', utils_test.main); |
| 40 addGroup('transform/code_extractor_test.dart', code_extractor_test.main); |
| 41 addGroup('transform/import_inliner_test.dart', import_inliner_test.main); |
| 42 addGroup('transform/script_compactor_test.dart', script_compactor_test.main); |
| 37 | 43 |
| 38 endToEndTests('data/unit/', 'data/out'); | 44 endToEndTests('data/unit/', 'data/out'); |
| 39 | 45 |
| 40 // Note: if you're adding more render test suites, make sure to update run.sh | 46 // Note: if you're adding more render test suites, make sure to update run.sh |
| 41 // as well for convenient baseline diff/updating. | 47 // as well for convenient baseline diff/updating. |
| 42 | 48 |
| 43 // TODO(jmesserly): figure out why this fails in content_shell but works in | 49 // TODO(jmesserly): figure out why this fails in content_shell but works in |
| 44 // Dartium and Firefox when using the ShadowDOM polyfill. | 50 // Dartium and Firefox when using the ShadowDOM polyfill. |
| 45 exampleTest('../example/component/news', ['--no-shadowdom']..addAll(args)); | 51 exampleTest('../example/component/news', ['--no-shadowdom']..addAll(args)); |
| 46 | 52 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 69 arguments: args, pattern: pattern, deleteDir: deleteDirectory); | 75 arguments: args, pattern: pattern, deleteDir: deleteDirectory); |
| 70 } | 76 } |
| 71 | 77 |
| 72 void cssCompileShadowDOMTest(String path, String pattern, | 78 void cssCompileShadowDOMTest(String path, String pattern, |
| 73 [bool deleteDirectory = true]) { | 79 [bool deleteDirectory = true]) { |
| 74 var args = ['--no-css']; | 80 var args = ['--no-css']; |
| 75 renderTests(path, path, '$path/expected', '$path/out', | 81 renderTests(path, path, '$path/expected', '$path/out', |
| 76 arguments: args, pattern: pattern, | 82 arguments: args, pattern: pattern, |
| 77 deleteDir: deleteDirectory); | 83 deleteDir: deleteDirectory); |
| 78 } | 84 } |
| OLD | NEW |