Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
Date: Sat, 01 Oct 2022 17:19:42
Message-Id: 1664644774.467e21cbdab04a21e006825a17fd9344f7dcd688.mgorny@gentoo
1 commit: 467e21cbdab04a21e006825a17fd9344f7dcd688
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 28 08:56:16 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 1 17:19:34 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=467e21cb
7
8 eclass/tests/unpacker.sh: Add tests for makeself
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 eclass/tests/unpacker.sh | 29 +++++++++++++++++++++++++++++
13 1 file changed, 29 insertions(+)
14
15 diff --git a/eclass/tests/unpacker.sh b/eclass/tests/unpacker.sh
16 index 105f28fd4858..ea9e64d0a4c7 100755
17 --- a/eclass/tests/unpacker.sh
18 +++ b/eclass/tests/unpacker.sh
19 @@ -182,6 +182,25 @@ test_gpkg() {
20 "create_gpkg '${suffix}' '${tool_cmd}' \${archive} \${TESTFILE}"
21 }
22
23 +create_makeself() {
24 + local comp_opt=${1}
25 + local archive=${2}
26 + local infile=${3}
27 +
28 + mkdir test || die
29 + cp "${infile}" test/ || die
30 + makeself --quiet "${comp_opt}" test "${archive}" test : || die
31 + rm -rf test || die
32 +}
33 +
34 +test_makeself() {
35 + local comp_opt=${1}
36 + local tool=${2}
37 +
38 + test_unpack "makeself-${tool}.sh" test.in "makeself ${tool}" \
39 + "create_makeself '${comp_opt}' \${archive} \${TESTFILE}"
40 +}
41 +
42 test_reject_junk() {
43 local suffix=${1}
44 local archive=test${1}
45 @@ -265,6 +284,16 @@ test_gpkg .lzo lzop
46 test_gpkg .xz xz
47 test_gpkg .zst zstd
48
49 +test_makeself --gzip gzip
50 +test_makeself --zstd zstd
51 +test_makeself --bzip2 bzip2
52 +test_makeself --xz xz
53 +test_makeself --lzo lzop
54 +test_makeself --lz4 lz4
55 +test_makeself --compress compress
56 +test_makeself --base64 base64
57 +test_makeself --nocomp tar
58 +
59 test_unpack test.zip test.in zip 'zip -q ${archive} ${TESTFILE}'
60 # test handling non-adjusted zip with junk prepended
61 test_unpack test.zip test.in zip \