Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #library("test_suite"); | 5 #library("test_suite"); |
| 6 | 6 |
| 7 #import("status_file_parser.dart"); | 7 #import("status_file_parser.dart"); |
| 8 #import("test_runner.dart"); | 8 #import("test_runner.dart"); |
| 9 #import("multitest.dart"); | 9 #import("multitest.dart"); |
| 10 | 10 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 200 if (start != -1) { | 200 if (start != -1) { |
| 201 testName = filename.substring(start + 4, filename.length - 5); | 201 testName = filename.substring(start + 4, filename.length - 5); |
| 202 } else { | 202 } else { |
| 203 // Only multitests in a temporary directory should reach here. | 203 // Only multitests in a temporary directory should reach here. |
| 204 start = filename.lastIndexOf(pathSeparator); | 204 start = filename.lastIndexOf(pathSeparator); |
| 205 int middle = filename.lastIndexOf('_'); | 205 int middle = filename.lastIndexOf('_'); |
| 206 testName = filename.substring(start + 1, middle) + pathSeparator + | 206 testName = filename.substring(start + 1, middle) + pathSeparator + |
| 207 filename.substring(middle + 1, filename.length - 5); | 207 filename.substring(middle + 1, filename.length - 5); |
| 208 } | 208 } |
| 209 Set<String> expectations = testExpectations.expectations(testName); | 209 Set<String> expectations = testExpectations.expectations(testName); |
| 210 | 210 if (configuration["report"]) { |
|
Mads Ager (google)
2011/12/01 19:53:53
You want to add this above in the CCTestSuite as w
| |
| 211 // Tests with multiple VMOptions are counted more than once. | |
| 212 for (var dummy in optionsFromFile["vmOptions"]) { | |
| 213 SummaryReport.add(expectations); | |
| 214 } | |
| 215 } | |
| 211 if (expectations.contains(SKIP)) return; | 216 if (expectations.contains(SKIP)) return; |
| 212 | 217 |
| 213 isNegative = isNegative || | 218 isNegative = isNegative || |
| 214 (configuration['checked'] && isNegativeIfChecked); | 219 (configuration['checked'] && isNegativeIfChecked); |
| 215 var argumentLists = argumentListsFromFile(filename, optionsFromFile); | 220 var argumentLists = argumentListsFromFile(filename, optionsFromFile); |
| 216 for (var args in argumentLists) { | 221 for (var args in argumentLists) { |
| 217 doTest(new TestCase(testName, | 222 doTest(new TestCase(testName, |
| 218 shellPath, | 223 shellPath, |
| 219 args, | 224 args, |
| 220 timeout, | 225 timeout, |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 398 args.add("--enable_leg"); | 403 args.add("--enable_leg"); |
| 399 } | 404 } |
| 400 if (configuration["component"] == "dartc") { | 405 if (configuration["component"] == "dartc") { |
| 401 if (configuration["mode"] == "release") { | 406 if (configuration["mode"] == "release") { |
| 402 args.add("--optimize"); | 407 args.add("--optimize"); |
| 403 } | 408 } |
| 404 } | 409 } |
| 405 return args; | 410 return args; |
| 406 } | 411 } |
| 407 } | 412 } |
| 413 | |
| 414 class SummaryReport { | |
| 415 static int total = 0; | |
| 416 static int skipped = 0; | |
| 417 static int noCrash = 0; | |
| 418 static int pass = 0; | |
| 419 static int failOk = 0; | |
| 420 static int fail = 0; | |
| 421 static int crash = 0; | |
| 422 static int timeout = 0; | |
| 423 | |
| 424 static void add(Set<String> expect) { | |
|
Mads Ager (google)
2011/12/01 19:53:53
I'd spell out 'expectations'.
| |
| 425 ++total; | |
| 426 if (expect.contains(SKIP)) { | |
| 427 ++skipped; | |
| 428 } else { | |
| 429 if (expect.contains(PASS) && expect.contains(FAIL) && | |
| 430 !expect.contains(CRASH) && !expect.contains(OK)) { | |
| 431 ++noCrash; | |
| 432 } | |
| 433 if (expect.contains(PASS) && expect.isSubsetOf([PASS])) { | |
|
Mads Ager (google)
2011/12/01 19:53:53
I would prefer:
expect.contains(PASS) && expect.l
| |
| 434 ++pass; | |
| 435 } | |
| 436 if (expect.containsAll([FAIL, OK]) && expect.isSubsetOf([FAIL, OK])) { | |
| 437 ++failOk; | |
| 438 } | |
| 439 if (expect.contains(FAIL) && expect.isSubsetOf([FAIL])) { | |
| 440 ++fail; | |
| 441 } | |
| 442 if (expect.contains(CRASH) && expect.isSubsetOf([CRASH])) { | |
| 443 ++crash; | |
| 444 } | |
| 445 if (expect.contains(TIMEOUT)) { | |
| 446 ++timeout; | |
| 447 } | |
| 448 } | |
|
Mads Ager (google)
2011/12/01 19:53:53
I see what you mean about the reporting being stra
| |
| 449 } | |
| 450 | |
| 451 static void printReport() { | |
| 452 if (total == 0) return; | |
| 453 String report = """\ | |
| 454 Total: $total tests | |
| 455 * $skipped tests will be skipped | |
| 456 * $noCrash tests are expected to be flaky but not crash | |
| 457 * $pass tests are expected to pass | |
| 458 * $failOk tests are expected to fail that we won't fix | |
| 459 * $fail tests are expected to fail that we should fix | |
| 460 * $crash tests are expected to crash that we should fix | |
| 461 * $timeout tests are allowed to timeout\ | |
| 462 """; | |
| 463 print(report); | |
| 464 } | |
| 465 } | |
| OLD | NEW |