2019-11-27 23:04:02 +00:00
|
|
|
// Copyright 2014 The Flutter Authors. All rights reserved.
|
2015-09-29 21:26:42 +00:00
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2016-11-14 03:09:03 +00:00
|
|
|
import 'package:flutter_tools/src/base/common.dart';
|
2020-06-26 20:36:06 +00:00
|
|
|
import 'package:flutter_tools/src/cache.dart';
|
2015-11-10 21:18:34 +00:00
|
|
|
import 'package:flutter_tools/src/commands/logs.dart';
|
2015-09-29 21:26:42 +00:00
|
|
|
|
2019-07-13 18:51:44 +00:00
|
|
|
import '../../src/common.dart';
|
|
|
|
import '../../src/context.dart';
|
2015-09-29 21:26:42 +00:00
|
|
|
|
2016-03-10 01:43:14 +00:00
|
|
|
void main() {
|
2015-09-29 21:26:42 +00:00
|
|
|
group('logs', () {
|
2020-06-26 20:36:06 +00:00
|
|
|
setUp(() {
|
|
|
|
Cache.disableLocking();
|
|
|
|
});
|
|
|
|
|
|
|
|
tearDown(() {
|
|
|
|
Cache.enableLocking();
|
|
|
|
});
|
|
|
|
|
2016-11-14 03:09:03 +00:00
|
|
|
testUsingContext('fail with a bad device id', () async {
|
2018-09-12 06:29:29 +00:00
|
|
|
final LogsCommand command = LogsCommand();
|
2016-11-14 03:09:03 +00:00
|
|
|
try {
|
|
|
|
await createTestCommandRunner(command).run(<String>['-d', 'abc123', 'logs']);
|
|
|
|
fail('Expect exception');
|
|
|
|
} on ToolExit catch (e) {
|
|
|
|
expect(e.exitCode ?? 1, 1);
|
|
|
|
}
|
2015-09-29 21:26:42 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|