Add --bug-report flag (#8435)
This adds support for a `--bug-report` flag, which is a recording that: - includes the arguments that were passed to the command runner - is zipped up for easy attachment in Guthub issues
This commit is contained in:
41
packages/flutter_tools/test/src/base/process_test.dart
Normal file
41
packages/flutter_tools/test/src/base/process_test.dart
Normal file
@@ -0,0 +1,41 @@
|
||||
// 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.
|
||||
|
||||
import 'package:flutter_tools/src/base/process.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
void main() {
|
||||
group('shutdownHooks', () {
|
||||
test('runInExpectedOrder', () async {
|
||||
int i = 1;
|
||||
int serializeRecording1;
|
||||
int serializeRecording2;
|
||||
int postProcessRecording;
|
||||
int cleanup;
|
||||
|
||||
addShutdownHook(() async {
|
||||
serializeRecording1 = i++;
|
||||
}, ShutdownStage.SERIALIZE_RECORDING);
|
||||
|
||||
addShutdownHook(() async {
|
||||
cleanup = i++;
|
||||
}, ShutdownStage.CLEANUP);
|
||||
|
||||
addShutdownHook(() async {
|
||||
postProcessRecording = i++;
|
||||
}, ShutdownStage.POST_PROCESS_RECORDING);
|
||||
|
||||
addShutdownHook(() async {
|
||||
serializeRecording2 = i++;
|
||||
}, ShutdownStage.SERIALIZE_RECORDING);
|
||||
|
||||
await runShutdownHooks();
|
||||
|
||||
expect(serializeRecording1, lessThanOrEqualTo(2));
|
||||
expect(serializeRecording2, lessThanOrEqualTo(2));
|
||||
expect(postProcessRecording, 3);
|
||||
expect(cleanup, 4);
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user