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

Side by Side Diff: lib/src/runner/configuration/load.dart

Issue 1704183002: pkg/test: cleanup imports (Closed) Base URL: https://github.com/dart-lang/test.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « lib/src/runner/configuration/args.dart ('k') | lib/src/runner/engine.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 import 'dart:io'; 5 import 'dart:io';
6 6
7 import 'package:glob/glob.dart'; 7 import 'package:glob/glob.dart';
8 import 'package:path/path.dart' as p; 8 import 'package:path/path.dart' as p;
9 import 'package:source_span/source_span.dart'; 9 import 'package:source_span/source_span.dart';
10 import 'package:yaml/yaml.dart'; 10 import 'package:yaml/yaml.dart';
11 11
12 import '../../backend/test_platform.dart';
13 import '../../frontend/timeout.dart';
12 import '../../utils.dart'; 14 import '../../utils.dart';
13 import '../../frontend/timeout.dart';
14 import '../../backend/test_platform.dart';
15 import '../configuration.dart'; 15 import '../configuration.dart';
16 import 'values.dart'; 16 import 'values.dart';
17 17
18 /// Loads configuration information from a YAML file at [path]. 18 /// Loads configuration information from a YAML file at [path].
19 /// 19 ///
20 /// Throws a [FormatException] if the configuration is invalid, and a 20 /// Throws a [FormatException] if the configuration is invalid, and a
21 /// [FileSystemException] if it can't be read. 21 /// [FileSystemException] if it can't be read.
22 Configuration load(String path) { 22 Configuration load(String path) {
23 var source = new File(path).readAsStringSync(); 23 var source = new File(path).readAsStringSync();
24 var document = loadYamlNode(source, sourceUrl: p.toUri(path)); 24 var document = loadYamlNode(source, sourceUrl: p.toUri(path));
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 if (!_document.containsKey(field)) return; 257 if (!_document.containsKey(field)) return;
258 _error("$field isn't supported here.", field); 258 _error("$field isn't supported here.", field);
259 } 259 }
260 260
261 /// Throws a [SourceSpanFormatException] with [message] about [field]. 261 /// Throws a [SourceSpanFormatException] with [message] about [field].
262 void _error(String message, String field) { 262 void _error(String message, String field) {
263 throw new SourceSpanFormatException( 263 throw new SourceSpanFormatException(
264 message, _document.nodes[field].span, _source); 264 message, _document.nodes[field].span, _source);
265 } 265 }
266 } 266 }
OLDNEW
« no previous file with comments | « lib/src/runner/configuration/args.dart ('k') | lib/src/runner/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698