99cff54882
This CL introduces a test runner and test cases under `pkg/dynamic_modules/test/`. These tests are end-to-end tests that specifically target the dynamic modules semantics. This includes: * semantics expecations on the program evolutions (e.g. libraries defined only once) * individual cases around the dynamic interface (callable, extensible, overrides). We should continue to add more test as we discover coner cases worth validating (e.g. mixins, constants, etc). The suite is not yet integrated to the test matrix, my plan is to do so after we have some initial targets set up. Change-Id: I2a63946c36d99baacb6fb7edc01c4ef377ce20b6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379921 Reviewed-by: Alexander Markov <alexmarkov@google.com> Commit-Queue: Sigmund Cherem <sigmund@google.com>
40 lines
1.3 KiB
Dart
40 lines
1.3 KiB
Dart
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
/// Defines how dynamic modules get compiled and executed on each target
|
|
/// platform.
|
|
library;
|
|
|
|
import 'model.dart';
|
|
|
|
/// Possible backends where the tests can be executed.
|
|
enum Target {
|
|
aot,
|
|
dart2wasm,
|
|
ddc,
|
|
}
|
|
|
|
/// Defines how to build and run a test in a specific target.
|
|
///
|
|
/// The test framework will use a single executor for all tests in a suite. This
|
|
/// can be leveraged to keep compilers warm and cache results if that is
|
|
/// helpful.
|
|
abstract class TargetExecutor {
|
|
/// Takes the steps necessary to build the initial version of the app.
|
|
Future compileApplication(DynamicModuleTest test);
|
|
|
|
/// Takes the steps necessary to build a single dynamic module.
|
|
Future compileDynamicModule(DynamicModuleTest test, String name);
|
|
|
|
/// Takes the steps necessary to execute the test.
|
|
///
|
|
/// This step will only be called after both the app and modules have been
|
|
/// generated.
|
|
Future executeApplication(DynamicModuleTest test);
|
|
|
|
/// Notification that all tests have been executed and that this executor is
|
|
/// no longer going to be used anymore.
|
|
Future suiteComplete();
|
|
}
|