94a25f4827
Changelog: Windows and Linux desktop fixes
63 lines
1.9 KiB
Dart
63 lines
1.9 KiB
Dart
import 'dart:io';
|
|
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:yaml/yaml.dart';
|
|
|
|
void main() {
|
|
group('Linux packaging teardown', () {
|
|
for (final format in ['deb', 'rpm']) {
|
|
test('$format removes the Helper unit only on a real uninstall', () {
|
|
final config =
|
|
loadYaml(
|
|
File(
|
|
'linux/packaging/$format/make_config.yaml',
|
|
).readAsStringSync(),
|
|
)
|
|
as YamlMap;
|
|
final scripts = (config['postuninstall_scripts'] as YamlList)
|
|
.cast<String>();
|
|
|
|
expect(scripts.first, contains('exit 0'));
|
|
expect(
|
|
scripts,
|
|
contains('rm -f /etc/systemd/system/flclash-helper.service'),
|
|
);
|
|
expect(
|
|
scripts.any((script) => script.contains('systemctl daemon-reload')),
|
|
isTrue,
|
|
);
|
|
});
|
|
}
|
|
});
|
|
|
|
test('every Linux package names the GTK application id as its window '
|
|
'class', () {
|
|
final applicationId = RegExp(
|
|
r'set\(APPLICATION_ID "([^"]+)"\)',
|
|
).firstMatch(File('linux/CMakeLists.txt').readAsStringSync())!.group(1);
|
|
|
|
for (final format in ['deb', 'rpm', 'appimage']) {
|
|
final config =
|
|
loadYaml(
|
|
File(
|
|
'linux/packaging/$format/make_config.yaml',
|
|
).readAsStringSync(),
|
|
)
|
|
as YamlMap;
|
|
expect(config['startup_wm_class'], applicationId, reason: format);
|
|
}
|
|
});
|
|
|
|
test('rpm keeps the Core bytes the Helper was built against', () {
|
|
final config =
|
|
loadYaml(
|
|
File('linux/packaging/rpm/make_config.yaml').readAsStringSync(),
|
|
)
|
|
as YamlMap;
|
|
final macros = (config['spec_macros'] as YamlList).cast<String>();
|
|
|
|
expect(macros, contains('%global debug_package %{nil}'));
|
|
expect(macros, contains('%global __os_install_post %{nil}'));
|
|
});
|
|
}
|