Unverified Commit 65ef1f94 authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by GitHub

test flutter framework with null-safety (#59280)

parent 1fe0f226
...@@ -544,24 +544,27 @@ Future<void> _runAddToAppLifeCycleTests() async { ...@@ -544,24 +544,27 @@ Future<void> _runAddToAppLifeCycleTests() async {
Future<void> _runFrameworkTests() async { Future<void> _runFrameworkTests() async {
final bq.BigqueryApi bigqueryApi = await _getBigqueryApi(); final bq.BigqueryApi bigqueryApi = await _getBigqueryApi();
final List<String> nullSafetyOptions = <String>['--enable-experiment=non-nullable', '--no-sound-null-safety'];
final List<String> trackWidgetCreationAlternatives = <String>['--track-widget-creation', '--no-track-widget-creation'];
Future<void> runWidgets() async { Future<void> runWidgets() async {
print('${green}Running packages/flutter tests for$reset: ${cyan}test/widgets/$reset'); print('${green}Running packages/flutter tests for$reset: ${cyan}test/widgets/$reset');
await _runFlutterTest( for (final String trackWidgetCreationOption in trackWidgetCreationAlternatives) {
path.join(flutterRoot, 'packages', 'flutter'), await _runFlutterTest(
options: <String>['--track-widget-creation'], path.join(flutterRoot, 'packages', 'flutter'),
tableData: bigqueryApi?.tabledata, options: <String>[trackWidgetCreationOption, ...nullSafetyOptions],
tests: <String>[ path.join('test', 'widgets') + path.separator ], tableData: bigqueryApi?.tabledata,
); tests: <String>[ path.join('test', 'widgets') + path.separator ],
await _runFlutterTest( );
path.join(flutterRoot, 'packages', 'flutter'), }
options: <String>['--no-track-widget-creation'],
tableData: bigqueryApi?.tabledata,
tests: <String>[ path.join('test', 'widgets') + path.separator ],
);
// Try compiling code outside of the packages/flutter directory with and without --track-widget-creation // Try compiling code outside of the packages/flutter directory with and without --track-widget-creation
await _runFlutterTest(path.join(flutterRoot, 'dev', 'integration_tests', 'flutter_gallery'), options: <String>['--track-widget-creation'], tableData: bigqueryApi?.tabledata); for (final String trackWidgetCreationOption in trackWidgetCreationAlternatives) {
await _runFlutterTest(path.join(flutterRoot, 'dev', 'integration_tests', 'flutter_gallery'), options: <String>['--no-track-widget-creation'], tableData: bigqueryApi?.tabledata); await _runFlutterTest(
path.join(flutterRoot, 'dev', 'integration_tests', 'flutter_gallery'),
options: <String>[trackWidgetCreationOption],
tableData: bigqueryApi?.tabledata,
);
}
} }
Future<void> runLibraries() async { Future<void> runLibraries() async {
...@@ -572,18 +575,14 @@ Future<void> _runFrameworkTests() async { ...@@ -572,18 +575,14 @@ Future<void> _runFrameworkTests() async {
.map<String>((Directory dir) => path.join('test', path.basename(dir.path)) + path.separator) .map<String>((Directory dir) => path.join('test', path.basename(dir.path)) + path.separator)
.toList(); .toList();
print('${green}Running packages/flutter tests$reset for: $cyan${tests.join(", ")}$reset'); print('${green}Running packages/flutter tests$reset for: $cyan${tests.join(", ")}$reset');
await _runFlutterTest( for (final String trackWidgetCreationOption in trackWidgetCreationAlternatives) {
path.join(flutterRoot, 'packages', 'flutter'), await _runFlutterTest(
options: <String>['--track-widget-creation'], path.join(flutterRoot, 'packages', 'flutter'),
tableData: bigqueryApi?.tabledata, options: <String>[trackWidgetCreationOption, ...nullSafetyOptions],
tests: tests, tableData: bigqueryApi?.tabledata,
); tests: tests,
await _runFlutterTest( );
path.join(flutterRoot, 'packages', 'flutter'), }
options: <String>['--no-track-widget-creation'],
tableData: bigqueryApi?.tabledata,
tests: tests,
);
} }
Future<void> runMisc() async { Future<void> runMisc() async {
...@@ -604,9 +603,7 @@ Future<void> _runFrameworkTests() async { ...@@ -604,9 +603,7 @@ Future<void> _runFrameworkTests() async {
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_localizations'), tableData: bigqueryApi?.tabledata); await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_localizations'), tableData: bigqueryApi?.tabledata);
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_test'), tableData: bigqueryApi?.tabledata); await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_test'), tableData: bigqueryApi?.tabledata);
await _runFlutterTest(path.join(flutterRoot, 'packages', 'fuchsia_remote_debug_protocol'), tableData: bigqueryApi?.tabledata); await _runFlutterTest(path.join(flutterRoot, 'packages', 'fuchsia_remote_debug_protocol'), tableData: bigqueryApi?.tabledata);
await _runFlutterTest(path.join(flutterRoot, 'dev', 'integration_tests', 'non_nullable'), await _runFlutterTest(path.join(flutterRoot, 'dev', 'integration_tests', 'non_nullable'), options: nullSafetyOptions);
options: <String>['--enable-experiment=non-nullable', '--no-sound-null-safety'],
);
await _runFlutterTest( await _runFlutterTest(
path.join(flutterRoot, 'dev', 'tracing_tests'), path.join(flutterRoot, 'dev', 'tracing_tests'),
options: <String>['--enable-vmservice'], options: <String>['--enable-vmservice'],
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// @dart = 2.8
// This example shows how to build a render tree with a non-cartesian coordinate // This example shows how to build a render tree with a non-cartesian coordinate
// system. Most of the guts of this examples are in src/sector_layout.dart. // system. Most of the guts of this examples are in src/sector_layout.dart.
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// @dart = 2.8
import 'dart:math' as math; import 'dart:math' as math;
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
......
...@@ -5,7 +5,7 @@ homepage: http://flutter.dev ...@@ -5,7 +5,7 @@ homepage: http://flutter.dev
environment: environment:
# The pub client defaults to an <2.0.0 sdk constraint which we need to explicitly overwrite. # The pub client defaults to an <2.0.0 sdk constraint which we need to explicitly overwrite.
sdk: ">=2.2.2 <3.0.0" sdk: ">=2.9.0-14.0.dev <3.0.0"
dependencies: dependencies:
# To update these, use "flutter update-packages --force-upgrade". # To update these, use "flutter update-packages --force-upgrade".
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment