diff --git a/testing/benchmark/pubspec.yaml b/testing/benchmark/pubspec.yaml index e32a3edd3c865..c69c058628f43 100644 --- a/testing/benchmark/pubspec.yaml +++ b/testing/benchmark/pubspec.yaml @@ -18,4 +18,4 @@ dependencies: path: any dev_dependencies: - litetest: any + test: any diff --git a/testing/benchmark/test/parse_and_send_test.dart b/testing/benchmark/test/parse_and_send_test.dart index 84625617e1408..98d2e51334066 100644 --- a/testing/benchmark/test/parse_and_send_test.dart +++ b/testing/benchmark/test/parse_and_send_test.dart @@ -4,9 +4,9 @@ import 'dart:io'; -import 'package:litetest/litetest.dart'; import 'package:metrics_center/metrics_center.dart'; import 'package:path/path.dart' as p; +import 'package:test/test.dart'; import '../bin/parse_and_send.dart' as pas; diff --git a/testing/run_tests.py b/testing/run_tests.py index 10ddf9e7ce53f..f18b5f3d5ef65 100755 --- a/testing/run_tests.py +++ b/testing/run_tests.py @@ -984,7 +984,7 @@ def build_dart_host_test_list(build_dir): (os.path.join('flutter', 'testing', 'scenario_app'), []), ( os.path.join('flutter', 'tools', 'api_check'), - [os.path.join(BUILDROOT_DIR, 'flutter')], + [], ), (os.path.join('flutter', 'tools', 'build_bucket_golden_scraper'), []), (os.path.join('flutter', 'tools', 'clang_tidy'), []), diff --git a/tools/api_check/pubspec.yaml b/tools/api_check/pubspec.yaml index c4bd1599f447a..dc35621348c89 100644 --- a/tools/api_check/pubspec.yaml +++ b/tools/api_check/pubspec.yaml @@ -14,12 +14,8 @@ resolution: workspace dependencies: analyzer: any - _fe_analyzer_shared: any - pub_semver: any dev_dependencies: - async_helper: any - expect: any - litetest: any + engine_repo_tools: any path: any - smith: any + test: any diff --git a/tools/api_check/test/apicheck_test.dart b/tools/api_check/test/apicheck_test.dart index f32bb339f8f8a..8658f966040cc 100644 --- a/tools/api_check/test/apicheck_test.dart +++ b/tools/api_check/test/apicheck_test.dart @@ -2,21 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:io'; - import 'package:analyzer/dart/ast/ast.dart'; import 'package:analyzer/dart/ast/visitor.dart'; import 'package:apicheck/apicheck.dart'; -import 'package:litetest/litetest.dart'; +import 'package:engine_repo_tools/engine_repo_tools.dart'; import 'package:path/path.dart' as path; +import 'package:test/test.dart'; -void main(List arguments) { - if (arguments.isEmpty) { - print('usage: dart bin/apicheck.dart path/to/engine/src/flutter'); - exit(1); - } - - final String flutterRoot = arguments[0]; +void main() { + final String flutterRoot = Engine.findWithin().flutterDir.path; checkApiConsistency(flutterRoot); checkNativeApi(flutterRoot); @@ -45,12 +39,14 @@ void checkApiConsistency(String flutterRoot) { ); // C values: kFlutterAccessibilityFeatureFooBar = 1 << N, final List embedderEnumValues = getCppEnumValues( - sourcePath: path.join(flutterRoot, 'shell', 'platform', 'embedder', 'embedder.h'), + sourcePath: + path.join(flutterRoot, 'shell', 'platform', 'embedder', 'embedder.h'), enumName: 'FlutterAccessibilityFeature', ); // C++ values: kFooBar = 1 << N, final List internalEnumValues = getCppEnumClassValues( - sourcePath: path.join(flutterRoot, 'lib','ui', 'window', 'platform_configuration.h'), + sourcePath: path.join( + flutterRoot, 'lib', 'ui', 'window', 'platform_configuration.h'), enumName: 'AccessibilityFeatureFlag', ); // Java values: FOO_BAR(1 << N). @@ -72,17 +68,20 @@ void checkApiConsistency(String flutterRoot) { className: 'SemanticsAction', ); final List webuiFields = getDartClassFields( - sourcePath: path.join(flutterRoot, 'lib', 'web_ui', 'lib', 'semantics.dart'), + sourcePath: + path.join(flutterRoot, 'lib', 'web_ui', 'lib', 'semantics.dart'), className: 'SemanticsAction', ); // C values: kFlutterSemanticsActionFooBar = 1 << N. final List embedderEnumValues = getCppEnumValues( - sourcePath: path.join(flutterRoot, 'shell', 'platform', 'embedder', 'embedder.h'), + sourcePath: + path.join(flutterRoot, 'shell', 'platform', 'embedder', 'embedder.h'), enumName: 'FlutterSemanticsAction', ); // C++ values: kFooBar = 1 << N. final List internalEnumValues = getCppEnumClassValues( - sourcePath: path.join(flutterRoot, 'lib', 'ui', 'semantics', 'semantics_node.h'), + sourcePath: + path.join(flutterRoot, 'lib', 'ui', 'semantics', 'semantics_node.h'), enumName: 'SemanticsAction', ); // Java values: FOO_BAR(1 << N). @@ -101,22 +100,34 @@ void checkApiConsistency(String flutterRoot) { test('AppLifecycleState enums match', () { // Dart values: _kFooBarIndex = 1 << N. final List uiFields = getDartClassFields( - sourcePath: path.join(flutterRoot, 'lib', 'ui', 'platform_dispatcher.dart'), + sourcePath: + path.join(flutterRoot, 'lib', 'ui', 'platform_dispatcher.dart'), className: 'AppLifecycleState', ); final List webuiFields = getDartClassFields( - sourcePath: path.join(flutterRoot, 'lib', 'web_ui', 'lib', 'platform_dispatcher.dart'), + sourcePath: path.join( + flutterRoot, 'lib', 'web_ui', 'lib', 'platform_dispatcher.dart'), className: 'AppLifecycleState', ); // C++ values: kFooBar = 1 << N. final List internalEnumValues = getCppEnumClassValues( - sourcePath: path.join(flutterRoot, 'shell', 'platform', 'common', 'app_lifecycle_state.h'), + sourcePath: path.join( + flutterRoot, 'shell', 'platform', 'common', 'app_lifecycle_state.h'), enumName: 'AppLifecycleState', ); // Java values: FOO_BAR(1 << N). final List javaEnumValues = getJavaEnumValues( - sourcePath: path.join(flutterRoot, 'shell', 'platform', 'android', 'io', - 'flutter', 'embedding', 'engine', 'systemchannels', 'LifecycleChannel.java'), + sourcePath: path.join( + flutterRoot, + 'shell', + 'platform', + 'android', + 'io', + 'flutter', + 'embedding', + 'engine', + 'systemchannels', + 'LifecycleChannel.java'), enumName: 'AppLifecycleState', ).map(allCapsToCamelCase).toList(); @@ -137,12 +148,14 @@ void checkApiConsistency(String flutterRoot) { ); // C values: kFlutterSemanticsFlagFooBar = 1 << N. final List embedderEnumValues = getCppEnumValues( - sourcePath: path.join(flutterRoot, 'shell', 'platform', 'embedder', 'embedder.h'), + sourcePath: + path.join(flutterRoot, 'shell', 'platform', 'embedder', 'embedder.h'), enumName: 'FlutterSemanticsFlag', ); // C++ values: kFooBar = 1 << N. final List internalEnumValues = getCppEnumClassValues( - sourcePath: path.join(flutterRoot, 'lib', 'ui', 'semantics', 'semantics_node.h'), + sourcePath: + path.join(flutterRoot, 'lib', 'ui', 'semantics', 'semantics_node.h'), enumName: 'SemanticsFlags', ); // Java values: FOO_BAR(1 << N). @@ -185,7 +198,8 @@ class NativeFunctionVisitor extends RecursiveAstVisitor { @override void visitNativeFunctionBody(NativeFunctionBody node) { - final MethodDeclaration? method = node.thisOrAncestorOfType(); + final MethodDeclaration? method = + node.thisOrAncestorOfType(); if (method != null) { if (method.parameters != null) { check(method.toString(), method.parameters!); @@ -193,7 +207,8 @@ class NativeFunctionVisitor extends RecursiveAstVisitor { return; } - final FunctionDeclaration? func = node.thisOrAncestorOfType(); + final FunctionDeclaration? func = + node.thisOrAncestorOfType(); if (func != null) { final FunctionExpression funcExpr = func.functionExpression; if (funcExpr.parameters != null) {