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

Side by Side Diff: tools/testing/dart/browser_test.dart

Issue 10627008: Added the ability to filter which tests are run by name, using a --filter (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « lib/unittest/unittest.dart ('k') | tools/testing/dart/test_options.dart » ('j') | 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 String GetHtmlContents(String title, 5 String GetHtmlContents(String title,
6 String controllerScript, 6 String controllerScript,
7 String scriptType, 7 String scriptType,
8 String sourceScript) => 8 String sourceScript) =>
9 """ 9 """
10 <!DOCTYPE html> 10 <!DOCTYPE html>
(...skipping 30 matching lines...) Expand all
41 } 41 }
42 return path.replaceAll('\\', '/'); 42 return path.replaceAll('\\', '/');
43 } 43 }
44 44
45 String WrapDartTestInLibrary(String test) => 45 String WrapDartTestInLibrary(String test) =>
46 """ 46 """
47 #library('libraryWrapper'); 47 #library('libraryWrapper');
48 #source('${nativePathToUri(test)}'); 48 #source('${nativePathToUri(test)}');
49 """; 49 """;
50 50
51 String DartTestWrapper(String dartHome, String library) { 51 String DartTestWrapper(String dartHome, String library, String filter) {
52 dartHome = nativePathToUri(dartHome); 52 dartHome = nativePathToUri(dartHome);
53 library = nativePathToUri(library); 53 library = nativePathToUri(library);
54 return """ 54 return """
55 #library('test'); 55 #library('test');
56 56
57 #import('${dartHome}/lib/unittest/unittest.dart', prefix: 'unittest'); 57 #import('${dartHome}/lib/unittest/unittest.dart', prefix: 'unittest');
58 #import('${dartHome}/lib/unittest/html_config.dart', prefix: 'config'); 58 #import('${dartHome}/lib/unittest/html_config.dart', prefix: 'config');
59 59
60 #import('${library}', prefix: "Test"); 60 #import('${library}', prefix: "Test");
61 61
62 main() { 62 main() {
63 config.useHtmlConfiguration(); 63 config.useHtmlConfiguration();
64 try { 64 try {
65 unittest.ensureInitialized(); 65 unittest.ensureInitialized();
66 unittest.setFilter('$filter');
66 Test.main(); 67 Test.main();
67 } catch(var e, var trace) { 68 } catch(var e, var trace) {
68 unittest.reportTestError( 69 unittest.reportTestError(
69 e.toString(), trace == null ? '' : trace.toString()); 70 e.toString(), trace == null ? '' : trace.toString());
70 } 71 }
71 } 72 }
72 """; 73 """;
73 } 74 }
OLDNEW
« no previous file with comments | « lib/unittest/unittest.dart ('k') | tools/testing/dart/test_options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698