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:
whesse@google.com 2013-10-30 15:58:52 +00:00
parent 5e412b79d2
commit 8a86fc897f
10 changed files with 18 additions and 24 deletions

View file

@ -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;

View file

@ -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];

View file

@ -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];

View file

@ -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']);

View file

@ -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++) {

View file

@ -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 "
@ -354,7 +353,7 @@ void sanitizeConfig(Map config, ArgParser parser) {
'$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}dart2js';
config['dart'] = '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}dart';
config['pub'] = '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}pub';
config['drt'] =
config['drt'] =
'$dartsdk/chromium/Content Shell.app/Contents/MacOS/Content Shell';
} else if (Platform.operatingSystem == 'linux') {
config['dart2js'] =
@ -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);

View file

@ -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));
}

View file

@ -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);
}
}

View file

@ -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,

View file

@ -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");