This reverts commit 283ec9e2a1.
This commit is contained in:
@@ -24,43 +24,43 @@ void main() {
|
||||
return scriptProcess;
|
||||
}
|
||||
|
||||
Future<void> expectScriptResult(List<String> testNames, { bool expectSuccess }) async {
|
||||
Future<void> expectScriptResult(List<String> testNames, int expectedExitCode) async {
|
||||
final ProcessResult result = await runScript(testNames);
|
||||
expect(result.exitCode, expectSuccess ? 0 : isNot(equals(0)),
|
||||
expect(result.exitCode, expectedExitCode,
|
||||
reason: '[ stderr from test process ]\n\n${result.stderr}\n\n[ end of stderr ]'
|
||||
'\n\n[ stdout from test process ]\n\n${result.stdout}\n\n[ end of stdout ]');
|
||||
}
|
||||
|
||||
test('exits with code 0 when succeeds', () async {
|
||||
await expectScriptResult(<String>['smoke_test_success'], expectSuccess: true);
|
||||
await expectScriptResult(<String>['smoke_test_success'], 0);
|
||||
});
|
||||
|
||||
test('accepts file paths', () async {
|
||||
await expectScriptResult(<String>['bin/tasks/smoke_test_success.dart'], expectSuccess: true);
|
||||
await expectScriptResult(<String>['bin/tasks/smoke_test_success.dart'], 0);
|
||||
});
|
||||
|
||||
test('rejects invalid file paths', () async {
|
||||
await expectScriptResult(<String>['lib/framework/adb.dart'], expectSuccess: false);
|
||||
await expectScriptResult(<String>['lib/framework/adb.dart'], 1);
|
||||
});
|
||||
|
||||
test('exits with code 1 when task throws', () async {
|
||||
await expectScriptResult(<String>['smoke_test_throws'], expectSuccess: false);
|
||||
await expectScriptResult(<String>['smoke_test_throws'], 1);
|
||||
});
|
||||
|
||||
test('exits with code 1 when fails', () async {
|
||||
await expectScriptResult(<String>['smoke_test_failure'], expectSuccess: false);
|
||||
await expectScriptResult(<String>['smoke_test_failure'], 1);
|
||||
});
|
||||
|
||||
test('exits with code 1 when fails to connect', () async {
|
||||
await expectScriptResult(<String>['smoke_test_setup_failure'], expectSuccess: false);
|
||||
});
|
||||
await expectScriptResult(<String>['smoke_test_setup_failure'], 1);
|
||||
}, skip: true); // https://github.com/flutter/flutter/issues/53707
|
||||
|
||||
test('exits with code 1 when results are mixed', () async {
|
||||
await expectScriptResult(<String>[
|
||||
'smoke_test_failure',
|
||||
'smoke_test_success',
|
||||
],
|
||||
expectSuccess: false,
|
||||
1,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user