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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/stub-generator/src/MintMakerPromiseWithStubsTest.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/stub-generator/test_config.dart
diff --git a/tests/stub-generator/test_config.dart b/tests/stub-generator/test_config.dart
index 8d1f2887668f8c0276aea69e9c8c6252adf640cb..837647a5bba95f2572bb6e8ba32993cc3bafc2a8 100644
--- a/tests/stub-generator/test_config.dart
+++ b/tests/stub-generator/test_config.dart
@@ -30,7 +30,20 @@ class StubGeneratorTestSuite extends StandardTestSuite {
File stubs = new File(stubsFile);
Expect.isTrue(filename.endsWith(".dart"));
String baseName = filename.substring(0, filename.length - 5);
- String resultPath = '${baseName}-generatedTest.dart';
+ // Find place in the buildDir at the same relative level as the test.
+ String resultPath = TestUtils.buildDir(configuration);
+ String relativeImportPath = '../../../tests/isolate/src/TestFramework.dart';
+ if (!new File('$resultPath/$relativeImportPath').existsSync()) {
+ resultPath = '$resultPath/generated_tests';
+ if (!new Directory(resultPath).existsSync()) {
+ new Directory(resultPath).createSync();
+ }
+ if (!new File('$resultPath/$relativeImportPath').existsSync()) {
+ throw new Exception('Cannot find $relativeImportPath from $resultPath');
ricow1 2012/01/23 13:31:01 actually we can't find relativeImportPath from nei
+ }
+ }
+ int testNamePos = filename.lastIndexOf('/');
+ resultPath = '$resultPath/${filename.substring(testNamePos+1)}';
ricow1 2012/01/23 13:31:01 space around +
File result = new File(resultPath);
StringInputStream origStream =
new StringInputStream(orig.openInputStream());
« 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