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

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

Issue 846433002: Allow for reporting with the --list option (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 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
===================================================================
--- tools/testing/dart/test_suite.dart (revision 42685)
+++ tools/testing/dart/test_suite.dart (working copy)
@@ -282,7 +282,7 @@
SummaryReport.addCompileErrorSkipTest();
return;
} else {
- SummaryReport.add(expectations);
+ SummaryReport.add(testCase);
}
}
@@ -2413,6 +2413,7 @@
static int skipped = 0;
static int skippedByDesign = 0;
static int noCrash = 0;
+ static int flakyCrash = 0;
static int pass = 0;
static int failOk = 0;
static int fail = 0;
@@ -2420,40 +2421,68 @@
static int timeout = 0;
static int compileErrorSkip = 0;
- static void add(Set<Expectation> expectations) {
+ static List<TestCase> nonStandardTestCases = [];
+
+ static void add(TestCase testCase) {
+ var expectations = testCase.expectedOutcomes;
+
bool containsFail = expectations.any(
(expectation) => expectation.canBeOutcomeOf(Expectation.FAIL));
+ bool containsPass = expectations.contains(Expectation.PASS);
+ bool containsSkip = expectations.contains(Expectation.SKIP);
+ bool containsSkipByDesign =
+ expectations.contains(Expectation.SKIP_BY_DESIGN);
+ bool containsCrash = expectations.contains(Expectation.CRASH);
+ bool containsOK = expectations.contains(Expectation.OK);
+ bool containsSlow = expectations.contains(Expectation.SLOW);
+ bool containsTimeout = expectations.contains(Expectation.TIMEOUT);
+
++total;
- if (expectations.contains(Expectation.SKIP)) {
+ if (containsSkip) {
++skipped;
- } else if (expectations.contains(Expectation.SKIP_BY_DESIGN)) {
+ } else if (containsSkipByDesign) {
++skipped;
++skippedByDesign;
} else {
+ // We don't do if-else below because the buckets should be exclusive.
+ // We keep a count around to guarantee that
+ int markers = 0;
+
// Counts the number of flaky tests.
- if (expectations.contains(Expectation.PASS) &&
- containsFail &&
- !expectations.contains(Expectation.CRASH) &&
- !expectations.contains(Expectation.OK)) {
+ if (containsFail && containsPass && !containsCrash && !containsOK) {
++noCrash;
+ ++markers;
}
- if (expectations.contains(Expectation.PASS) && expectations.length == 1) {
+ if (containsCrash && !containsOK && expectations.length > 1) {
+ ++flakyCrash;
+ ++markers;
+ }
+ if ((containsPass && expectations.length == 1) ||
+ (containsPass && containsSlow && expectations.length == 2)) {
++pass;
+ ++markers;
}
- if (expectations.containsAll([Expectation.FAIL, Expectation.OK]) &&
- expectations.length == 2) {
+ if (containsFail && containsOK) {
++failOk;
+ ++markers;
}
- if (containsFail && expectations.length == 1) {
+ if ((containsFail && expectations.length == 1) ||
+ (containsFail && containsSlow && expectations.length == 2)) {
++fail;
+ ++markers;
}
- if (expectations.contains(Expectation.CRASH) &&
- expectations.length == 1) {
+ if ((containsCrash && expectations.length == 1) ||
+ (containsCrash && containsSlow && expectations.length == 2)) {
++crash;
+ ++markers;
}
- if (expectations.contains(Expectation.TIMEOUT)) {
+ if (containsTimeout && expectations.length == 1) {
++timeout;
+ ++markers;
}
+ if (markers != 1) {
+ nonStandardTestCases.add(testCase);
+ }
}
}
@@ -2464,9 +2493,11 @@
static void printReport() {
if (total == 0) return;
+ var bogus = nonStandardTestCases.length;
String report = """Total: $total tests
* $skipped tests will be skipped ($skippedByDesign skipped by design)
* $noCrash tests are expected to be flaky but not crash
+ * $flakyCrash tests are expected to flaky crash
* $pass tests are expected to pass
* $failOk tests are expected to fail that we won't fix
* $fail tests are expected to fail that we should fix
@@ -2473,6 +2504,7 @@
* $crash tests are expected to crash that we should fix
* $timeout tests are allowed to timeout
* $compileErrorSkip tests are skipped on browsers due to compile-time error
+ * $bogus could not be categorized or are in multiple categories
""";
print(report);
}
« 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