Accept any nonzero exit code as a signal of failure in the missing dependency test (#8738)

This commit is contained in:
Jason Simmons
2017-03-13 11:17:09 -07:00
committed by GitHub
parent fecc4e6584
commit 3d5d63a8aa

View File

@@ -25,23 +25,23 @@ void main() {
testUsingContext('TestAsyncUtils guarded function test', () async {
Cache.flutterRoot = '../..';
return _testFile('test_async_utils_guarded', 1, automatedTestsDirectory, flutterTestDirectory);
return _testFile('test_async_utils_guarded', automatedTestsDirectory, flutterTestDirectory);
});
testUsingContext('TestAsyncUtils unguarded function test', () async {
Cache.flutterRoot = '../..';
return _testFile('test_async_utils_unguarded', 1, automatedTestsDirectory, flutterTestDirectory);
return _testFile('test_async_utils_unguarded', automatedTestsDirectory, flutterTestDirectory);
});
testUsingContext('Missing flutter_test dependency', () async {
final String missingDependencyTests = fs.path.join('..', '..', 'dev', 'missing_dependency_tests');
Cache.flutterRoot = '../..';
return _testFile('trivial', 1, missingDependencyTests, missingDependencyTests);
return _testFile('trivial', missingDependencyTests, missingDependencyTests);
});
}, skip: io.Platform.isWindows); // TODO(goderbauer): enable when sky_shell is available
}
Future<Null> _testFile(String testName, int wantedExitCode, String workingDirectory, String testDirectory) async {
Future<Null> _testFile(String testName, String workingDirectory, String testDirectory) async {
final String fullTestName = fs.path.join(testDirectory, '${testName}_test.dart');
final File testFile = fs.file(fullTestName);
expect(testFile.existsSync(), true);
@@ -71,7 +71,7 @@ Future<Null> _testFile(String testName, int wantedExitCode, String workingDirect
testExclusionCompleter.complete();
}
expect(exec.exitCode, wantedExitCode);
expect(exec.exitCode, isNonZero);
final List<String> output = exec.stdout.split('\n');
output.add('<<stderr>>');
output.addAll(exec.stderr.split('\n'));