Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/.cspell/words_dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ preorder
prerender
prerendered
pressable
presubmit
ptero # short for pterodactyl
rasterizes
refreshable
Expand Down
50 changes: 50 additions & 0 deletions scripts/customer_testing.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// This file is invoked by the flutter/tests registry entry for Flame
// (https://github.com/flutter/tests/blob/main/registry/flame.test) to run
// Flame's tests as a presubmit against flutter/flutter framework changes.
// Changes here are only honored after the commit hash in that registry entry
// is updated.

import 'dart:io';

Future<void> main() async {
await _run('flutter', ['analyze', '--no-fatal-infos']);

// Golden and rendering tests are platform-sensitive, so the full per-package
// test suites only run on Linux, where the golden files are generated.
if (!Platform.isLinux) {
return;
}

final packages =
Directory('packages')
.listSync()
.whereType<Directory>()
.where(
(directory) => Directory('${directory.path}/test').existsSync(),
)
.toList()
..sort((a, b) => a.path.compareTo(b.path));

for (final package in packages) {
stdout.writeln('Running tests in ${package.path}');
await _run('flutter', ['test'], workingDirectory: package.path);
}
}

Future<void> _run(
String executable,
List<String> arguments, {
String? workingDirectory,
}) async {
final process = await Process.start(
executable,
arguments,
workingDirectory: workingDirectory,
mode: ProcessStartMode.inheritStdio,
runInShell: true,
);
final exitCode = await process.exitCode;
if (exitCode != 0) {
exit(exitCode);
}
}
Loading