| OLD | NEW |
| 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 16 matching lines...) Expand all Loading... |
| 27 File orig = new File(filename); | 27 File orig = new File(filename); |
| 28 File stubs = new File(stubsFile); | 28 File stubs = new File(stubsFile); |
| 29 Expect.isTrue(filename.endsWith(".dart")); | 29 Expect.isTrue(filename.endsWith(".dart")); |
| 30 String baseName = filename.substring(0, filename.length - 5); | 30 String baseName = filename.substring(0, filename.length - 5); |
| 31 String resultPath = '${baseName}-generatedTest.dart'; | 31 String resultPath = '${baseName}-generatedTest.dart'; |
| 32 File result = new File(resultPath); | 32 File result = new File(resultPath); |
| 33 StringInputStream origStream = | 33 StringInputStream origStream = |
| 34 new StringInputStream(orig.openInputStream()); | 34 new StringInputStream(orig.openInputStream()); |
| 35 StringInputStream stubsStream = | 35 StringInputStream stubsStream = |
| 36 new StringInputStream(stubs.openInputStream()); | 36 new StringInputStream(stubs.openInputStream()); |
| 37 FileOutputStream resultStream = result.openOutputStream(); | 37 OutputStream resultStream = result.openOutputStream(); |
| 38 var origLine; | 38 var origLine; |
| 39 | 39 |
| 40 void writeResultLine(String line) { | 40 void writeResultLine(String line) { |
| 41 resultStream.write(line.charCodes()); | 41 resultStream.write(line.charCodes()); |
| 42 resultStream.write('\n'.charCodes()); | 42 resultStream.write('\n'.charCodes()); |
| 43 } | 43 } |
| 44 | 44 |
| 45 // Step 3: Copy in the rest of the original file. | 45 // Step 3: Copy in the rest of the original file. |
| 46 void copyThirdPart() { | 46 void copyThirdPart() { |
| 47 origLine = origStream.readLine(); | 47 origLine = origStream.readLine(); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 String interfaceFile = splitIsolateStubsOptions[0]; | 137 String interfaceFile = splitIsolateStubsOptions[0]; |
| 138 String classes = splitIsolateStubsOptions[1]; | 138 String classes = splitIsolateStubsOptions[1]; |
| 139 generateTestCase(filename, interfaceFile, classes, (String filename) { | 139 generateTestCase(filename, interfaceFile, classes, (String filename) { |
| 140 createTestCase(filename, optionsFromFile['isNegative']); | 140 createTestCase(filename, optionsFromFile['isNegative']); |
| 141 testGeneratorDone(); | 141 testGeneratorDone(); |
| 142 }); | 142 }); |
| 143 } | 143 } |
| 144 } | 144 } |
| 145 } | 145 } |
| 146 } | 146 } |
| OLD | NEW |