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 /** | 5 /** |
6 * The command line and other arguments passed to the test runner are | 6 * The command line and other arguments passed to the test runner are |
7 * gathered into a global [Configuration] instance that controls the | 7 * gathered into a global [Configuration] instance that controls the |
8 * execution. For details on the various options here see | 8 * execution. For details on the various options here see |
9 * [getOptionParser]. | 9 * [getOptionParser]. |
10 */ | 10 */ |
(...skipping 23 matching lines...) Expand all Loading... |
34 final bool stopOnFailure; | 34 final bool stopOnFailure; |
35 final int maxTasks; | 35 final int maxTasks; |
36 final String outputStream; | 36 final String outputStream; |
37 final String logStream; | 37 final String logStream; |
38 final String tempDir; | 38 final String tempDir; |
39 final bool regenerate; | 39 final bool regenerate; |
40 String dart2jsPath; | 40 String dart2jsPath; |
41 String drtPath; | 41 String drtPath; |
42 String dartPath; | 42 String dartPath; |
43 bool filtering; | 43 bool filtering; |
| 44 bool runServer; |
| 45 String port; |
| 46 String staticRoot; |
44 | 47 |
45 Configuration(ArgParser parser, ArgResults options) : | 48 Configuration(ArgParser parser, ArgResults options) : |
46 unittestPath = makePathAbsolute(options['unittest']), | 49 unittestPath = makePathAbsolute(options['unittest']), |
47 runIsolated = options['isolate'], | 50 runIsolated = options['isolate'], |
48 runInBrowser = (options['runtime'] != 'vm'), | 51 runInBrowser = (options['runtime'] != 'vm'), |
49 verbose = (options['log'] != 'none' && !options['list-groups']), | 52 verbose = (options['log'] != 'none' && !options['list-groups']), |
50 immediateOutput = options['immediate'], | 53 immediateOutput = options['immediate'], |
51 layoutText = options['layout-text'], | 54 layoutText = options['layout-text'], |
52 layoutPixel = options['layout-pixel'], | 55 layoutPixel = options['layout-pixel'], |
53 produceSummary = options['summary'], | 56 produceSummary = options['summary'], |
(...skipping 10 matching lines...) Expand all Loading... |
64 timeout = int.parse(options['timeout']), | 67 timeout = int.parse(options['timeout']), |
65 runtime = options['runtime'], | 68 runtime = options['runtime'], |
66 checkedMode = options['checked'], | 69 checkedMode = options['checked'], |
67 keepTests = (options['keep-files'] && | 70 keepTests = (options['keep-files'] && |
68 !(options['list-groups'] || options['list-tests'])), | 71 !(options['list-groups'] || options['list-tests'])), |
69 stopOnFailure = options['stop-on-failure'], | 72 stopOnFailure = options['stop-on-failure'], |
70 maxTasks = int.parse(options['tasks']), | 73 maxTasks = int.parse(options['tasks']), |
71 outputStream = options['out'], | 74 outputStream = options['out'], |
72 logStream = options['log'], | 75 logStream = options['log'], |
73 tempDir = options['tempdir'], | 76 tempDir = options['tempdir'], |
74 regenerate = options['regenerate'] { | 77 regenerate = options['regenerate'], |
| 78 runServer = options['server'], |
| 79 port = options['port'], |
| 80 staticRoot = options['root'] { |
75 filtering = (includeFilter.length > 0 || excludeFilter.length > 0); | 81 filtering = (includeFilter.length > 0 || excludeFilter.length > 0); |
76 var dartsdk = options['dartsdk']; | 82 var dartsdk = options['dartsdk']; |
77 var pathSep = Platform.pathSeparator; | 83 var pathSep = Platform.pathSeparator; |
78 | 84 |
79 if (dartsdk == null || | 85 if (dartsdk == null || |
80 parser.getDefault('dart2js') != options['dart2js']) { | 86 parser.getDefault('dart2js') != options['dart2js']) { |
81 dart2jsPath = options['dart2js']; | 87 dart2jsPath = options['dart2js']; |
82 } else { | 88 } else { |
83 dart2jsPath = '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}dart2js'; | 89 dart2jsPath = '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}dart2js'; |
84 } | 90 } |
85 | 91 |
86 if (dartsdk == null || | 92 if (dartsdk == null || |
87 parser.getDefault('dart') != options['dart']) { | 93 parser.getDefault('dart') != options['dart']) { |
88 dartPath = options['dart']; | 94 dartPath = options['dart']; |
89 } else { | 95 } else { |
90 dartPath = '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}dart'; | 96 dartPath = '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}dart'; |
91 } | 97 } |
92 | 98 |
93 if (dartsdk == null || | 99 if (dartsdk == null || |
94 parser.getDefault('drt') != options['drt']) { | 100 parser.getDefault('drt') != options['drt']) { |
95 drtPath = options['drt']; | 101 drtPath = options['drt']; |
96 } else { | 102 } else { |
97 drtPath = '$dartsdk${pathSep}chromium${pathSep}DumpRenderTree'; | 103 drtPath = '$dartsdk${pathSep}chromium${pathSep}DumpRenderTree'; |
98 } | 104 } |
99 } | 105 } |
100 } | 106 } |
OLD | NEW |