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

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

Issue 2885623002: Revert "Refactor and clean up the status file parsing code." (Closed)
Patch Set: Created 3 years, 7 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/testing/dart/test_runner.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
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index cc741897fe91378f46760f33885c3947e0848713..c95ad9474769c884a7247c645d7d18700adbd2d6 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -21,8 +21,7 @@ import "drt_updater.dart";
import "html_test.dart" as htmlTest;
import "path.dart";
import "multitest.dart";
-import "expectation.dart";
-import "expectation_set.dart";
+import "status_file_parser.dart";
import "summary_report.dart";
import "test_runner.dart";
import "utils.dart";
@@ -119,7 +118,7 @@ class FutureGroup {
* and a status file containing the expected results when these tests are run.
*/
abstract class TestSuite {
- final Map<String, dynamic> configuration;
+ final Map configuration;
final String suiteName;
// This function is set by subclasses before enqueueing starts.
Function doTest;
@@ -308,7 +307,7 @@ abstract class TestSuite {
if (configuration['hot_reload'] || configuration['hot_reload_rollback']) {
// Handle reload special cases.
- if (expectations.contains(Expectation.compileTimeError) ||
+ if (expectations.contains(Expectation.COMPILETIME_ERROR) ||
testCase.hasCompileError ||
testCase.expectCompileError) {
// Running a test that expects a compilation error with hot reloading
@@ -330,9 +329,9 @@ abstract class TestSuite {
}
// Handle skipped tests
- if (expectations.contains(Expectation.skip) ||
- expectations.contains(Expectation.skipByDesign) ||
- expectations.contains(Expectation.skipSlow)) {
+ if (expectations.contains(Expectation.SKIP) ||
+ expectations.contains(Expectation.SKIP_BY_DESIGN) ||
+ expectations.contains(Expectation.SKIP_SLOW)) {
return;
}
@@ -446,8 +445,8 @@ class CCTestSuite extends TestSuite {
final String dartDir;
List<String> statusFilePaths;
- CCTestSuite(Map<String, dynamic> configuration, String suiteName,
- String runnerName, this.statusFilePaths,
+ CCTestSuite(Map configuration, String suiteName, String runnerName,
+ this.statusFilePaths,
{this.testPrefix: ''})
: dartDir = TestUtils.dartDir.toNativePath(),
super(configuration, suiteName) {
@@ -465,7 +464,7 @@ class CCTestSuite extends TestSuite {
}
}
- void testNameHandler(ExpectationSet testExpectations, String testName) {
+ void testNameHandler(TestExpectations testExpectations, String testName) {
// Only run the tests that match the pattern. Use the name
// "suiteName/testName" for cc tests.
String constructedName = '$suiteName/$testPrefix$testName';
@@ -481,26 +480,22 @@ class CCTestSuite extends TestSuite {
new TestCase(constructedName, [command], configuration, expectations));
}
- Future<Null> forEachTest(Function onTest, Map testCache,
- [VoidFunction onDone]) async {
+ void forEachTest(Function onTest, Map testCache, [VoidFunction onDone]) {
doTest = onTest;
var statusFiles =
statusFilePaths.map((statusFile) => "$dartDir/$statusFile").toList();
- var expectations = ExpectationSet.read(statusFiles, configuration);
-
- try {
- var names = await ccTestLister(hostRunnerPath);
- for (var name in names) {
- testNameHandler(expectations, name);
- }
-
- doTest = null;
- if (onDone != null) onDone();
- } catch (error) {
- print("Fatal error occured: $error");
- exit(1);
- }
+ ReadTestExpectations(statusFiles, configuration)
+ .then((TestExpectations expectations) {
+ ccTestLister(hostRunnerPath).then((Iterable<String> names) {
+ names.forEach((testName) => testNameHandler(expectations, testName));
+ doTest = null;
+ if (onDone != null) onDone();
+ }).catchError((error) {
+ print("Fatal error occured: $error");
+ exit(1);
+ });
+ });
}
}
@@ -552,7 +547,7 @@ class HtmlTestInformation extends TestInformation {
class StandardTestSuite extends TestSuite {
final Path suiteDir;
final List<String> statusFilePaths;
- ExpectationSet testExpectations;
+ TestExpectations testExpectations;
List<TestInformation> cachedTests;
final Path dartDir;
Predicate<String> isTestFilePredicate;
@@ -560,8 +555,8 @@ class StandardTestSuite extends TestSuite {
final List<String> extraVmOptions;
List<Uri> _dart2JsBootstrapDependencies;
- StandardTestSuite(Map<String, dynamic> configuration, String suiteName,
- Path suiteDirectory, this.statusFilePaths,
+ StandardTestSuite(Map configuration, String suiteName, Path suiteDirectory,
+ this.statusFilePaths,
{this.isTestFilePredicate, bool recursive: false})
: dartDir = TestUtils.dartDir,
listRecursively = recursive,
@@ -643,7 +638,7 @@ class StandardTestSuite extends TestSuite {
forEachTest(Function onTest, Map testCache, [VoidFunction onDone]) async {
await updateDartium();
doTest = onTest;
- testExpectations = readExpectations();
+ testExpectations = await readExpectations();
// Check if we have already found and generated the tests for this suite.
if (!testCache.containsKey(suiteName)) {
@@ -680,7 +675,7 @@ class StandardTestSuite extends TestSuite {
/**
* Reads the status files and completes with the parsed expectations.
*/
- ExpectationSet readExpectations() {
+ Future<TestExpectations> readExpectations() {
var statusFiles = statusFilePaths.where((String statusFilePath) {
var file = new File(dartDir.append(statusFilePath).toNativePath());
return file.existsSync();
@@ -688,7 +683,7 @@ class StandardTestSuite extends TestSuite {
return dartDir.append(statusFilePath).toNativePath();
}).toList();
- return ExpectationSet.read(statusFiles, configuration);
+ return ReadTestExpectations(statusFiles, configuration);
}
Future enqueueTests() {
« no previous file with comments | « tools/testing/dart/test_runner.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698