@@ -47,7 +47,7 @@ class CommandOutput {
47
47
Expectation result (TestCase testCase) {
48
48
if (hasCrashed) return Expectation .crash;
49
49
if (hasTimedOut) return Expectation .timeout;
50
- if (hasFailed (testCase)) return Expectation .fail;
50
+ if (_didFail (testCase)) return Expectation .fail;
51
51
if (hasNonUtf8) return Expectation .nonUtf8Error;
52
52
53
53
return Expectation .pass;
@@ -111,23 +111,8 @@ class CommandOutput {
111
111
return ! hasTimedOut && exitCode == 0 ;
112
112
}
113
113
114
- // Reverse result of a negative test.
115
- bool hasFailed (TestCase testCase) {
116
- return testCase.isNegative ? ! _didFail (testCase) : _didFail (testCase);
117
- }
118
-
119
114
bool get hasNonUtf8 => exitCode == nonUtfFakeExitCode;
120
115
121
- Expectation _negateOutcomeIfNegativeTest (
122
- Expectation outcome, bool isNegative) {
123
- if (! isNegative) return outcome;
124
- if (outcome == Expectation .ignore) return outcome;
125
- if (outcome.canBeOutcomeOf (Expectation .fail)) {
126
- return Expectation .pass;
127
- }
128
- return Expectation .fail;
129
- }
130
-
131
116
/// Called when producing output for a test failure to describe this output.
132
117
void describe (TestCase testCase, Progress progress, OutputWriter output) {
133
118
output.subsection ("exit code" );
@@ -282,7 +267,7 @@ class BrowserCommandOutput extends CommandOutput
282
267
with _UnittestSuiteMessagesMixin {
283
268
final BrowserTestJsonResult _jsonResult;
284
269
final BrowserTestOutput _result;
285
- final Expectation _rawOutcome ;
270
+ final Expectation _outcome ;
286
271
287
272
factory BrowserCommandOutput (Command command, BrowserTestOutput result) {
288
273
Expectation outcome;
@@ -317,7 +302,7 @@ class BrowserCommandOutput extends CommandOutput
317
302
}
318
303
319
304
BrowserCommandOutput ._internal (Command command, BrowserTestOutput result,
320
- this ._rawOutcome , this ._jsonResult, List <int > stdout, List <int > stderr)
305
+ this ._outcome , this ._jsonResult, List <int > stdout, List <int > stderr)
321
306
: _result = result,
322
307
super (command, 0 , result.didTimeout, stdout, stderr, result.duration,
323
308
false , 0 );
@@ -332,11 +317,11 @@ class BrowserCommandOutput extends CommandOutput
332
317
333
318
// Multitests are handled specially.
334
319
if (testCase.hasRuntimeError) {
335
- if (_rawOutcome == Expectation .runtimeError) return Expectation .pass;
320
+ if (_outcome == Expectation .runtimeError) return Expectation .pass;
336
321
return Expectation .missingRuntimeError;
337
322
}
338
323
339
- return _negateOutcomeIfNegativeTest (_rawOutcome, testCase.isNegative) ;
324
+ return _outcome ;
340
325
}
341
326
342
327
/// Cloned code from member result(), with changes.
@@ -348,7 +333,7 @@ class BrowserCommandOutput extends CommandOutput
348
333
}
349
334
350
335
if (hasNonUtf8) return Expectation .nonUtf8Error;
351
- return _rawOutcome ;
336
+ return _outcome ;
352
337
}
353
338
354
339
void describe (TestCase testCase, Progress progress, OutputWriter output) {
@@ -509,13 +494,6 @@ class AnalysisCommandOutput extends CommandOutput with _StaticErrorOutput {
509
494
return _validateExpectedErrors (testCase);
510
495
}
511
496
512
- // Handle negative.
513
- if (testCase.isNegative) {
514
- return errors.isNotEmpty
515
- ? Expectation .pass
516
- : Expectation .missingCompileTimeError;
517
- }
518
-
519
497
// Handle errors / missing errors.
520
498
if (testCase.hasCompileError) {
521
499
if (errors.isNotEmpty) {
@@ -727,8 +705,7 @@ class VMCommandOutput extends CommandOutput with _UnittestSuiteMessagesMixin {
727
705
outcome = Expectation .fail;
728
706
}
729
707
730
- outcome = _negateOutcomeIfIncompleteAsyncTest (outcome, decodeUtf8 (stdout));
731
- return _negateOutcomeIfNegativeTest (outcome, testCase.isNegative);
708
+ return _negateOutcomeIfIncompleteAsyncTest (outcome, decodeUtf8 (stdout));
732
709
}
733
710
734
711
/// Cloned code from member result(), with changes.
@@ -835,9 +812,7 @@ class CompilationCommandOutput extends CommandOutput {
835
812
return Expectation .compileTimeError;
836
813
}
837
814
838
- var outcome =
839
- exitCode == 0 ? Expectation .pass : Expectation .compileTimeError;
840
- return _negateOutcomeIfNegativeTest (outcome, testCase.isNegative);
815
+ return exitCode == 0 ? Expectation .pass : Expectation .compileTimeError;
841
816
}
842
817
}
843
818
@@ -866,9 +841,7 @@ class DevCompilerCommandOutput extends CommandOutput {
866
841
: Expectation .pass;
867
842
}
868
843
869
- var outcome =
870
- exitCode == 0 ? Expectation .pass : Expectation .compileTimeError;
871
- return _negateOutcomeIfNegativeTest (outcome, testCase.isNegative);
844
+ return exitCode == 0 ? Expectation .pass : Expectation .compileTimeError;
872
845
}
873
846
874
847
/// Cloned code from member result(), with changes.
@@ -930,16 +903,15 @@ class VMKernelCompilationCommandOutput extends CompilationCommandOutput {
930
903
}
931
904
932
905
// The actual outcome depends on the exitCode.
933
- var outcome = Expectation .pass;
934
906
if (exitCode == VMCommandOutput ._compileErrorExitCode ||
935
907
exitCode == kBatchModeCompileTimeErrorExit) {
936
- outcome = Expectation .compileTimeError;
908
+ return Expectation .compileTimeError;
937
909
} else if (exitCode != 0 ) {
938
910
// This is a general fail, in case we get an unknown nonzero exitcode.
939
- outcome = Expectation .fail;
911
+ return Expectation .fail;
940
912
}
941
913
942
- return _negateOutcomeIfNegativeTest (outcome, testCase.isNegative) ;
914
+ return Expectation .pass ;
943
915
}
944
916
945
917
/// Cloned code from member result(), with changes.
@@ -1003,8 +975,7 @@ class JSCommandLineOutput extends CommandOutput
1003
975
}
1004
976
1005
977
var outcome = exitCode == 0 ? Expectation .pass : Expectation .runtimeError;
1006
- outcome = _negateOutcomeIfIncompleteAsyncTest (outcome, decodeUtf8 (stdout));
1007
- return _negateOutcomeIfNegativeTest (outcome, testCase.isNegative);
978
+ return _negateOutcomeIfIncompleteAsyncTest (outcome, decodeUtf8 (stdout));
1008
979
}
1009
980
1010
981
/// Cloned code from member result(), with changes.
0 commit comments