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 * A pipeline task to create a HTML/CSS wrapper for a test so it can run in DRT. | 6 * A pipeline task to create a HTML/CSS wrapper for a test so it can run in DRT. |
7 */ | 7 */ |
8 class HtmlWrapTask extends PipelineTask { | 8 class HtmlWrapTask extends PipelineTask { |
9 final String _testFileTemplate; | 9 final String _testFileTemplate; |
10 final String _htmlSourceFileTemplate; | 10 final String _htmlSourceFileTemplate; |
11 final String _htmlDestFileTemplate; | 11 final String _htmlDestFileTemplate; |
12 final String _cssSourceFileTemplate; | 12 final String _cssSourceFileTemplate; |
13 final String _cssDestFileTemplate; | 13 final String _cssDestFileTemplate; |
14 | 14 |
15 HtmlWrapTask(this._testFileTemplate, this._htmlSourceFileTemplate, | 15 HtmlWrapTask(this._testFileTemplate, this._htmlSourceFileTemplate, |
16 this._htmlDestFileTemplate, this._cssSourceFileTemplate, | 16 this._htmlDestFileTemplate, this._cssSourceFileTemplate, |
17 this._cssDestFileTemplate); | 17 this._cssDestFileTemplate); |
18 | 18 |
19 void execute(Path testfile, List stdout, List stderr, bool logging, | 19 execute(Path testfile, List stdout, List stderr, bool logging, |
20 Function exitHandler) { | 20 Function exitHandler) { |
21 var testname = expandMacros(_testFileTemplate, testfile); | 21 var testname = expandMacros(_testFileTemplate, testfile); |
22 | 22 |
23 // If the test already has a corresponding HTML file we copy that, | 23 // If the test already has a corresponding HTML file we copy that, |
24 // else we create a new wrapper. | 24 // else we create a new wrapper. |
25 var htmlSourceName = expandMacros(_htmlSourceFileTemplate, testfile); | 25 var htmlSourceName = expandMacros(_htmlSourceFileTemplate, testfile); |
26 var htmlDestName = expandMacros(_htmlDestFileTemplate, testfile); | 26 var htmlDestName = expandMacros(_htmlDestFileTemplate, testfile); |
27 var cssSourceName = expandMacros(_cssSourceFileTemplate, testfile); | 27 var cssSourceName = expandMacros(_cssSourceFileTemplate, testfile); |
28 var cssDestName = expandMacros(_cssDestFileTemplate, testfile); | 28 var cssDestName = expandMacros(_cssDestFileTemplate, testfile); |
29 | 29 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 } | 144 } |
145 exitHandler(0); | 145 exitHandler(0); |
146 } | 146 } |
147 | 147 |
148 void cleanup(Path testfile, List stdout, List stderr, | 148 void cleanup(Path testfile, List stdout, List stderr, |
149 bool logging, bool keepFiles) { | 149 bool logging, bool keepFiles) { |
150 deleteFiles([_htmlDestFileTemplate, _cssDestFileTemplate], testfile, | 150 deleteFiles([_htmlDestFileTemplate, _cssDestFileTemplate], testfile, |
151 logging, keepFiles, stdout); | 151 logging, keepFiles, stdout); |
152 } | 152 } |
153 } | 153 } |
OLD | NEW |