| 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 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1236 '$dartDir/third_party/hamcrest/v1_3/hamcrest-integration-1.3.0RC2.jar', | 1236 '$dartDir/third_party/hamcrest/v1_3/hamcrest-integration-1.3.0RC2.jar', |
| 1237 '$dartDir/third_party/hamcrest/v1_3/hamcrest-library-1.3.0RC2.jar', | 1237 '$dartDir/third_party/hamcrest/v1_3/hamcrest-library-1.3.0RC2.jar', |
| 1238 '$dartDir/third_party/junit/v4_8_2/junit.jar'], | 1238 '$dartDir/third_party/junit/v4_8_2/junit.jar'], |
| 1239 Platform.operatingSystem == 'windows'? ';': ':'); // Path separator. | 1239 Platform.operatingSystem == 'windows'? ';': ':'); // Path separator. |
| 1240 } | 1240 } |
| 1241 } | 1241 } |
| 1242 | 1242 |
| 1243 | 1243 |
| 1244 class TestUtils { | 1244 class TestUtils { |
| 1245 /** | 1245 /** |
| 1246 * The libraries in this directory relies on finding various files |
| 1247 * relative to the 'test.dart' script in '.../dart/tools/test.dart'. If |
| 1248 * the main script using 'test_suite.dart' is not there, the main |
| 1249 * script must set this to '.../dart/tools/test.dart'. |
| 1250 */ |
| 1251 static String testScriptPath = new Options().script; |
| 1252 |
| 1253 /** |
| 1246 * Creates a directory using a [relativePath] to an existing | 1254 * Creates a directory using a [relativePath] to an existing |
| 1247 * [base] directory if that [relativePath] does not already exist. | 1255 * [base] directory if that [relativePath] does not already exist. |
| 1248 */ | 1256 */ |
| 1249 static Directory mkdirRecursive(Path base, Path relativePath) { | 1257 static Directory mkdirRecursive(Path base, Path relativePath) { |
| 1250 Directory dir = new Directory.fromPath(base); | 1258 Directory dir = new Directory.fromPath(base); |
| 1251 Expect.isTrue(dir.existsSync(), | 1259 Expect.isTrue(dir.existsSync(), |
| 1252 "Expected ${dir} to already exist"); | 1260 "Expected ${dir} to already exist"); |
| 1253 var segments = relativePath.segments(); | 1261 var segments = relativePath.segments(); |
| 1254 for (String segment in segments) { | 1262 for (String segment in segments) { |
| 1255 base = base.append(segment); | 1263 base = base.append(segment); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1374 return result; | 1382 return result; |
| 1375 } | 1383 } |
| 1376 | 1384 |
| 1377 static String buildDir(Map configuration) { | 1385 static String buildDir(Map configuration) { |
| 1378 String mode = (configuration['mode'] == 'debug') ? 'Debug' : 'Release'; | 1386 String mode = (configuration['mode'] == 'debug') ? 'Debug' : 'Release'; |
| 1379 String arch = configuration['arch'].toUpperCase(); | 1387 String arch = configuration['arch'].toUpperCase(); |
| 1380 return "${outputDir(configuration)}$mode$arch"; | 1388 return "${outputDir(configuration)}$mode$arch"; |
| 1381 } | 1389 } |
| 1382 | 1390 |
| 1383 static Path dartDir() { | 1391 static Path dartDir() { |
| 1384 File scriptFile = new File(new Options().script); | 1392 File scriptFile = new File(testScriptPath); |
| 1385 Path scriptPath = new Path.fromNative(scriptFile.fullPathSync()); | 1393 Path scriptPath = new Path.fromNative(scriptFile.fullPathSync()); |
| 1386 return scriptPath.directoryPath.directoryPath; | 1394 return scriptPath.directoryPath.directoryPath; |
| 1387 } | 1395 } |
| 1388 | 1396 |
| 1389 static List<String> standardOptions(Map configuration) { | 1397 static List<String> standardOptions(Map configuration) { |
| 1390 List args = ["--ignore-unrecognized-flags"]; | 1398 List args = ["--ignore-unrecognized-flags"]; |
| 1391 if (configuration["checked"]) { | 1399 if (configuration["checked"]) { |
| 1392 args.add('--enable_asserts'); | 1400 args.add('--enable_asserts'); |
| 1393 args.add("--enable_type_checks"); | 1401 args.add("--enable_type_checks"); |
| 1394 } | 1402 } |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1461 * $noCrash tests are expected to be flaky but not crash | 1469 * $noCrash tests are expected to be flaky but not crash |
| 1462 * $pass tests are expected to pass | 1470 * $pass tests are expected to pass |
| 1463 * $failOk tests are expected to fail that we won't fix | 1471 * $failOk tests are expected to fail that we won't fix |
| 1464 * $fail tests are expected to fail that we should fix | 1472 * $fail tests are expected to fail that we should fix |
| 1465 * $crash tests are expected to crash that we should fix | 1473 * $crash tests are expected to crash that we should fix |
| 1466 * $timeout tests are allowed to timeout | 1474 * $timeout tests are allowed to timeout |
| 1467 """; | 1475 """; |
| 1468 print(report); | 1476 print(report); |
| 1469 } | 1477 } |
| 1470 } | 1478 } |
| OLD | NEW |