Skip to content

Commit 4c446d2

Browse files
committed
tests: Make sure that extracing license information works
This tests the automatic detection of licensing files and also the explicit `license-files` key.
1 parent b06fa85 commit 4c446d2

File tree

5 files changed

+21
-0
lines changed

5 files changed

+21
-0
lines changed

tests/test-builder.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,12 @@ cp $(dirname $0)/module2.yaml include1/include2/
6161
cp $(dirname $0)/source2.json include1/include2/
6262
cp $(dirname $0)/data2 include1/include2/
6363
cp $(dirname $0)/data2.patch include1/include2/
64+
echo "MY LICENSE" > ./LICENSE
6465

6566
for MANIFEST in test.json test.yaml test-rename.json test-rename-appdata.json ; do
6667
echo "building manifest $MANIFEST" >&2
6768
${FLATPAK_BUILDER} --repo=$REPO $FL_GPGARGS --force-clean appdir $MANIFEST >&2
69+
#gdbserver localhost:12345 ${FLATPAK_BUILDER} --repo=$REPO $FL_GPGARGS --force-clean appdir $MANIFEST >&2
6870

6971
assert_file_has_content appdir/files/share/app-data version1
7072
assert_file_has_content appdir/metadata shared=network;
@@ -96,6 +98,8 @@ for MANIFEST in test.json test.yaml test-rename.json test-rename-appdata.json ;
9698
${FLATPAK} build appdir /app/bin/hello2.sh > hello_out2
9799
assert_file_has_content hello_out2 '^Hello world2, from a sandbox$'
98100

101+
assert_file_has_content appdir/files/share/licenses/test/LICENSE_1 '^MY LICENSE$'
102+
99103
echo "ok build"
100104
done
101105

tests/test-rename-appdata.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@
7373
"type": "file",
7474
"path": "Hello.xml"
7575
},
76+
{
77+
"type": "file",
78+
"path": "LICENSE",
79+
"dest-filename": "COPYING"
80+
},
7681
{
7782
"type": "script",
7883
"dest-filename": "hello2.sh",

tests/test-rename.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@
7474
"type": "file",
7575
"path": "Hello.xml"
7676
},
77+
{
78+
"type": "file",
79+
"path": "LICENSE"
80+
},
7781
{
7882
"type": "script",
7983
"dest-filename": "hello2.sh",

tests/test.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@
7171
"type": "file",
7272
"path": "org.test.Hello.xml"
7373
},
74+
{
75+
"type": "file",
76+
"path": "LICENSE"
77+
},
7478
{
7579
"type": "shell",
7680
"commands": [

tests/test.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ modules:
3636
make-args: [BAR=2]
3737
make-install-args: [BAR=3]
3838
build-commands: ['echo foo > /app/out']
39+
license-files: ['mytest/LICENSE']
3940
sources:
4041
- type: file
4142
path: test-configure
@@ -52,6 +53,9 @@ modules:
5253
path: org.test.Hello.appdata.xml
5354
- type: file
5455
path: org.test.Hello.xml
56+
- type: file
57+
path: LICENSE
58+
dest: mytest
5559
- type: shell
5660
commands:
5761
- mkdir /app/cleanup/

0 commit comments

Comments
 (0)