Add PKGTestSuite that will be used for package waterfall testers.
This is based on the standard test suite but we specialcase html files. There is another html file aproach currently being done by whesse@ that we may be able to utilize when it is done instead. R=sigmund@google.com Review URL: https://codereview.chromium.org//567803004 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40255 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
+1
-2
@@ -186,8 +186,7 @@ void testConfigurations(List<Map> configurations) {
|
||||
// If we specifically pass in a suite only run that.
|
||||
if (conf['suite_dir'] != null) {
|
||||
var suite_path = new Path(conf['suite_dir']);
|
||||
testSuites.add(
|
||||
new StandardTestSuite.forDirectory(conf, suite_path));
|
||||
testSuites.add(new PKGTestSuite(conf, suite_path));
|
||||
} else {
|
||||
for (String key in selectors.keys) {
|
||||
if (key == 'co19') {
|
||||
|
||||
@@ -1667,6 +1667,52 @@ class StandardTestSuite extends TestSuite {
|
||||
}
|
||||
}
|
||||
|
||||
/// 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.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user