| 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 #library("test_options_parser"); | 5 #library("test_options_parser"); |
| 6 | 6 |
| 7 #import("dart:io"); | 7 #import("dart:io"); |
| 8 #import("dart:math"); | 8 #import("dart:math"); |
| 9 #import("drt_updater.dart"); | 9 #import("drt_updater.dart"); |
| 10 #import("test_suite.dart"); | 10 #import("test_suite.dart"); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 /** | 38 /** |
| 39 * Parser of test options. | 39 * Parser of test options. |
| 40 */ | 40 */ |
| 41 class TestOptionsParser { | 41 class TestOptionsParser { |
| 42 String specialCommandHelp = | 42 String specialCommandHelp = |
| 43 """ | 43 """ |
| 44 Special command support. Wraps the command line in | 44 Special command support. Wraps the command line in |
| 45 a special command. The special command should contain | 45 a special command. The special command should contain |
| 46 an '@' character which will be replaced by the normal | 46 an '@' character which will be replaced by the normal |
| 47 command. | 47 command executable. |
| 48 | 48 |
| 49 For example if the normal command that will be executed | 49 For example if the normal command line that will be executed |
| 50 is 'dart file.dart' and you specify special command | 50 is 'dart file.dart' and you specify special command |
| 51 'python -u valgrind.py @ suffix' the final command will be | 51 'python -u valgrind.py @ suffix' the final command will be |
| 52 'python -u valgrind.py dart file.dart suffix'"""; | 52 'python -u valgrind.py dart suffix file.dart'"""; |
| 53 | 53 |
| 54 /** | 54 /** |
| 55 * Creates a test options parser initialized with the known options. | 55 * Creates a test options parser initialized with the known options. |
| 56 */ | 56 */ |
| 57 TestOptionsParser() { | 57 TestOptionsParser() { |
| 58 _options = | 58 _options = |
| 59 [ new _TestOptionSpecification( | 59 [ new _TestOptionSpecification( |
| 60 'mode', | 60 'mode', |
| 61 'Mode in which to run the tests', | 61 'Mode in which to run the tests', |
| 62 ['-m', '--mode'], | 62 ['-m', '--mode'], |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 return option; | 642 return option; |
| 643 } | 643 } |
| 644 } | 644 } |
| 645 print('Unknown test option $name'); | 645 print('Unknown test option $name'); |
| 646 exit(1); | 646 exit(1); |
| 647 } | 647 } |
| 648 | 648 |
| 649 | 649 |
| 650 List<_TestOptionSpecification> _options; | 650 List<_TestOptionSpecification> _options; |
| 651 } | 651 } |
| OLD | NEW |