Chromium Code Reviews| 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 * Classes and methods for enumerating and preparing tests. | 6 * Classes and methods for enumerating and preparing tests. |
| 7 * | 7 * |
| 8 * This library includes: | 8 * This library includes: |
| 9 * | 9 * |
| 10 * - Creating tests by listing all the Dart files in certain directories, | 10 * - Creating tests by listing all the Dart files in certain directories, |
| (...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1114 String htmlPath; | 1114 String htmlPath; |
| 1115 if (customHtml.existsSync()) { | 1115 if (customHtml.existsSync()) { |
| 1116 // If necessary, run the Polymer deploy steps. | 1116 // If necessary, run the Polymer deploy steps. |
| 1117 // TODO(jmesserly): this should be generalized for any tests that | 1117 // TODO(jmesserly): this should be generalized for any tests that |
| 1118 // require Pub deploy, not just polymer. | 1118 // require Pub deploy, not just polymer. |
| 1119 if (customHtml.readAsStringSync().contains('<!--polymer-test')) { | 1119 if (customHtml.readAsStringSync().contains('<!--polymer-test')) { |
| 1120 if (compiler != 'none') { | 1120 if (compiler != 'none') { |
| 1121 commands.add(_polymerDeployCommand( | 1121 commands.add(_polymerDeployCommand( |
| 1122 customHtmlPath, tempDir, optionsFromFile)); | 1122 customHtmlPath, tempDir, optionsFromFile)); |
| 1123 | 1123 |
| 1124 htmlPath = '$tempDir/test/$nameNoExt.html'; | 1124 // Find package's home dir, where pubspec.yaml is located. The |
| 1125 // relative directory within the package will be part of the | |
| 1126 // entrypoint path. | |
| 1127 var homeDir = filePath; | |
| 1128 var pubspec = ''; | |
| 1129 do { | |
| 1130 homeDir = homeDir.directoryPath; | |
| 1131 if (homeDir.toString() == '/') { | |
| 1132 homeDir = dir; | |
| 1133 break; | |
| 1134 } | |
| 1135 pubspec = homeDir.append('pubspec.yaml').toNativePath(); | |
| 1136 } while (!new File(pubspec).existsSync()); | |
|
kustermann
2014/01/29 20:48:40
There is already logic to do something similar. Pl
Siggi Cherem (dart-lang)
2014/01/29 22:15:07
Thanks. All set.
| |
| 1137 htmlPath = '$tempDir/${dir.relativeTo(homeDir)}/$nameNoExt.html'; | |
|
kustermann
2014/01/29 20:48:40
I don't understand what the purpose of this is. Th
Siggi Cherem (dart-lang)
2014/01/29 22:15:07
Yes and no - it always supported putting the outpu
| |
| 1125 dartWrapperFilename = '${htmlPath}_bootstrap.dart'; | 1138 dartWrapperFilename = '${htmlPath}_bootstrap.dart'; |
| 1126 compiledDartWrapperFilename = '$dartWrapperFilename.js'; | 1139 compiledDartWrapperFilename = '$dartWrapperFilename.js'; |
| 1127 } else { | 1140 } else { |
| 1128 htmlPath = customHtmlPath; | 1141 htmlPath = customHtmlPath; |
| 1129 } | 1142 } |
| 1130 } else { | 1143 } else { |
| 1131 htmlPath = '$tempDir/test.html'; | 1144 htmlPath = '$tempDir/test.html'; |
| 1132 dartWrapperFilename = filePath.toNativePath(); | 1145 dartWrapperFilename = filePath.toNativePath(); |
| 1133 | 1146 |
| 1134 var htmlContents = customHtml.readAsStringSync(); | 1147 var htmlContents = customHtml.readAsStringSync(); |
| (...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2130 * $pass tests are expected to pass | 2143 * $pass tests are expected to pass |
| 2131 * $failOk tests are expected to fail that we won't fix | 2144 * $failOk tests are expected to fail that we won't fix |
| 2132 * $fail tests are expected to fail that we should fix | 2145 * $fail tests are expected to fail that we should fix |
| 2133 * $crash tests are expected to crash that we should fix | 2146 * $crash tests are expected to crash that we should fix |
| 2134 * $timeout tests are allowed to timeout | 2147 * $timeout tests are allowed to timeout |
| 2135 * $compileErrorSkip tests are skipped on browsers due to compile-time error | 2148 * $compileErrorSkip tests are skipped on browsers due to compile-time error |
| 2136 """; | 2149 """; |
| 2137 print(report); | 2150 print(report); |
| 2138 } | 2151 } |
| 2139 } | 2152 } |
| OLD | NEW |