forked from Mirrors/flatpak-builder
Extend flatpak-builder test
We now test including modules, including doing so recursively, and find patches and source files from those.tingping/wmclass
parent
a5157d445b
commit
c053c49ead
|
@ -88,6 +88,12 @@ dist_installed_test_data = \
|
|||
tests/org.test.Hello.png \
|
||||
tests/package_version.txt \
|
||||
tests/test.json \
|
||||
tests/module1.json \
|
||||
tests/data1 \
|
||||
tests/data1.patch \
|
||||
tests/module2.json \
|
||||
tests/data2 \
|
||||
tests/data2.patch \
|
||||
tests/session.conf.in \
|
||||
tests/0001-Add-test-logo.patch \
|
||||
tests/org.test.Python.json \
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Some data1
|
|
@ -0,0 +1,5 @@
|
|||
--- data1 2017-04-24 09:24:02.861719643 +0200
|
||||
+++ data1.mod 2017-04-24 09:35:44.589157410 +0200
|
||||
@@ -1 +1 @@
|
||||
-Some data1
|
||||
+Some modified data1
|
|
@ -0,0 +1 @@
|
|||
some data2
|
|
@ -0,0 +1,5 @@
|
|||
--- tests/data2 2017-04-24 09:31:18.793726921 +0200
|
||||
+++ tests/data2.mod 2017-04-24 09:36:26.485552769 +0200
|
||||
@@ -1 +1 @@
|
||||
-some data2
|
||||
+some modified data2
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"name": "module1",
|
||||
"modules": [
|
||||
{
|
||||
"name": "module1-first",
|
||||
"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
"echo module1 > /app/ran_module1",
|
||||
"echo module1 > /app/modify_me"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "file",
|
||||
"path": "data1"
|
||||
},
|
||||
{
|
||||
"type": "patch",
|
||||
"strip-components": 0,
|
||||
"path": "data1.patch"
|
||||
}
|
||||
]
|
||||
},
|
||||
"include2/module2.json"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"name": "module2",
|
||||
"buildsystem": "simple",
|
||||
"ensure-writable": [ "/modify_me"],
|
||||
"build-commands": [
|
||||
"echo module2 > /app/ran_module2",
|
||||
"echo module2 > /app/modify_me"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "file",
|
||||
"path": "data2"
|
||||
},
|
||||
{
|
||||
"type": "patch",
|
||||
"path": "data2.patch"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -39,11 +39,21 @@ cp -a $(dirname $0)/test-configure .
|
|||
echo "version1" > app-data
|
||||
cp $(dirname $0)/test.json .
|
||||
cp $(dirname $0)/0001-Add-test-logo.patch .
|
||||
mkdir include1
|
||||
cp $(dirname $0)/module1.json include1/
|
||||
cp $(dirname $0)/data1 include1/
|
||||
cp $(dirname $0)/data1.patch include1/
|
||||
mkdir include1/include2
|
||||
cp $(dirname $0)/module2.json include1/include2/
|
||||
cp $(dirname $0)/data2 include1/include2/
|
||||
cp $(dirname $0)/data2.patch include1/include2/
|
||||
${FLATPAK_BUILDER} --repo=$REPO $FL_GPGARGS --force-clean appdir test.json
|
||||
|
||||
assert_file_has_content appdir/files/share/app-data version1
|
||||
assert_file_has_content appdir/metadata shared=network;
|
||||
assert_file_has_content appdir/metadata tags=test;
|
||||
assert_file_has_content appdir/files/ran_module1 module1
|
||||
assert_file_has_content appdir/files/ran_module2 module2
|
||||
|
||||
assert_not_has_file appdir/files/cleanup/a_filee
|
||||
assert_not_has_file appdir/files/bin/file.cleanup
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
"cleanup": ["/cleanup", "*.cleanup"],
|
||||
"cleanup-commands": [ "touch /app/cleaned_up" ],
|
||||
"modules": [
|
||||
"include1/module1.json",
|
||||
{
|
||||
"name": "root",
|
||||
"modules": [
|
||||
|
|
Loading…
Reference in New Issue