2017-02-27 23:38:47 +00:00
|
|
|
// Copyright 2017 The Chromium Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2018-04-10 21:27:53 +00:00
|
|
|
import 'package:file_testing/file_testing.dart';
|
2018-08-15 03:33:58 +00:00
|
|
|
import 'package:mockito/mockito.dart';
|
|
|
|
|
2017-02-27 23:38:47 +00:00
|
|
|
import 'package:flutter_tools/executable.dart' as tools;
|
|
|
|
import 'package:flutter_tools/src/cache.dart';
|
|
|
|
import 'package:flutter_tools/src/base/io.dart';
|
|
|
|
import 'package:flutter_tools/src/base/os.dart';
|
|
|
|
|
2018-08-15 03:33:58 +00:00
|
|
|
import 'src/common.dart';
|
2017-02-27 23:38:47 +00:00
|
|
|
import 'src/context.dart';
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
Cache.disableLocking();
|
|
|
|
|
|
|
|
int exitCode;
|
|
|
|
setExitFunctionForTests((int code) {
|
|
|
|
exitCode = code;
|
|
|
|
});
|
|
|
|
|
|
|
|
group('--bug-report', () {
|
|
|
|
testUsingContext('generates valid zip file', () async {
|
|
|
|
await tools.main(<String>['devices', '--bug-report']);
|
|
|
|
expect(exitCode, 0);
|
|
|
|
verify(os.zip(any, argThat(hasPath(matches(r'bugreport_01\.zip')))));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|