mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 22:00:09 +00:00
Remove uses of Options from utils directory.
BUG= R=sgjesse@google.com Review URL: https://codereview.chromium.org//46673003 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29560 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
5e412b79d2
commit
8a86fc897f
|
@ -30,9 +30,7 @@ import 'package:path/path.dart' as path;
|
|||
|
||||
HtmlDiff _diff;
|
||||
|
||||
void main() {
|
||||
final args = new Options().arguments;
|
||||
|
||||
void main(List<String> args) {
|
||||
int mode = MODE_STATIC;
|
||||
String outputDir = 'docs';
|
||||
bool generateAppCache = false;
|
||||
|
|
|
@ -28,8 +28,7 @@ printStats(num elapsed, [String filename = '']) {
|
|||
/**
|
||||
* Run from the `utils/css` directory.
|
||||
*/
|
||||
void main() {
|
||||
var optionArgs = new Options().arguments;
|
||||
void main(List<String> optionsArgs) {
|
||||
assert(optionArgs.length == 2);
|
||||
|
||||
String sourceFullFn = optionArgs[0];
|
||||
|
|
|
@ -31,11 +31,9 @@ printStats(String phase, num elapsed, [String filename = '']) {
|
|||
/**
|
||||
* Run from the `utils/css` directory.
|
||||
*/
|
||||
void main() {
|
||||
void main(List<String> optionArgs) {
|
||||
// argument 0 - sourcefile full path
|
||||
// argument 1 - outputfile full path
|
||||
var optionArgs = new Options().arguments;
|
||||
|
||||
String sourceFullFn = optionArgs[0];
|
||||
String outputFullFn = optionArgs[1];
|
||||
|
||||
|
|
|
@ -6,10 +6,10 @@ library http_server_runner;
|
|||
import 'dart:io';
|
||||
import 'http_server.dart';
|
||||
|
||||
main() {
|
||||
main(List<String> arguments) {
|
||||
var optionsParser = getOptionParser();
|
||||
try {
|
||||
var argResults = optionsParser.parse(new Options().arguments);
|
||||
var argResults = optionsParser.parse(arguments);
|
||||
var server = new HttpTestServer(
|
||||
int.parse(argResults['port']),
|
||||
argResults['root']);
|
||||
|
|
|
@ -195,7 +195,7 @@ printOptions(ArgParser parser, ArgResults arguments,
|
|||
* current directory, a test config file specified with --configfile on
|
||||
* the command line, and other arguments specified on the command line.
|
||||
*/
|
||||
ArgResults loadConfiguration(optionsParser) {
|
||||
ArgResults loadConfiguration(optionsParser, List<String> commandLineArgs) {
|
||||
var options = new List();
|
||||
// We first load options from a test.config file in the working directory.
|
||||
options.addAll(getFileContents('test.config', false).
|
||||
|
@ -203,7 +203,6 @@ ArgResults loadConfiguration(optionsParser) {
|
|||
// Next we look to see if the command line included a -testconfig argument,
|
||||
// and if so, load options from that file too; where these are not
|
||||
// multi-valued they will take precedence over the ones in test.config.
|
||||
var commandLineArgs = new Options().arguments;
|
||||
var cfgarg = '--configfile';
|
||||
var cfgarge = '--configfile=';
|
||||
for (var i = 0; i < commandLineArgs.length; i++) {
|
||||
|
|
|
@ -339,8 +339,7 @@ void sanitizeConfig(Map config, ArgParser parser) {
|
|||
var pathSep = Platform.pathSeparator;
|
||||
|
||||
if (dartsdk == null) {
|
||||
var opt = new Options();
|
||||
var runner = opt.executable;
|
||||
var runner = Platform.executable;
|
||||
var idx = runner.indexOf('dart-sdk');
|
||||
if (idx < 0) {
|
||||
print("Please use --dartsdk option or run using the dart executable "
|
||||
|
@ -378,9 +377,9 @@ void sanitizeConfig(Map config, ArgParser parser) {
|
|||
config['exclude'] = normalizeFilter(config['exclude']);
|
||||
}
|
||||
|
||||
main() {
|
||||
main(List<String> arguments) {
|
||||
var optionsParser = getOptionParser();
|
||||
var options = loadConfiguration(optionsParser);
|
||||
var options = loadConfiguration(optionsParser, arguments);
|
||||
if (isSane(options)) {
|
||||
if (options['list-options']) {
|
||||
printOptions(optionsParser, options, false, stdout);
|
||||
|
|
|
@ -93,7 +93,7 @@ List buildFileList(List dirs, RegExp filePat, bool recurse,
|
|||
*/
|
||||
|
||||
String get runnerDirectory {
|
||||
var libDirectory = makePathAbsolute(new Options().script);
|
||||
var libDirectory = makePathAbsolute(new Platform.script);
|
||||
return libDirectory.substring(0,
|
||||
libDirectory.lastIndexOf(Platform.pathSeparator));
|
||||
}
|
||||
|
|
|
@ -196,10 +196,11 @@ class TestReport {
|
|||
}
|
||||
|
||||
class Runner {
|
||||
static List<String> arguments; // Set by main.
|
||||
|
||||
static bool runTest(String testId) {
|
||||
Options opts = new Options();
|
||||
return opts.arguments.length == 0 ||
|
||||
opts.arguments.any((String id) => id == testId);
|
||||
return arguments.length == 0 ||
|
||||
arguments.any((String id) => id == testId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,8 @@ import 'dart:math' as Math;
|
|||
import '../../../lib/convert/convert.dart' as SE;
|
||||
part 'benchmark_runner.dart';
|
||||
|
||||
void main() {
|
||||
void main(List<String> arguments) {
|
||||
Runner.arguments = arguments;
|
||||
|
||||
final List<int> testEnglishUtf8 = const<int> [
|
||||
0x54, 0x68, 0x65, 0x20, 0x71, 0x75, 0x69, 0x63,
|
||||
|
|
|
@ -103,8 +103,7 @@ Future runTest(
|
|||
skip_group(_1,_2) {}
|
||||
|
||||
main() {
|
||||
var opt = new Options();
|
||||
dart = opt.executable;
|
||||
dart = Platform.executable;
|
||||
var idx = dart.indexOf('dart-sdk');
|
||||
if (idx < 0) {
|
||||
print("Please run using the dart executable from the Dart SDK");
|
||||
|
|
Loading…
Reference in a new issue