Skip to content

Commit

Permalink
refactor: initialize dev env
Browse files Browse the repository at this point in the history
  • Loading branch information
zyrouge committed Oct 31, 2023
1 parent 3da8cf9 commit b9b29ce
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
11 changes: 10 additions & 1 deletion packages/sora_builder/lib/actions/test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ class SoraTester {
final Map<String, Map<String, Benchmarks>> mangaResults =
<String, Map<String, Benchmarks>>{};

Future<void> initialize() async {
await TenkaDevEnvironment.prepare();
}

Future<void> test() async {
for (final SoraAnimeModule x in modules.anime) {
final TenkaMetadata config = await x.config();
Expand All @@ -38,6 +42,11 @@ class SoraTester {
final MockedMangaExtractor mocked = x.mock();
await _test(TenkaType.manga, source, () => mocked.run(source));
}
await _summarize();
}

Future<void> dispose() async {
await TenkaDevEnvironment.dispose();
}

Future<void> _test(
Expand All @@ -61,7 +70,7 @@ class SoraTester {
print('Tested: $k');
}

Future<void> finish() async {
Future<void> _summarize() async {
print(
'Full Summary: [${Colorize('+$passed').green()} ${Colorize('-$failed').red()}]',
);
Expand Down
3 changes: 2 additions & 1 deletion store/helpers/mono_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Future<void> $test(final SoraBaseModule<dynamic> module) async {
paths: $paths,
urls: $urls,
);
await tester.initialize();
await tester.test();
await tester.finish();
await tester.dispose();
}
3 changes: 2 additions & 1 deletion store/test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Future<void> main(final List<String> args) async {
paths: $paths,
urls: $urls,
);
await tester.initialize();
await tester.test();
await tester.finish();
await tester.dispose();
}

0 comments on commit b9b29ce

Please sign in to comment.