| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 test.integration.analysis; | 5 library test.integration.analysis; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:convert'; | 9 import 'dart:convert'; |
| 10 import 'dart:io'; | 10 import 'dart:io'; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 initializeInttestMixin(); | 60 initializeInttestMixin(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 /** | 63 /** |
| 64 * Write a source file with the given absolute [pathname] and [contents]. | 64 * Write a source file with the given absolute [pathname] and [contents]. |
| 65 * | 65 * |
| 66 * If the file didn't previously exist, it is created. If it did, it is | 66 * If the file didn't previously exist, it is created. If it did, it is |
| 67 * overwritten. | 67 * overwritten. |
| 68 * | 68 * |
| 69 * Parent directories are created as necessary. | 69 * Parent directories are created as necessary. |
| 70 * |
| 71 * Return a normalized path to the file (with symbolic links resolved). |
| 70 */ | 72 */ |
| 71 void writeFile(String pathname, String contents) { | 73 String writeFile(String pathname, String contents) { |
| 72 new Directory(dirname(pathname)).createSync(recursive: true); | 74 new Directory(dirname(pathname)).createSync(recursive: true); |
| 73 new File(pathname).writeAsStringSync(contents); | 75 File file = new File(pathname); |
| 76 file.writeAsStringSync(contents); |
| 77 return file.resolveSymbolicLinksSync(); |
| 74 } | 78 } |
| 75 | 79 |
| 76 /** | 80 /** |
| 77 * Convert the given [relativePath] to an absolute path, by interpreting it | 81 * Convert the given [relativePath] to an absolute path, by interpreting it |
| 78 * relative to [sourceDirectory]. On Windows any forward slashes in | 82 * relative to [sourceDirectory]. On Windows any forward slashes in |
| 79 * [relativePath] are converted to backslashes. | 83 * [relativePath] are converted to backslashes. |
| 80 */ | 84 */ |
| 81 String sourcePath(String relativePath) { | 85 String sourcePath(String relativePath) { |
| 82 return join(sourceDirectory.path, relativePath.replaceAll('/', separator)); | 86 return join(sourceDirectory.path, relativePath.replaceAll('/', separator)); |
| 83 } | 87 } |
| (...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 864 */ | 868 */ |
| 865 void _recordStdio(String line) { | 869 void _recordStdio(String line) { |
| 866 double elapsedTime = _time.elapsedTicks / _time.frequency; | 870 double elapsedTime = _time.elapsedTicks / _time.frequency; |
| 867 line = "$elapsedTime: $line"; | 871 line = "$elapsedTime: $line"; |
| 868 if (_debuggingStdio) { | 872 if (_debuggingStdio) { |
| 869 print(line); | 873 print(line); |
| 870 } | 874 } |
| 871 _recordedStdio.add(line); | 875 _recordedStdio.add(line); |
| 872 } | 876 } |
| 873 } | 877 } |
| OLD | NEW |