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

Side by Side Diff: tests/stub-generator/test_config.dart

Issue 9195017: Generate stub-generator tests in the build directory, and do not commit them to repository. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add code for the unlikely case that these are the first tests run in a new checkout. 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 | « tests/stub-generator/src/MintMakerPromiseWithStubsTest.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) 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 12 matching lines...) Expand all
23 23
24 bool get requiresCleanTemporaryDirectory() => true; 24 bool get requiresCleanTemporaryDirectory() => true;
25 25
26 void combineFiles(String filename, 26 void combineFiles(String filename,
27 String stubsFile, 27 String stubsFile,
28 Function onGenerated) { 28 Function onGenerated) {
29 File orig = new File(filename); 29 File orig = new File(filename);
30 File stubs = new File(stubsFile); 30 File stubs = new File(stubsFile);
31 Expect.isTrue(filename.endsWith(".dart")); 31 Expect.isTrue(filename.endsWith(".dart"));
32 String baseName = filename.substring(0, filename.length - 5); 32 String baseName = filename.substring(0, filename.length - 5);
33 String resultPath = '${baseName}-generatedTest.dart'; 33 // Find place in the buildDir at the same relative level as the test.
34 String resultPath = TestUtils.buildDir(configuration);
35 String relativeImportPath = '../../../tests/isolate/src/TestFramework.dart';
36 if (!new File('$resultPath/$relativeImportPath').existsSync()) {
37 resultPath = '$resultPath/generated_tests';
38 if (!new Directory(resultPath).existsSync()) {
39 new Directory(resultPath).createSync();
40 }
41 if (!new File('$resultPath/$relativeImportPath').existsSync()) {
42 throw new Exception('Cannot find $relativeImportPath from $resultPath');
ricow1 2012/01/23 13:31:01 actually we can't find relativeImportPath from nei
43 }
44 }
45 int testNamePos = filename.lastIndexOf('/');
46 resultPath = '$resultPath/${filename.substring(testNamePos+1)}';
ricow1 2012/01/23 13:31:01 space around +
34 File result = new File(resultPath); 47 File result = new File(resultPath);
35 StringInputStream origStream = 48 StringInputStream origStream =
36 new StringInputStream(orig.openInputStream()); 49 new StringInputStream(orig.openInputStream());
37 StringInputStream stubsStream = 50 StringInputStream stubsStream =
38 new StringInputStream(stubs.openInputStream()); 51 new StringInputStream(stubs.openInputStream());
39 OutputStream resultStream = result.openOutputStream(); 52 OutputStream resultStream = result.openOutputStream();
40 var origLine; 53 var origLine;
41 54
42 void writeResultLine(String line) { 55 void writeResultLine(String line) {
43 resultStream.write(line.charCodes()); 56 resultStream.write(line.charCodes());
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 String interfaceFile = splitIsolateStubsOptions[0]; 153 String interfaceFile = splitIsolateStubsOptions[0];
141 String classes = splitIsolateStubsOptions[1]; 154 String classes = splitIsolateStubsOptions[1];
142 generateTestCase(filename, interfaceFile, classes, (String filename) { 155 generateTestCase(filename, interfaceFile, classes, (String filename) {
143 createTestCase(filename, optionsFromFile['isNegative']); 156 createTestCase(filename, optionsFromFile['isNegative']);
144 testGeneratorDone(); 157 testGeneratorDone();
145 }); 158 });
146 } 159 }
147 } 160 }
148 } 161 }
149 } 162 }
OLDNEW
« no previous file with comments | « tests/stub-generator/src/MintMakerPromiseWithStubsTest.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698