| Index: tools/testing/dart/test_suite.dart
|
| diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
|
| index 2a2e80973c17f4e7c7e3b964b5287f530b96c9e5..e3d5b484ad4cbd667dc82cb1a0cd4ceaab9acae7 100644
|
| --- a/tools/testing/dart/test_suite.dart
|
| +++ b/tools/testing/dart/test_suite.dart
|
| @@ -35,6 +35,7 @@ typedef void CreateTest(Path filePath,
|
| bool hasCompileError,
|
| bool hasRuntimeError,
|
| {bool isNegativeIfChecked,
|
| + bool hasCompileErrorIfChecked,
|
| bool hasStaticWarning,
|
| Set<String> multitestOutcome,
|
| String multitestKey,
|
| @@ -315,7 +316,7 @@ abstract class TestSuite {
|
| if (configuration['report']) {
|
| SummaryReport.add(expectations);
|
| if (testCase.info != null &&
|
| - testCase.info.hasCompileError &&
|
| + testCase.expectCompileError &&
|
| TestUtils.isBrowserRuntime(configuration['runtime']) &&
|
| configuration['compiler'] != 'none') {
|
| SummaryReport.addCompileErrorSkipTest();
|
| @@ -607,13 +608,15 @@ class TestInformation {
|
| bool hasCompileError;
|
| bool hasRuntimeError;
|
| bool isNegativeIfChecked;
|
| + bool hasCompileErrorIfChecked;
|
| bool hasStaticWarning;
|
| Set<String> multitestOutcome;
|
| String multitestKey;
|
|
|
| TestInformation(this.filePath, this.optionsFromFile,
|
| this.hasCompileError, this.hasRuntimeError,
|
| - this.isNegativeIfChecked, this.hasStaticWarning,
|
| + this.isNegativeIfChecked, this.hasCompileErrorIfChecked,
|
| + this.hasStaticWarning,
|
| this.multitestOutcome,
|
| {this.multitestKey, this.originTestPath}) {
|
| assert(filePath.isAbsolute);
|
| @@ -930,7 +933,7 @@ class StandardTestSuite extends TestSuite {
|
| multitestName: optionsFromFile['isMultitest'] ? info.multitestKey : "");
|
|
|
| Set<Expectation> expectations = testExpectations.expectations(testName);
|
| - if (configuration['compiler'] != 'none' && info.hasCompileError) {
|
| + if (configuration['compiler'] != 'none' && expectCompileError(info)) {
|
| // If a compile-time error is expected, and we're testing a
|
| // compiler, we never need to attempt to run the program (in a
|
| // browser or otherwise).
|
| @@ -986,8 +989,13 @@ class StandardTestSuite extends TestSuite {
|
| }
|
| }
|
|
|
| + bool expectCompileError(TestInformation info) {
|
| + return info.hasCompileError ||
|
| + (configuration['checked'] && info.hasCompileErrorIfChecked);
|
| + }
|
| +
|
| bool isNegative(TestInformation info) {
|
| - bool negative = info.hasCompileError ||
|
| + bool negative = expectCompileError(info) ||
|
| (configuration['checked'] && info.isNegativeIfChecked);
|
| if (info.hasRuntimeError && hasRuntime) {
|
| negative = true;
|
| @@ -1016,7 +1024,7 @@ class StandardTestSuite extends TestSuite {
|
| }
|
|
|
| List<Command> commands = <Command>[command];
|
| - if (info.hasCompileError) {
|
| + if (expectCompileError(info)) {
|
| // Do not attempt to run the compiled result. A compilation
|
| // error should be reported by the compilation command.
|
| } else if (configuration['runtime'] == 'd8') {
|
| @@ -1040,7 +1048,7 @@ class StandardTestSuite extends TestSuite {
|
| compiler, "$tempDir/out.dart", !useSdk,
|
| dart2JsBootstrapDependencies, compilerPath, args,
|
| environmentOverrides)];
|
| - if (info.hasCompileError) {
|
| + if (expectCompileError(info)) {
|
| // Do not attempt to run the compiled result. A compilation
|
| // error should be reported by the compilation command.
|
| } else if (configuration['runtime'] == 'vm') {
|
| @@ -1084,6 +1092,7 @@ class StandardTestSuite extends TestSuite {
|
| bool hasCompileError,
|
| bool hasRuntimeError,
|
| {bool isNegativeIfChecked: false,
|
| + bool hasCompileErrorIfChecked: false,
|
| bool hasStaticWarning: false,
|
| Set<String> multitestOutcome: null,
|
| String multitestKey,
|
| @@ -1094,6 +1103,7 @@ class StandardTestSuite extends TestSuite {
|
| hasCompileError,
|
| hasRuntimeError,
|
| isNegativeIfChecked,
|
| + hasCompileErrorIfChecked,
|
| hasStaticWarning,
|
| multitestOutcome,
|
| multitestKey: multitestKey,
|
|
|