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

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

Issue 8771007: tools/test.dart: Add summary report of the number of tests with each expectation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 9 years 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_progress.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 594c2d684d86f0271413516db8210d4014ff7b0c..72997182e62252ebfe934640607bfc6499e3161b 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -79,6 +79,10 @@ class CCTestSuite implements TestSuite {
var expectations = testExpectations.expectations(testName);
+ if (configuration["report"]) {
+ SummaryReport.add(expectations);
+ }
+
if (expectations.contains(SKIP)) return;
// The cc test runner takes options after the name of the test
@@ -207,7 +211,12 @@ class StandardTestSuite implements TestSuite {
filename.substring(middle + 1, filename.length - 5);
}
Set<String> expectations = testExpectations.expectations(testName);
-
+ if (configuration["report"]) {
+ // Tests with multiple VMOptions are counted more than once.
+ for (var dummy in optionsFromFile["vmOptions"]) {
+ SummaryReport.add(expectations);
+ }
+ }
if (expectations.contains(SKIP)) return;
isNegative = isNegative ||
@@ -405,3 +414,56 @@ class TestUtils {
return args;
}
}
+
+class SummaryReport {
+ static int total = 0;
+ static int skipped = 0;
+ static int noCrash = 0;
+ static int pass = 0;
+ static int failOk = 0;
+ static int fail = 0;
+ static int crash = 0;
+ static int timeout = 0;
+
+ static void add(Set<String> expectations) {
+ ++total;
+ if (expectations.contains(SKIP)) {
+ ++skipped;
+ } else {
+ if (expectations.contains(PASS) && expectations.contains(FAIL) &&
+ !expectations.contains(CRASH) && !expectations.contains(OK)) {
+ ++noCrash;
+ }
+ if (expectations.contains(PASS) && expectations.length == 1) {
+ ++pass;
+ }
+ if (expectations.containsAll([FAIL, OK]) && expectations.length == 2) {
+ ++failOk;
+ }
+ if (expectations.contains(FAIL) && expectations.length == 1) {
+ ++fail;
+ }
+ if (expectations.contains(CRASH) && expectations.length == 1) {
+ ++crash;
+ }
+ if (expectations.contains(TIMEOUT)) {
+ ++timeout;
+ }
+ }
+ }
+
+ static void printReport() {
+ if (total == 0) return;
+ String report = """\
+Total: $total tests
+ * $skipped tests will be skipped
+ * $noCrash tests are expected to be flaky but not 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
+ * $crash tests are expected to crash that we should fix
+ * $timeout tests are allowed to timeout\
+""";
+ print(report);
+ }
+}
« no previous file with comments | « tools/testing/dart/test_progress.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698