Skip to content

Commit f7db4a7

Browse files
committed
tests: Add test for locale migration post cleanup
1 parent 459f136 commit f7db4a7

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

tests/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ if get_option('installed_tests')
123123
'org.flatpak.appstream_media.json',
124124
'org.test.Hello-256.png',
125125
'org.flatpak.install_test.json',
126+
'test-locale-cleanup.json',
126127

127128
install_dir: installed_testdir,
128129
install_mode: 'rw-r--r--',

tests/test-builder.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ set -euo pipefail
2323

2424
skip_without_fuse
2525

26-
echo "1..11"
26+
echo "1..12"
2727

2828
setup_repo
2929
install_repo
@@ -56,6 +56,7 @@ cp $(dirname $0)/org.test.Hello.png .
5656
cp $(dirname $0)/org.test.Hello-256.png .
5757
cp $(dirname $0)/org.flatpak.appstream_media.json .
5858
cp $(dirname $0)/org.flatpak.install_test.json .
59+
cp $(dirname $0)/test-locale-cleanup.json .
5960
mkdir include1
6061
cp $(dirname $0)/module1.json include1/
6162
cp $(dirname $0)/module1.yaml include1/
@@ -184,3 +185,10 @@ echo "$REFS" | grep -q "org\.flatpak\.install_test\.Debug"
184185
echo "$REFS" | grep -q "org\.flatpak\.install_test\.Locale"
185186

186187
echo "ok install"
188+
189+
${FLATPAK_BUILDER} --repo=$REPO --force-clean appdir test-locale-cleanup.json >&2
190+
191+
assert_not_has_file appdir/files/share/runtime/locale/es/share/es/testA.mo
192+
assert_has_file appdir/files/share/runtime/locale/es/share/es/testB.mo
193+
194+
echo "ok testB's locale survives after testA's cleanup"

tests/test-locale-cleanup.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"app-id": "org.test.LocaleCleanup",
3+
"runtime": "org.test.Platform",
4+
"sdk": "org.test.Sdk",
5+
"modules": [
6+
{
7+
"name": "testA",
8+
"cleanup": [
9+
"/share/locale"
10+
],
11+
"buildsystem": "simple",
12+
"build-commands": [
13+
"mkdir -p /app/share/locale/es",
14+
"touch /app/share/locale/es/testA.mo"
15+
]
16+
},
17+
{
18+
"name": "testB",
19+
"buildsystem": "simple",
20+
"build-commands": [
21+
"mkdir -p /app/share/locale/es",
22+
"touch /app/share/locale/es/testB.mo"
23+
]
24+
}
25+
]
26+
}

0 commit comments

Comments
 (0)