| 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 */ |
| 11 class Configuration { | 11 class Configuration { |
| 12 final String unittestPath; | 12 final String unittestPath; |
| 13 final bool runInBrowser; | 13 final bool runInBrowser; |
| 14 final bool runIsolated; | 14 final bool runIsolated; |
| 15 final bool verbose; | 15 final bool verbose; |
| 16 final bool immediateOutput; | 16 final bool immediateOutput; |
| 17 final bool layoutText; |
| 18 final bool layoutPixel; |
| 17 final bool produceSummary; | 19 final bool produceSummary; |
| 18 final bool includeTime; | 20 final bool includeTime; |
| 19 final bool listFiles; | 21 final bool listFiles; |
| 20 final bool listTests; | 22 final bool listTests; |
| 21 final bool listGroups; | 23 final bool listGroups; |
| 22 final String listFormat; | 24 final String listFormat; |
| 23 final String passFormat; | 25 final String passFormat; |
| 24 final String failFormat; | 26 final String failFormat; |
| 25 final String errorFormat; | 27 final String errorFormat; |
| 26 final List includeFilter; | 28 final List includeFilter; |
| 27 final List excludeFilter; | 29 final List excludeFilter; |
| 28 final int timeout; | 30 final int timeout; |
| 29 final String runtime; | 31 final String runtime; |
| 30 final bool checkedMode; | 32 final bool checkedMode; |
| 31 final bool keepTests; | 33 final bool keepTests; |
| 32 final bool stopOnFailure; | 34 final bool stopOnFailure; |
| 33 final int maxTasks; | 35 final int maxTasks; |
| 34 final String outputStream; | 36 final String outputStream; |
| 35 final String logStream; | 37 final String logStream; |
| 36 final String tempDir; | 38 final String tempDir; |
| 37 final bool generateRenders; | 39 final bool regenerate; |
| 38 String dart2jsPath; | 40 String dart2jsPath; |
| 39 String drtPath; | 41 String drtPath; |
| 40 String dartPath; | 42 String dartPath; |
| 41 bool filtering; | 43 bool filtering; |
| 42 | 44 |
| 43 Configuration(ArgParser parser, ArgResults options) : | 45 Configuration(ArgParser parser, ArgResults options) : |
| 44 unittestPath = makePathAbsolute(options['unittest']), | 46 unittestPath = makePathAbsolute(options['unittest']), |
| 45 runIsolated = options['isolate'], | 47 runIsolated = options['isolate'], |
| 46 runInBrowser = (options['runtime'] != 'vm'), | 48 runInBrowser = (options['runtime'] != 'vm'), |
| 47 verbose = (options['log'] != 'none' && !options['list-groups']), | 49 verbose = (options['log'] != 'none' && !options['list-groups']), |
| 48 immediateOutput = options['immediate'], | 50 immediateOutput = options['immediate'], |
| 51 layoutText = options['layout-text'], |
| 52 layoutPixel = options['layout-pixel'], |
| 49 produceSummary = options['summary'], | 53 produceSummary = options['summary'], |
| 50 includeTime = options['time'], | 54 includeTime = options['time'], |
| 51 listFiles = options['list-files'], | 55 listFiles = options['list-files'], |
| 52 listTests = options['list-tests'], | 56 listTests = options['list-tests'], |
| 53 listGroups = options['list-groups'], | 57 listGroups = options['list-groups'], |
| 54 listFormat = options['list-format'], | 58 listFormat = options['list-format'], |
| 55 passFormat = options['pass-format'], | 59 passFormat = options['pass-format'], |
| 56 failFormat = options['fail-format'], | 60 failFormat = options['fail-format'], |
| 57 errorFormat = options['error-format'], | 61 errorFormat = options['error-format'], |
| 58 includeFilter = options['include'], | 62 includeFilter = options['include'], |
| 59 excludeFilter = options['exclude'], | 63 excludeFilter = options['exclude'], |
| 60 timeout = parseInt(options['timeout']), | 64 timeout = parseInt(options['timeout']), |
| 61 runtime = options['runtime'], | 65 runtime = options['runtime'], |
| 62 checkedMode = options['checked'], | 66 checkedMode = options['checked'], |
| 63 keepTests = (options['keep-files'] && | 67 keepTests = (options['keep-files'] && |
| 64 !(options['list-groups'] || options['list-tests'])), | 68 !(options['list-groups'] || options['list-tests'])), |
| 65 stopOnFailure = options['stop-on-failure'], | 69 stopOnFailure = options['stop-on-failure'], |
| 66 maxTasks = parseInt(options['tasks']), | 70 maxTasks = parseInt(options['tasks']), |
| 67 outputStream = options['out'], | 71 outputStream = options['out'], |
| 68 logStream = options['log'], | 72 logStream = options['log'], |
| 69 tempDir = options['tempdir'], | 73 tempDir = options['tempdir'], |
| 70 generateRenders = options['generate-renders'] { | 74 regenerate = options['regenerate'] { |
| 71 filtering = (includeFilter.length > 0 || excludeFilter.length > 0); | 75 filtering = (includeFilter.length > 0 || excludeFilter.length > 0); |
| 72 var dartsdk = options['dartsdk']; | 76 var dartsdk = options['dartsdk']; |
| 73 var pathSep = Platform.pathSeparator; | 77 var pathSep = Platform.pathSeparator; |
| 74 | 78 |
| 75 if (dartsdk == null || | 79 if (dartsdk == null || |
| 76 parser.getDefault('dart2js') != options['dart2js']) { | 80 parser.getDefault('dart2js') != options['dart2js']) { |
| 77 dart2jsPath = options['dart2js']; | 81 dart2jsPath = options['dart2js']; |
| 78 } else { | 82 } else { |
| 79 dart2jsPath = '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}dart2js'; | 83 dart2jsPath = '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}dart2js'; |
| 80 } | 84 } |
| 81 | 85 |
| 82 if (dartsdk == null || | 86 if (dartsdk == null || |
| 83 parser.getDefault('dart') != options['dart']) { | 87 parser.getDefault('dart') != options['dart']) { |
| 84 dartPath = options['dart']; | 88 dartPath = options['dart']; |
| 85 } else { | 89 } else { |
| 86 dartPath = '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}dart'; | 90 dartPath = '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}dart'; |
| 87 } | 91 } |
| 88 | 92 |
| 89 if (dartsdk == null || | 93 if (dartsdk == null || |
| 90 parser.getDefault('drt') != options['drt']) { | 94 parser.getDefault('drt') != options['drt']) { |
| 91 drtPath = options['drt']; | 95 drtPath = options['drt']; |
| 92 } else { | 96 } else { |
| 93 drtPath = '$dartsdk${pathSep}chromium${pathSep}DumpRenderTree'; | 97 drtPath = '$dartsdk${pathSep}chromium${pathSep}DumpRenderTree'; |
| 94 } | 98 } |
| 95 } | 99 } |
| 96 } | 100 } |
| OLD | NEW |