| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
| 6 * Test infrastructure for testing pub. Unlike typical unit tests, most pub | 6 * Test infrastructure for testing pub. Unlike typical unit tests, most pub |
| 7 * tests are integration tests that stage some stuff on the file system, run | 7 * tests are integration tests that stage some stuff on the file system, run |
| 8 * pub, and then validate the results. This library provides an API to build | 8 * pub, and then validate the results. This library provides an API to build |
| 9 * tests like that. | 9 * tests like that. |
| 10 */ | 10 */ |
| 11 #library('test_pub'); | 11 library test_pub; |
| 12 | 12 |
| 13 #import('dart:io'); | 13 import 'dart:io'; |
| 14 #import('dart:isolate'); | 14 import 'dart:isolate'; |
| 15 #import('dart:json'); | 15 import 'dart:json'; |
| 16 #import('dart:math'); | 16 import 'dart:math'; |
| 17 #import('dart:uri'); | 17 import 'dart:uri'; |
| 18 | 18 |
| 19 #import('../../../pkg/unittest/unittest.dart'); | 19 import '../../../pkg/unittest/unittest.dart'; |
| 20 #import('../../lib/file_system.dart', prefix: 'fs'); | 20 import '../../lib/file_system.dart' as fs; |
| 21 #import('../../pub/git_source.dart'); | 21 import '../../pub/git_source.dart'; |
| 22 #import('../../pub/hosted_source.dart'); | 22 import '../../pub/hosted_source.dart'; |
| 23 #import('../../pub/io.dart'); | 23 import '../../pub/io.dart'; |
| 24 #import('../../pub/sdk_source.dart'); | 24 import '../../pub/sdk_source.dart'; |
| 25 #import('../../pub/utils.dart'); | 25 import '../../pub/utils.dart'; |
| 26 #import('../../pub/yaml/yaml.dart'); | 26 import '../../pub/yaml/yaml.dart'; |
| 27 | 27 |
| 28 /** | 28 /** |
| 29 * Creates a new [FileDescriptor] with [name] and [contents]. | 29 * Creates a new [FileDescriptor] with [name] and [contents]. |
| 30 */ | 30 */ |
| 31 FileDescriptor file(Pattern name, String contents) => | 31 FileDescriptor file(Pattern name, String contents) => |
| 32 new FileDescriptor(name, contents); | 32 new FileDescriptor(name, contents); |
| 33 | 33 |
| 34 /** | 34 /** |
| 35 * Creates a new [DirectoryDescriptor] with [name] and [contents]. | 35 * Creates a new [DirectoryDescriptor] with [name] and [contents]. |
| 36 */ | 36 */ |
| (...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1202 } | 1202 } |
| 1203 | 1203 |
| 1204 /** | 1204 /** |
| 1205 * Schedules a callback to be called after Pub is run with [runPub], even if it | 1205 * Schedules a callback to be called after Pub is run with [runPub], even if it |
| 1206 * fails. | 1206 * fails. |
| 1207 */ | 1207 */ |
| 1208 void _scheduleCleanup(_ScheduledEvent event) { | 1208 void _scheduleCleanup(_ScheduledEvent event) { |
| 1209 if (_scheduledCleanup == null) _scheduledCleanup = []; | 1209 if (_scheduledCleanup == null) _scheduledCleanup = []; |
| 1210 _scheduledCleanup.add(event); | 1210 _scheduledCleanup.add(event); |
| 1211 } | 1211 } |
| OLD | NEW |