Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit bb0c6f8

Browse files
authored
Move zircon_tests from package:litetest to package:async_helper. (#55149)
The engine has historically used `package:litetest`, a home grown invention that is a wrapper around the Dart SDK. In flutter/flutter#133569, we've moved over to the heavier weight `package:test`, which has been simplified since first evaluated by the Dart SDK vending the dependencies we need. The last user of `package:litetest` is a single test in the Fuchsia SDK, `zircon_tests`. This PR migrates the test from `litetest` (which will be deleted) to the Dart SK vendored `async_minittest`. For this simple test case, there is only a 1-line behavioral change (`notEquals(foo)` becomes `!= foo, true`), and it allows us to remove dependencies from the tree.
1 parent c8fc350 commit bb0c6f8

File tree

3 files changed

+12
-35
lines changed

3 files changed

+12
-35
lines changed

shell/platform/fuchsia/dart-pkg/zircon/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ dart_library("zircon_tests_lib") {
6565
package_root = "test"
6666

6767
sources = [ "zircon_tests.dart" ]
68-
deps = [ "//flutter/shell/platform/fuchsia/dart:litetest" ]
68+
deps = [ "//flutter/shell/platform/fuchsia/dart:async_helper" ]
6969
}
7070

7171
flutter_component("zircon_tests_component") {

shell/platform/fuchsia/dart-pkg/zircon/test/zircon_tests.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import 'dart:io';
88
import 'dart:typed_data';
99
import 'dart:zircon';
1010

11-
import 'package:litetest/litetest.dart';
11+
import 'package:async_helper/async_minitest.dart';
1212

1313
/// Helper method to turn a [String] into a [ByteData] containing the
1414
/// text of the string encoded as UTF-8.
@@ -198,7 +198,7 @@ void main() {
198198
final HandleResult vmo = System.vmoCreate(0);
199199
expect(vmo.status, equals(ZX.OK));
200200
int originalKoid = vmo.handle.koid;
201-
expect(originalKoid, notEquals(ZX.KOID_INVALID));
201+
expect(originalKoid != ZX.KOID_INVALID, true);
202202
// Cached koid should be same value.
203203
expect(originalKoid, equals(vmo.handle.koid));
204204
vmo.handle.close();

shell/platform/fuchsia/dart/BUILD.gn

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -59,36 +59,21 @@ dart_library("async_helper") {
5959

6060
pubspec = "$package_root/pubspec.yaml"
6161

62-
deps = []
62+
deps = [ ":expect" ]
6363

6464
sources = [
6565
"async_helper.dart",
6666
"async_minitest.dart",
6767
]
6868
}
6969

70-
dart_library("meta") {
71-
package_root = "$dart_src/pkg/meta"
72-
package_name = "meta"
73-
74-
pubspec = "$package_root/pubspec.yaml"
75-
76-
deps = []
77-
78-
sources = [
79-
"dart2js.dart",
80-
"meta.dart",
81-
"meta_meta.dart",
82-
]
83-
}
84-
8570
dart_library("expect") {
8671
package_root = "$dart_src/pkg/expect"
8772
package_name = "expect"
8873

8974
pubspec = "$package_root/pubspec.yaml"
9075

91-
deps = [ ":meta" ]
76+
deps = []
9277

9378
sources = [
9479
"config.dart",
@@ -98,26 +83,18 @@ dart_library("expect") {
9883
]
9984
}
10085

101-
dart_library("litetest") {
102-
package_root = "//flutter/testing/litetest"
103-
package_name = "litetest"
86+
dart_library("meta") {
87+
package_root = "$dart_src/pkg/meta"
88+
package_name = "meta"
10489

10590
pubspec = "$package_root/pubspec.yaml"
10691

107-
source_dir = "lib"
108-
109-
deps = [
110-
":async_helper",
111-
":expect",
112-
":meta",
113-
]
92+
deps = []
11493

11594
sources = [
116-
"litetest.dart",
117-
"src/async_minitest.dart",
118-
"src/matchers.dart",
119-
"src/test.dart",
120-
"src/test_suite.dart",
95+
"dart2js.dart",
96+
"meta.dart",
97+
"meta_meta.dart",
12198
]
12299
}
123100

0 commit comments

Comments
 (0)