Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Unified Diff: tools/testing/dart/test_suite.dart

Issue 9111010: Fix test.dart problem when matching client status files when run from a subdirectory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_suite.dart
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index 5af2bbda7c7dcad6d0fb5bc7bcaf312b72f58625..1933eeac85feb1656a05de5e9919d7cdce386e8c 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -241,8 +241,11 @@ class StandardTestSuite implements TestSuite {
// rest. They use the .dart suffix in the status files. They
// find tests in weird ways (testing that they contain "#").
// They need to be redone.
- start = filename.indexOf(directoryPath);
- testName = filename.substring(start + directoryPath.length + 1,
+ // directoryPath may start with '../'.
+ String sanitizedDirectoryPath = (directoryPath.startsWith('../')) ?
+ directoryPath.substring(3) : directoryPath;
+ start = filename.indexOf(sanitizedDirectoryPath);
+ testName = filename.substring(start + sanitizedDirectoryPath.length + 1,
filename.length);
if (configuration['component'] != 'dartc') {
if (testName.endsWith('.dart')) {
@@ -263,7 +266,7 @@ class StandardTestSuite implements TestSuite {
case 'dartium':
case 'chromium':
case 'frogium':
- enqueueBrowserTest(filename, testName,optionsFromFile,
+ enqueueBrowserTest(filename, testName, optionsFromFile,
expectations, isNegative);
break;
default:
@@ -475,9 +478,13 @@ class StandardTestSuite implements TestSuite {
configuration['component'],
testUniqueName];
- Directory tempDir;
- String tempDirPath =
- new File(TestUtils.buildDir(configuration)).fullPathSync();
+ String tempDirPath = TestUtils.buildDir(configuration);
+ Directory tempDir = new Directory(tempDirPath);
+ if (!tempDir.existsSync()) {
+ throw new Exception('Build directory $tempDirPath does not exist.');
+ }
+ tempDirPath = new File(tempDirPath).fullPathSync();
+
for (String subdirectory in generatedTestPath) {
tempDirPath = '$tempDirPath/$subdirectory';
tempDir = new Directory(tempDirPath);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698