| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
| 6 * Classes and methods for enumerating and preparing tests. | 6 * Classes and methods for enumerating and preparing tests. |
| 7 * | 7 * |
| 8 * This library includes: | 8 * This library includes: |
| 9 * | 9 * |
| 10 * - Creating tests by listing all the Dart files in certain directories, | 10 * - Creating tests by listing all the Dart files in certain directories, |
| (...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1106 dartFlags.add('--enable_asserts'); | 1106 dartFlags.add('--enable_asserts'); |
| 1107 dartFlags.add("--enable_type_checks"); | 1107 dartFlags.add("--enable_type_checks"); |
| 1108 } | 1108 } |
| 1109 dartFlags.addAll(vmOptions); | 1109 dartFlags.addAll(vmOptions); |
| 1110 } | 1110 } |
| 1111 | 1111 |
| 1112 commandSet.add(CommandBuilder.instance.getContentShellCommand( | 1112 commandSet.add(CommandBuilder.instance.getContentShellCommand( |
| 1113 contentShellFilename, fullHtmlPath, contentShellOptions, | 1113 contentShellFilename, fullHtmlPath, contentShellOptions, |
| 1114 dartFlags, configurationDir)); | 1114 dartFlags, configurationDir)); |
| 1115 } else { | 1115 } else { |
| 1116 // Use the BrowserController to send the test to a browser process. | 1116 assert(configuration['use_browser_controller']); |
| 1117 // This command is not actually run, it is used for reproducing | 1117 // This command is not actually run, it is used for reproducing |
| 1118 // the failure. | 1118 // the failure. |
| 1119 args = ['tools/testing/dart/launch_browser.dart', | 1119 args = ['tools/testing/dart/launch_browser.dart', |
| 1120 runtime, | 1120 runtime, |
| 1121 fullHtmlPath]; | 1121 fullHtmlPath]; |
| 1122 commandSet.add(CommandBuilder.instance.getBrowserTestCommand( | 1122 commandSet.add(CommandBuilder.instance.getBrowserTestCommand( |
| 1123 runtime, fullHtmlPath, TestUtils.dartTestExecutable.toString(), | 1123 runtime, fullHtmlPath, TestUtils.dartTestExecutable.toString(), |
| 1124 args, configurationDir, checkedMode: configuration['checked'])); | 1124 args, configurationDir, checkedMode: configuration['checked'])); |
| 1125 } | 1125 } |
| 1126 | 1126 |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1989 static int skippedByDesign = 0; | 1989 static int skippedByDesign = 0; |
| 1990 static int noCrash = 0; | 1990 static int noCrash = 0; |
| 1991 static int pass = 0; | 1991 static int pass = 0; |
| 1992 static int failOk = 0; | 1992 static int failOk = 0; |
| 1993 static int fail = 0; | 1993 static int fail = 0; |
| 1994 static int crash = 0; | 1994 static int crash = 0; |
| 1995 static int timeout = 0; | 1995 static int timeout = 0; |
| 1996 static int compileErrorSkip = 0; | 1996 static int compileErrorSkip = 0; |
| 1997 | 1997 |
| 1998 static void add(Set<Expectation> expectations) { | 1998 static void add(Set<Expectation> expectations) { |
| 1999 bool containsFail = expectations.any( |
| 2000 (expectation) => expectation.canBeOutcomeOf(Expectation.FAIL)); |
| 1999 ++total; | 2001 ++total; |
| 2000 if (expectations.contains(Expectation.SKIP)) { | 2002 if (expectations.contains(Expectation.SKIP)) { |
| 2001 ++skipped; | 2003 ++skipped; |
| 2002 } else if (expectations.contains(Expectation.SKIP_BY_DESIGN)) { | 2004 } else if (expectations.contains(Expectation.SKIP_BY_DESIGN)) { |
| 2003 ++skipped; | 2005 ++skipped; |
| 2004 ++skippedByDesign; | 2006 ++skippedByDesign; |
| 2005 } else { | 2007 } else { |
| 2008 // Counts the number of flaky tests. |
| 2006 if (expectations.contains(Expectation.PASS) && | 2009 if (expectations.contains(Expectation.PASS) && |
| 2007 expectations.contains(Expectation.FAIL) && | 2010 containsFail && |
| 2008 !expectations.contains(Expectation.CRASH) && | 2011 !expectations.contains(Expectation.CRASH) && |
| 2009 !expectations.contains(Expectation.OK)) { | 2012 !expectations.contains(Expectation.OK)) { |
| 2010 ++noCrash; | 2013 ++noCrash; |
| 2011 } | 2014 } |
| 2012 if (expectations.contains(Expectation.PASS) && expectations.length == 1) { | 2015 if (expectations.contains(Expectation.PASS) && expectations.length == 1) { |
| 2013 ++pass; | 2016 ++pass; |
| 2014 } | 2017 } |
| 2015 if (expectations.containsAll([Expectation.FAIL, Expectation.OK]) && | 2018 if (expectations.containsAll([Expectation.FAIL, Expectation.OK]) && |
| 2016 expectations.length == 2) { | 2019 expectations.length == 2) { |
| 2017 ++failOk; | 2020 ++failOk; |
| 2018 } | 2021 } |
| 2019 if (expectations.contains(Expectation.FAIL) && expectations.length == 1) { | 2022 if (containsFail && expectations.length == 1) { |
| 2020 ++fail; | 2023 ++fail; |
| 2021 } | 2024 } |
| 2022 if (expectations.contains(Expectation.CRASH) && | 2025 if (expectations.contains(Expectation.CRASH) && |
| 2023 expectations.length == 1) { | 2026 expectations.length == 1) { |
| 2024 ++crash; | 2027 ++crash; |
| 2025 } | 2028 } |
| 2026 if (expectations.contains(Expectation.TIMEOUT)) { | 2029 if (expectations.contains(Expectation.TIMEOUT)) { |
| 2027 ++timeout; | 2030 ++timeout; |
| 2028 } | 2031 } |
| 2029 } | 2032 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 2042 * $pass tests are expected to pass | 2045 * $pass tests are expected to pass |
| 2043 * $failOk tests are expected to fail that we won't fix | 2046 * $failOk tests are expected to fail that we won't fix |
| 2044 * $fail tests are expected to fail that we should fix | 2047 * $fail tests are expected to fail that we should fix |
| 2045 * $crash tests are expected to crash that we should fix | 2048 * $crash tests are expected to crash that we should fix |
| 2046 * $timeout tests are allowed to timeout | 2049 * $timeout tests are allowed to timeout |
| 2047 * $compileErrorSkip tests are skipped on browsers due to compile-time error | 2050 * $compileErrorSkip tests are skipped on browsers due to compile-time error |
| 2048 """; | 2051 """; |
| 2049 print(report); | 2052 print(report); |
| 2050 } | 2053 } |
| 2051 } | 2054 } |
| OLD | NEW |