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

Side by Side Diff: packages/charted/tool/hop_runner.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 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
OLDNEW
(Empty)
1 //
2 // Copyright 2014 Google Inc. All rights reserved.
3 //
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file or at
6 // https://developers.google.com/open-source/licenses/bsd
7 //
8
9 library charted.tool.hop_runner;
10
11 import 'package:hop/hop.dart';
12 import 'dart:io';
13
14 main(List<String> args) {
15 addTask('unit-test', createUnitTestsTask());
16 runHop(args);
17 }
18
19 Task createUnitTestsTask() =>
20 new Task((TaskContext context) {
21 context.info("Running tests...");
22 return Process.run('./content_shell',
23 ['--dump-render-tree','test/test_in_browser.html']).
24 then((ProcessResult process) =>
25 checkTestsOutput(context, process));
26 });
27
28 /// Reads the output from content_shell and checks for number of tests
29 /// passed/failed/erred. This method requires that the tests be done
30 /// in simple html unit test configuration - useHtmlConfiguration().
31 void checkTestsOutput(TaskContext context, ProcessResult process) {
32 var output = (process.stdout as String),
33 failRegEx = new RegExp(r"^[0-9]+\s+FAIL\s"),
34 errorRegEx = new RegExp(r"^[0-9]+\s+ERROR\s"),
35 failCount = 0,
36 errorCount = 0;
37
38 context.info(output);
39
40 for (var line in output.split('\n')) {
41 if (line.contains(failRegEx)) failCount++;
42 if (line.contains(errorRegEx)) errorCount++;
43 }
44
45 if (failCount + errorCount > 0) {
46 context.fail('FAIL: $failCount\nERROR: $errorCount');
47 }
48 }
OLDNEW
« no previous file with comments | « packages/charted/tool/build_unicode_segmentation_data.dart ('k') | packages/cli_util/.gitignore » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698