Fail if precompiled test entry point is specified, but more than one test suite is run (#15208)

This commit is contained in:
Todd Volkert 2018-03-06 21:28:52 -08:00 committed by GitHub
parent 602e6d74b5
commit d0cbbd5394
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -159,10 +159,13 @@ class _FlutterPlatform extends PlatformPlugin {
@override
StreamChannel<dynamic> loadChannel(String testPath, TestPlatform platform) {
// Fail if there will be a port conflict.
if (explicitObservatoryPort != null) {
if (_testCount > 0)
if (_testCount > 0) {
// Fail if there will be a port conflict.
if (explicitObservatoryPort != null)
throwToolExit('installHook() was called with an observatory port or debugger mode enabled, but then more than one test suite was run.');
// Fail if we're passing in a precompiled entry-point.
if (dillFilePath != null)
throwToolExit('installHook() was called with a precompiled test entry-point, but then more than one test suite was run.');
}
final int ourTestCount = _testCount;
_testCount += 1;