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

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

Issue 567803004: Add PKGTestSuite that will be used for package waterfall testers. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 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 | « tools/test.dart ('k') | 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
===================================================================
--- tools/testing/dart/test_suite.dart (revision 40235)
+++ tools/testing/dart/test_suite.dart (working copy)
@@ -1667,7 +1667,53 @@
}
}
+/// Used for testing packages in on off settings, i.e., we pass in the actual
+/// directory that we want to test.
+class PKGTestSuite extends StandardTestSuite {
+ PKGTestSuite(Map configuration, Path directoryPath)
+ : super(configuration,
+ directoryPath.filename,
+ directoryPath,
+ ["$directoryPath/.status"],
+ isTestFilePredicate: (f) => f.endsWith('_test.dart'),
+ recursive: true);
+
+ void enqueueBrowserTest(List<Command> baseCommands,
+ Path packageRoot,
+ TestInformation info,
+ String testName,
+ expectations) {
+ String runtime = configuration['runtime'];
+ Path filePath = info.filePath;
+ Path dir = filePath.directoryPath;
+ String nameNoExt = filePath.filenameWithoutExtension;
+ Path customHtmlPath = dir.append('$nameNoExt.html');
+ File customHtml = new File(customHtmlPath.toNativePath());
+ if (!customHtml.existsSync()) {
+ super.enqueueBrowserTest(baseCommands, packageRoot,
+ info, testName, expectations);
+ } else {
+ Path relativeHtml = customHtmlPath.relativeTo(TestUtils.dartDir);
+ List<Command> commands = []..addAll(baseCommands);
+ var fullPath = _createUrlPathFromFile(customHtmlPath);
+
+ commands.add(CommandBuilder.instance.getBrowserTestCommand(
+ runtime, fullPath, configuration));
+ String testDisplayName = '$suiteName/$testName';
+ enqueueNewTestCase(new BrowserTestCase(testDisplayName,
+ commands,
+ configuration,
+ expectations,
+ info,
+ isNegative(info),
+ relativeHtml.toNativePath()));
+
+ }
+ }
+}
+
+
/// A DartcCompilationTestSuite will run dartc on all of the tests.
///
/// Usually, the result of a dartc run is determined by the output of
« no previous file with comments | « tools/test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698