mirror of
https://github.com/dart-lang/sdk
synced 2024-10-03 13:22:01 +00:00
Follow up to previous CL
This addresses comments from https://dart-review.googlesource.com/c/sdk/+/58201. Change-Id: I59fd5ea06fbd644a7ba5e6be842ce20cfaee7536 Reviewed-on: https://dart-review.googlesource.com/59060 Reviewed-by: Lasse R.H. Nielsen <lrn@google.com> Commit-Queue: Peter von der Ahé <ahe@google.com>
This commit is contained in:
parent
3af09b5b26
commit
656ed8491e
|
@ -8,8 +8,8 @@ import 'package:test_reflective_loader/test_reflective_loader.dart';
|
|||
import '../src/fasta/body_builder_test_helper.dart';
|
||||
import 'parser_test.dart';
|
||||
|
||||
main() async {
|
||||
await CompilerTestContext.runWithTestOptions((_) {
|
||||
main() {
|
||||
return CompilerTestContext.runWithTestOptions((_) {
|
||||
defineReflectiveSuite(() {
|
||||
defineReflectiveTests(ClassMemberParserTest_Forest);
|
||||
defineReflectiveTests(ComplexParserTest_Forest);
|
||||
|
|
|
@ -145,6 +145,13 @@ class CompilerTestContext extends CompilerContext {
|
|||
|
||||
T result;
|
||||
Completer<T> completer = new Completer<T>();
|
||||
// Since we're using `package:test_reflective_loader`, we can't rely on
|
||||
// normal async behavior, as `defineReflectiveSuite` doesn't return a
|
||||
// future. However, since it's built on top of `package:test`, we can
|
||||
// obtain a future that completes when all the tests are done using
|
||||
// `tearDownAll`. This allows this function to complete no earlier than
|
||||
// when the tests are done. This is important, as we don't want to call
|
||||
// `CompilerContext.clear` before then.
|
||||
tearDownAll(() => completer.complete(result));
|
||||
result = await action(c);
|
||||
return completer.future;
|
||||
|
|
|
@ -10,8 +10,8 @@ import 'package:test_reflective_loader/test_reflective_loader.dart';
|
|||
import '../../generated/parser_test.dart';
|
||||
import 'body_builder_test_helper.dart';
|
||||
|
||||
main() async {
|
||||
await CompilerTestContext.runWithTestOptions((_) {
|
||||
main() {
|
||||
return CompilerTestContext.runWithTestOptions((_) {
|
||||
defineReflectiveSuite(() {
|
||||
defineReflectiveTests(ResolutionTest);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue