// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. part of testrunner; /** Create and return an options parser for the test runner. */ ArgParser getOptionParser() { var parser = new ArgParser(); parser.addOption('help', abbr: '?', help: 'Show usage information.'); parser.addOption('runtime', abbr: 'r', defaultsTo: 'vm', help: 'Where the tests should be run.', allowed: ['vm', 'drt-dart', 'drt-js'], allowedHelp: { 'vm': 'Run Dart code natively on the standalone dart vm.', 'drt-dart': 'Run Dart code natively in the headless version of\n' 'Chrome, DumpRenderTree.', 'drt-js': 'Run Dart compiled to JavaScript in the headless version\n' 'of Chrome, DumpRenderTree.' }); parser.addFlag('checked', defaultsTo: false, help: 'Run tests in checked mode.'); parser.addFlag('layout-text', defaultsTo: false, help: 'Run text layout tests.'); parser.addFlag('layout-pixel', defaultsTo: false, help: 'Run pixel layout tests.'); parser.addOption('timeout', abbr: 't', help: 'Timeout in seconds', defaultsTo: '60'); parser.addOption('tasks', abbr: 'j', defaultsTo: Platform.numberOfProcessors.toString(), help: 'The number of parallel tasks to run.'); parser.addOption('out', abbr: 'o', defaultsTo: 'stdout', help: 'File to send test results. This should be a ' 'file name or one of stdout, stderr, or none.'); parser.addOption('list-format', defaultsTo: '', help: 'Format for test list result output.'); parser.addOption('pass-format', defaultsTo: 'PASS