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: tests/stub-generator/test_config.dart

Issue 9250009: Fix test.dart on Windows: change all backslashes to slashes eagerly. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix error in stub_generator/test_config.dart Created 8 years, 11 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 | « no previous file | tools/testing/dart/test_suite.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 #library("stub_generator_test_config"); 5 #library("stub_generator_test_config");
6 6
7 #import("../../tools/testing/dart/test_suite.dart"); 7 #import("../../tools/testing/dart/test_suite.dart");
8 8
9 class StubGeneratorTestSuite extends StandardTestSuite { 9 class StubGeneratorTestSuite extends StandardTestSuite {
10 String dartcPath; 10 String dartcPath;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 resultStream.close(); 94 resultStream.close();
95 onGenerated(resultPath); 95 onGenerated(resultPath);
96 }; 96 };
97 } 97 }
98 98
99 void generateTestCase(String filename, 99 void generateTestCase(String filename,
100 String interfaceFile, 100 String interfaceFile,
101 String classes, 101 String classes,
102 Function onGenerated) { 102 Function onGenerated) {
103 testGeneratorStarted(); 103 testGeneratorStarted();
104 Directory temp = createOutputDirectory(interfaceFile, ''); 104 Directory temp = createOutputDirectory(filename, 'stub_generator');
105 105
106 File stubsOutFile = new File("${temp.path}/${interfaceFile}"); 106 File stubsOutFile = new File("${temp.path}/${interfaceFile}");
107 stubsOutFile.createSync(); 107 stubsOutFile.createSync();
108 String stubsPath = stubsOutFile.fullPathSync(); 108 String stubsPath = stubsOutFile.fullPathSync();
109 List<String> args = [filename, 109 List<String> args = [filename,
110 '-noincremental', 110 '-noincremental',
111 '-out', temp.path, 111 '-out', temp.path,
112 '-isolate-stub-out', stubsPath, 112 '-isolate-stub-out', stubsPath,
113 '-generate-isolate-stubs', classes ]; 113 '-generate-isolate-stubs', classes ];
114 if (configuration['verbose']) { 114 if (configuration['verbose']) {
115 print("# $dartcPath ${Strings.join(args, ' ')}"); 115 print("# $dartcPath ${Strings.join(args, ' ')}");
116 } 116 }
117 Process dartcProcess = new Process.start(dartcPath, args); 117 Process dartcProcess = new Process.start(dartcPath, args);
118 dartcProcess.exitHandler = (int exitCode) { 118 dartcProcess.exitHandler = (int exitCode) {
119 combineFiles(filename, stubsPath, onGenerated); 119 combineFiles(filename, stubsPath, onGenerated);
120 }; 120 };
121 } 121 }
122 122
123 void processFile(String filename) { 123 void processFile(String filename) {
124 filename = filename.replaceAll('\\', '/') ;
124 // Only run the tests that match the pattern. 125 // Only run the tests that match the pattern.
125 RegExp pattern = configuration['selectors'][suiteName]; 126 RegExp pattern = configuration['selectors'][suiteName];
126 if (!pattern.hasMatch(filename)) return; 127 if (!pattern.hasMatch(filename)) return;
127 var optionsFromFile = optionsFromFile(filename); 128 var optionsFromFile = optionsFromFile(filename);
128 Function createTestCase = makeTestCaseCreator(optionsFromFile); 129 Function createTestCase = makeTestCaseCreator(optionsFromFile);
129 130
130 if (filename.endsWith("-generatedTest.dart")) { 131 if (filename.endsWith("-generatedTest.dart")) {
131 if (dartcPath == null) { 132 if (dartcPath == null) {
132 createTestCase(filename, optionsFromFile['isNegative']); 133 createTestCase(filename, optionsFromFile['isNegative']);
133 } 134 }
134 } else if (filename.endsWith("Test.dart")) { 135 } else if (filename.endsWith("Test.dart")) {
135 if (dartcPath != null) { 136 if (dartcPath != null) {
136 String isolateStubsOptions = optionsFromFile['isolateStubs']; 137 String isolateStubsOptions = optionsFromFile['isolateStubs'];
137 List<String> splitIsolateStubsOptions = isolateStubsOptions.split(':'); 138 List<String> splitIsolateStubsOptions = isolateStubsOptions.split(':');
138 Expect.equals(2, splitIsolateStubsOptions.length); 139 Expect.equals(2, splitIsolateStubsOptions.length);
139 String interfaceFile = splitIsolateStubsOptions[0]; 140 String interfaceFile = splitIsolateStubsOptions[0];
140 String classes = splitIsolateStubsOptions[1]; 141 String classes = splitIsolateStubsOptions[1];
141 generateTestCase(filename, interfaceFile, classes, (String filename) { 142 generateTestCase(filename, interfaceFile, classes, (String filename) {
142 createTestCase(filename, optionsFromFile['isNegative']); 143 createTestCase(filename, optionsFromFile['isNegative']);
143 testGeneratorDone(); 144 testGeneratorDone();
144 }); 145 });
145 } 146 }
146 } 147 }
147 } 148 }
148 } 149 }
OLDNEW
« no previous file with comments | « no previous file | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698