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()); |