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 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 | 843 |
844 final String compiler = configuration['compiler']; | 844 final String compiler = configuration['compiler']; |
845 final String runtime = configuration['runtime']; | 845 final String runtime = configuration['runtime']; |
846 | 846 |
847 for (var vmOptions in getVmOptions(optionsFromFile)) { | 847 for (var vmOptions in getVmOptions(optionsFromFile)) { |
848 // Create a unique temporary directory for each set of vmOptions. | 848 // Create a unique temporary directory for each set of vmOptions. |
849 // TODO(dart:429): Replace separate replaceAlls with a RegExp when | 849 // TODO(dart:429): Replace separate replaceAlls with a RegExp when |
850 // replaceAll(RegExp, String) is implemented. | 850 // replaceAll(RegExp, String) is implemented. |
851 String optionsName = ''; | 851 String optionsName = ''; |
852 if (getVmOptions(optionsFromFile).length > 1) { | 852 if (getVmOptions(optionsFromFile).length > 1) { |
853 optionsName = Strings.join(vmOptions, '-').replaceAll('-','') | 853 optionsName = vmOptions.join('-').replaceAll('-','') |
854 .replaceAll('=','') | 854 .replaceAll('=','') |
855 .replaceAll('/',''); | 855 .replaceAll('/',''); |
856 } | 856 } |
857 final String tempDir = createOutputDirectory(info.filePath, optionsName); | 857 final String tempDir = createOutputDirectory(info.filePath, optionsName); |
858 | 858 |
859 String dartWrapperFilename = '$tempDir/test.dart'; | 859 String dartWrapperFilename = '$tempDir/test.dart'; |
860 String compiledDartWrapperFilename = '$tempDir/test.js'; | 860 String compiledDartWrapperFilename = '$tempDir/test.js'; |
861 | 861 |
862 String htmlPath = '$tempDir/test.html'; | 862 String htmlPath = '$tempDir/test.html'; |
863 if (isWrappingRequired && !isWebTest) { | 863 if (isWrappingRequired && !isWebTest) { |
864 // test.dart will import the dart test directly, if it is a library, | 864 // test.dart will import the dart test directly, if it is a library, |
865 // or indirectly through test_as_library.dart, if it is not. | 865 // or indirectly through test_as_library.dart, if it is not. |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1626 updatedConfiguration, | 1626 updatedConfiguration, |
1627 completeHandler, | 1627 completeHandler, |
1628 new Set<String>.from([PASS]))); | 1628 new Set<String>.from([PASS]))); |
1629 doDone(); | 1629 doDone(); |
1630 } | 1630 } |
1631 | 1631 |
1632 void completeHandler(TestCase testCase) { | 1632 void completeHandler(TestCase testCase) { |
1633 } | 1633 } |
1634 | 1634 |
1635 void computeClassPath() { | 1635 void computeClassPath() { |
1636 classPath = Strings.join( | 1636 classPath = |
1637 ['$buildDir/analyzer/util/analyzer/dart_analyzer.jar', | 1637 ['$buildDir/analyzer/util/analyzer/dart_analyzer.jar', |
1638 '$buildDir/analyzer/dart_analyzer_tests.jar', | 1638 '$buildDir/analyzer/dart_analyzer_tests.jar', |
1639 // Third party libraries. | 1639 // Third party libraries. |
1640 '$dartDir/third_party/args4j/2.0.12/args4j-2.0.12.jar', | 1640 '$dartDir/third_party/args4j/2.0.12/args4j-2.0.12.jar', |
1641 '$dartDir/third_party/guava/r09/guava-r09.jar', | 1641 '$dartDir/third_party/guava/r09/guava-r09.jar', |
1642 '$dartDir/third_party/rhino/1_7R3/js.jar', | 1642 '$dartDir/third_party/rhino/1_7R3/js.jar', |
1643 '$dartDir/third_party/hamcrest/v1_3/hamcrest-core-1.3.0RC2.jar', | 1643 '$dartDir/third_party/hamcrest/v1_3/hamcrest-core-1.3.0RC2.jar', |
1644 '$dartDir/third_party/hamcrest/v1_3/hamcrest-generator-1.3.0RC2.jar', | 1644 '$dartDir/third_party/hamcrest/v1_3/hamcrest-generator-1.3.0RC2.jar', |
1645 '$dartDir/third_party/hamcrest/v1_3/hamcrest-integration-1.3.0RC2.jar', | 1645 '$dartDir/third_party/hamcrest/v1_3/hamcrest-integration-1.3.0RC2.jar', |
1646 '$dartDir/third_party/hamcrest/v1_3/hamcrest-library-1.3.0RC2.jar', | 1646 '$dartDir/third_party/hamcrest/v1_3/hamcrest-library-1.3.0RC2.jar', |
1647 '$dartDir/third_party/junit/v4_8_2/junit.jar'], | 1647 '$dartDir/third_party/junit/v4_8_2/junit.jar'] |
1648 Platform.operatingSystem == 'windows'? ';': ':'); // Path separator. | 1648 .join(Platform.operatingSystem == 'windows'? ';': ':'); // Path separat
or. |
1649 } | 1649 } |
1650 } | 1650 } |
1651 | 1651 |
1652 class LastModifiedCache { | 1652 class LastModifiedCache { |
1653 Map<String, Date> _cache = <String, Date>{}; | 1653 Map<String, Date> _cache = <String, Date>{}; |
1654 | 1654 |
1655 /** | 1655 /** |
1656 * Returns the last modified date of the given [uri]. | 1656 * Returns the last modified date of the given [uri]. |
1657 * | 1657 * |
1658 * The return value will be cached for future queries. If [uri] is a local | 1658 * The return value will be cached for future queries. If [uri] is a local |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1910 * $pass tests are expected to pass | 1910 * $pass tests are expected to pass |
1911 * $failOk tests are expected to fail that we won't fix | 1911 * $failOk tests are expected to fail that we won't fix |
1912 * $fail tests are expected to fail that we should fix | 1912 * $fail tests are expected to fail that we should fix |
1913 * $crash tests are expected to crash that we should fix | 1913 * $crash tests are expected to crash that we should fix |
1914 * $timeout tests are allowed to timeout | 1914 * $timeout tests are allowed to timeout |
1915 * $compileErrorSkip tests are skipped on browsers due to compile-time error | 1915 * $compileErrorSkip tests are skipped on browsers due to compile-time error |
1916 """; | 1916 """; |
1917 print(report); | 1917 print(report); |
1918 } | 1918 } |
1919 } | 1919 } |
OLD | NEW |