initRustLibForTests function
Initializes FRB against a real cdylib. Safe to call from multiple test files'
setUpAll — RustLib.init is idempotent once loaded.
Implementation
Future<void> initRustLibForTests({
bool preferRelease = true,
String? checkoutRelativeRustDir,
}) async {
WidgetsFlutterBinding.ensureInitialized();
final lib = await resolveRustLibPath(
release: preferRelease,
checkoutRelativeRustDir: checkoutRelativeRustDir,
);
await RustLib.init(
externalLibrary: ExternalLibrary.open(lib),
);
}