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

Side by Side Diff: test/run_all.dart

Issue 12096106: work in progress: observable implementation using detailed change records (Closed) Base URL: https://github.com/dart-lang/web-ui.git@master
Patch Set: Created 7 years, 10 months 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
« no previous file with comments | « test/observe_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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:async'; 11 import 'dart:async';
12 import 'dart:io'; 12 import 'dart:io';
13 import 'dart:utf' show encodeUtf8; 13 import 'dart:utf' show encodeUtf8;
14 import 'dart:isolate'; 14 import 'dart:isolate';
15 import 'package:unittest/compact_vm_config.dart'; 15 import 'package:unittest/compact_vm_config.dart';
16 import 'package:unittest/unittest.dart'; 16 import 'package:unittest/unittest.dart';
17 import 'package:web_ui/dwc.dart' as dwc; 17 import 'package:web_ui/dwc.dart' as dwc;
18 18
19 import 'analyzer_test.dart' as analyzer_test; 19 import 'analyzer_test.dart' as analyzer_test;
20 import 'compiler_test.dart' as compiler_test; 20 import 'compiler_test.dart' as compiler_test;
21 import 'directive_parser_test.dart' as directive_test; 21 import 'directive_parser_test.dart' as directive_test;
22 import 'emitter_test.dart' as emitter_test; 22 import 'emitter_test.dart' as emitter_test;
23 import 'html5_utils_test.dart' as html5_utils_test; 23 import 'html5_utils_test.dart' as html5_utils_test;
24 import 'html_cleaner_test.dart' as html_cleaner_test; 24 import 'html_cleaner_test.dart' as html_cleaner_test;
25 import 'observe_test.dart' as observe_test;
25 import 'path_info_test.dart' as path_info_test; 26 import 'path_info_test.dart' as path_info_test;
26 import 'utils_test.dart' as utils_test; 27 import 'utils_test.dart' as utils_test;
27 import 'watcher_test.dart' as watcher_test; 28 import 'watcher_test.dart' as watcher_test;
28 29
29 main() { 30 main() {
30 var args = new Options().arguments; 31 var args = new Options().arguments;
31 var pattern = new RegExp(args.length > 0 ? args[0] : '.'); 32 var pattern = new RegExp(args.length > 0 ? args[0] : '.');
32 33
33 useCompactVMConfiguration(); 34 useCompactVMConfiguration();
34 35
35 void addGroup(testFile, testMain) { 36 void addGroup(testFile, testMain) {
36 if (pattern.hasMatch(testFile)) { 37 if (pattern.hasMatch(testFile)) {
37 group(testFile.replaceAll('_test.dart', ':'), testMain); 38 group(testFile.replaceAll('_test.dart', ':'), testMain);
38 } 39 }
39 } 40 }
40 41
41 addGroup('analyzer_test.dart', analyzer_test.main); 42 addGroup('analyzer_test.dart', analyzer_test.main);
42 addGroup('compiler_test.dart', compiler_test.main); 43 addGroup('compiler_test.dart', compiler_test.main);
43 addGroup('directive_parser_test.dart', directive_test.main); 44 addGroup('directive_parser_test.dart', directive_test.main);
44 addGroup('emitter_test.dart', emitter_test.main); 45 addGroup('emitter_test.dart', emitter_test.main);
45 addGroup('html5_utils_test.dart', html5_utils_test.main); 46 addGroup('html5_utils_test.dart', html5_utils_test.main);
46 addGroup('html_cleaner_test.dart', html_cleaner_test.main); 47 addGroup('html_cleaner_test.dart', html_cleaner_test.main);
48 addGroup('observe_test.dart', observe_test.main);
47 addGroup('path_info_test.dart', path_info_test.main); 49 addGroup('path_info_test.dart', path_info_test.main);
48 addGroup('utils_test.dart', utils_test.main); 50 addGroup('utils_test.dart', utils_test.main);
49 addGroup('watcher_test.dart', watcher_test.main); 51 addGroup('watcher_test.dart', watcher_test.main);
50 52
51 // TODO(jmesserly): should have listSync for scripting... 53 // TODO(jmesserly): should have listSync for scripting...
52 var lister = new Directory.fromPath(new Path('data/input')).list(); 54 var lister = new Directory.fromPath(new Path('data/input')).list();
53 var cwd = new Path(new Directory.current().path); 55 var cwd = new Path(new Directory.current().path);
54 var inputDir = cwd.append('data/input'); 56 var inputDir = cwd.append('data/input');
55 lister.onFile = (path) { 57 lister.onFile = (path) {
56 if (!path.endsWith('_test.html') || !pattern.hasMatch(path)) return; 58 if (!path.endsWith('_test.html') || !pattern.hasMatch(path)) return;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 Future _writeFile(String path, String text) { 100 Future _writeFile(String path, String text) {
99 return new File(path).open(FileMode.WRITE) 101 return new File(path).open(FileMode.WRITE)
100 .then((file) => file.writeString(text)) 102 .then((file) => file.writeString(text))
101 .then((file) => file.close()); 103 .then((file) => file.close());
102 } 104 }
103 105
104 Future<int> _diff(expectedPath, outputPath) { 106 Future<int> _diff(expectedPath, outputPath) {
105 return Process.run('diff', ['-q', expectedPath, outputPath]) 107 return Process.run('diff', ['-q', expectedPath, outputPath])
106 .then((res) => res.exitCode); 108 .then((res) => res.exitCode);
107 } 109 }
OLDNEW
« no previous file with comments | « test/observe_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698