Add the Flutter video editing application with project management, media import, timeline editing, preview, AI assistance, diagnostics and settings. Include shared UI and native host packages, platform runners, application tests and release tooling. Provide usage and contribution guides, the MIT license and third-party notices. Exclude local credentials, build outputs and validation data.
30 lines
1.1 KiB
Dart
30 lines
1.1 KiB
Dart
import 'dart:io';
|
|
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
void main() {
|
|
test('native build refuses only its running executable', () async {
|
|
final root = await Directory.systemTemp.createTemp('cutdex build guard ');
|
|
addTearDown(() => root.delete(recursive: true));
|
|
final executable = await File('/bin/sleep').copy('${root.path}/cutdex');
|
|
await Process.run('/bin/chmod', ['u+x', executable.path]);
|
|
Future<ProcessResult> check(String path) => Process.run('/bin/sh', [
|
|
'tool/macos/check_macos_build_target.sh',
|
|
path,
|
|
]);
|
|
|
|
expect((await check(executable.path)).exitCode, 0);
|
|
final process = await Process.start(executable.path, ['60']);
|
|
try {
|
|
final blocked = await check(executable.path);
|
|
expect(blocked.exitCode, 1);
|
|
expect(blocked.stderr, contains('Save your edits'));
|
|
expect((await check('${root.path}/other/cutdex')).exitCode, 0);
|
|
} finally {
|
|
process.kill();
|
|
await process.exitCode;
|
|
}
|
|
expect((await check(executable.path)).exitCode, 0);
|
|
}, skip: !Platform.isMacOS);
|
|
}
|