Add separate driver file for performance tests (#890)

pull/894/head
Abdullah Deshmukh 3 years ago committed by GitHub
parent 912418be86
commit 69abb6146a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -30,7 +30,7 @@ The Flutter SDK can run unit tests and widget tests in a virtual machine, withou
- Integration Tests:
- Run `flutter drive --driver=integration_test/driver.dart --target=integration_test/app_test.dart`
- Performance Tests:
- Run `flutter drive --driver=integration_test/driver.dart --target=integration_test/perf_test.dart --profile --trace-startup`
- Run `flutter drive --driver=integration_test/perf_driver.dart --target=integration_test/perf_test.dart --profile --trace-startup`
- Using a physical device and running performance tests in profile mode is recommended.
- The `--trace-startup` option is used to avoid flushing older timeline events when the timeline gets long.
- State Management Tests:

@ -0,0 +1,25 @@
// Copyright 2021 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:developer';
import 'package:integration_test/integration_test_driver.dart';
Future<void> main() {
return integrationDriver(
responseDataCallback: (data) async {
// If the tests reported any data, save it to the disk.
if (data != null) {
for (var entry in data.entries) {
log('Writing ${entry.key} to the disk.');
// Default storage destination is the 'build' directory.
await writeResponseData(
entry.value as Map<String, dynamic>,
testOutputFilename: entry.key,
);
}
}
},
);
}
Loading…
Cancel
Save