Chromium Code Reviews| Index: tools/testing/dart/test_suite.dart |
| diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart |
| index 93185fa1858ead9d07e7838515a9b91795fb2bbd..6a54d439c1f49f47fba9b8243238e109123d1e25 100644 |
| --- a/tools/testing/dart/test_suite.dart |
| +++ b/tools/testing/dart/test_suite.dart |
| @@ -244,6 +244,11 @@ class StandardTestSuite implements TestSuite { |
| start = filename.indexOf(directoryPath); |
| testName = filename.substring(start + directoryPath.length + 1, |
| filename.length); |
| + if (configuration['component'] != 'dartc') { |
| + if (testName.endsWith('.dart')) { |
| + testName = testName.substring(0, testName.length - 5); |
| + } |
| + } |
| } |
| Set<String> expectations = testExpectations.expectations(testName); |
| if (configuration["report"]) { |
| @@ -341,15 +346,20 @@ class StandardTestSuite implements TestSuite { |
| } |
| String tempDirTemplate = '${TestUtils.buildDir(configuration)}/tmp'; |
| - if (isWebTest) tempDirTemplate = 'client/' + tempDirTemplate; |
| + // if (isWebTest) tempDirTemplate = 'client/' + tempDirTemplate; |
| Directory tempDir = new Directory(tempDirTemplate); |
| // TODO(whesse): When implementing client web tests, |
| // create directory in the client case, if it doesn't exist. |
| tempDir.createTempSync(); |
| String dartTestFilename = new File(filename).fullPathSync(); |
| - String dartWrapperFilename = '${tempDir.path}/test.dart'; |
| - if (!isWebTest) { |
| + String dartWrapperFilename; |
| + String scriptPath; |
| + if (isWebTest) { |
| + scriptPath = 'file://$dartTestFilename'; |
| + } else { |
| + dartWrapperFilename = '${tempDir.path}/test.dart'; |
| + scriptPath = '../../../$dartWrapperFilename'; |
| // test.dart will import the dart test directly, if it is a library, |
| // or indirectly through test_as_library.dart, if it is not. |
| String dartLibraryFilename; |
| @@ -362,7 +372,7 @@ class StandardTestSuite implements TestSuite { |
| dartLibrary.writeStringSync(WrapDartTestInLibrary(dartTestFilename)); |
| dartLibrary.closeSync(); |
| } |
| - |
| + |
|
Bill Hesse
2011/12/23 15:05:25
Eliminate stray whitespace.
|
| File file = new File(dartWrapperFilename); |
| RandomAccessFile dartWrapper = file.openSync(writable: true); |
| dartWrapper.writeStringSync(DartTestWrapper( |
| @@ -370,8 +380,6 @@ class StandardTestSuite implements TestSuite { |
| '../../../tests/isolate/src/TestFramework.dart', |
| dartLibraryFilename)); |
| dartWrapper.closeSync(); |
| - } else { |
| - return; // TODO(whesse): Implement client web tests on dartium. |
| } |
| // Create the HTML file for the test. |
| File htmlTestBase = new File('${tempDir.path}/${getHtmlName(filename)}'); |
| @@ -380,11 +388,11 @@ class StandardTestSuite implements TestSuite { |
| filename, |
| '../../../client/testing/unittest/test_controller.js', |
| scriptType, |
| - '../../../$dartWrapperFilename')); |
| + scriptPath)); |
| htmlTest.closeSync(); |
| for (var vmOptions in optionsFromFile["vmOptions"]) { |
| - var drtFlags = ['-no-timeout']; |
| + var drtFlags = ['--no-timeout']; |
| var dartFlags = ['--enable_asserts', '--enable_type_checks']; |
| dartFlags.addAll(vmOptions); |
| drtFlags.add('--dart-flags=${Strings.join(dartFlags, " ")}'); |
| @@ -437,7 +445,10 @@ class StandardTestSuite implements TestSuite { |
| testRelativeDir = testRelativePath.substring(0, start - 1); |
| testRelativeDirFlattened = testRelativeDir.replaceAll(pathSeparator, '_'); |
| } else { |
| - Expect.fail('Web tests not imlemented yet'); |
| + Expect.isTrue(testRelativePath.endsWith('_tests.dart')); |
| + start = testRelativePath.lastIndexOf(pathSeparator); |
| + testNameBase = |
| + testRelativePath.substring(start + 1, testRelativePath.length - 11); |
| } |
| if (!new Directory('$dartDir/$buildDir/generated_tests').existsSync()) { |
| @@ -482,7 +493,8 @@ class StandardTestSuite implements TestSuite { |
| dartLibraryFilename)); |
| dartWrapper.closeSync(); |
| } else { |
| - return; // TODO(whesse): Implement client web tests on dartium. |
| + dartWrapperFilename = testPath; |
|
Bill Hesse
2011/12/23 15:05:25
Rename to dartScript?
|
| + // return; // TODO(whesse): Implement client web tests on dartium. |
|
Bill Hesse
2011/12/23 15:05:25
Delete this comment.
|
| } |
| // Create the HTML file for the test. |
| File htmlTestBase = new File('${tempDir.path}/${getHtmlName(filename)}'); |