Skip to content

Commit e2f9ffc

Browse files
committed
tests: Add test for install argument installing app, debug and locale
1 parent 6902972 commit e2f9ffc

File tree

4 files changed

+41
-1
lines changed

4 files changed

+41
-1
lines changed

tests/Makefile.am.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ dist_installed_test_data = \
6363
tests/org.flatpak_builder.gui.metainfo.xml \
6464
tests/org.flatpak.appstream_media.json \
6565
tests/org.test.Hello-256.png \
66+
tests/org.flatpak.install_test.json \
6667
$(NULL)
6768

6869
installed_test_keyringdir = $(installed_testdir)/test-keyring

tests/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ if get_option('installed_tests')
110110
'org.flatpak_builder.gui.metainfo.xml',
111111
'org.flatpak.appstream_media.json',
112112
'org.test.Hello-256.png',
113+
'org.flatpak.install_test.json',
113114

114115
install_dir: installed_testdir,
115116
install_mode: 'rw-r--r--',
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"id": "org.flatpak.install_test",
3+
"runtime": "org.test.Platform",
4+
"sdk": "org.test.Sdk",
5+
"command": "hello",
6+
"modules": [
7+
{
8+
"name": "install_test",
9+
"buildsystem": "simple",
10+
"build-commands": [
11+
"mkdir -p ${FLATPAK_DEST}/bin ${FLATPAK_DEST}/lib/debug ${FLATPAK_DEST}/share/locale/es",
12+
"cp -vf hello.sh ${FLATPAK_DEST}/bin/hello",
13+
"echo foo > ${FLATPAK_DEST}/lib/debug/hello.debug",
14+
"echo foo > ${FLATPAK_DEST}/share/locale/es/hello.mo"
15+
],
16+
"sources": [
17+
{
18+
"type": "script",
19+
"dest-filename": "hello.sh",
20+
"commands": [
21+
"echo \"Hello world, from a sandbox\""
22+
]
23+
}
24+
]
25+
}
26+
]
27+
}

tests/test-builder.sh

Lines changed: 12 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..10"
26+
echo "1..11"
2727

2828
setup_repo
2929
install_repo
@@ -55,6 +55,7 @@ cp $(dirname $0)/org.flatpak_builder.gui.metainfo.xml .
5555
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 .
58+
cp $(dirname $0)/org.flatpak.install_test.json .
5859
mkdir include1
5960
cp $(dirname $0)/module1.json include1/
6061
cp $(dirname $0)/module1.yaml include1/
@@ -173,3 +174,13 @@ if appstream_has_version 0 16 3; then
173174
else
174175
echo "ok # Skip AppStream < 0.16.3"
175176
fi
177+
178+
# test install
179+
${FLATPAK_BUILDER} --user --install \
180+
--force-clean builddir org.flatpak.install_test.json >&2
181+
REFS=$(flatpak list --all --columns=ref 2>/dev/null)
182+
echo "$REFS" | grep -q "org\.flatpak\.install_test"
183+
echo "$REFS" | grep -q "org\.flatpak\.install_test\.Debug"
184+
echo "$REFS" | grep -q "org\.flatpak\.install_test\.Locale"
185+
186+
echo "ok install"

0 commit comments

Comments
 (0)