summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-09-28 10:56:16 +0200
committerMichał Górny <mgorny@gentoo.org>2022-10-01 19:19:34 +0200
commit467e21cbdab04a21e006825a17fd9344f7dcd688 (patch)
treef1fabcadfe59844efbe43b71f3e609c5d673f902 /eclass/tests
parentunpacker.eclass: Support all makeself "compression" methods (diff)
downloadgentoo-467e21cbdab04a21e006825a17fd9344f7dcd688.tar.gz
gentoo-467e21cbdab04a21e006825a17fd9344f7dcd688.tar.bz2
gentoo-467e21cbdab04a21e006825a17fd9344f7dcd688.zip
eclass/tests/unpacker.sh: Add tests for makeself
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/tests')
-rwxr-xr-xeclass/tests/unpacker.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/eclass/tests/unpacker.sh b/eclass/tests/unpacker.sh
index 105f28fd4858..ea9e64d0a4c7 100755
--- a/eclass/tests/unpacker.sh
+++ b/eclass/tests/unpacker.sh
@@ -182,6 +182,25 @@ test_gpkg() {
"create_gpkg '${suffix}' '${tool_cmd}' \${archive} \${TESTFILE}"
}
+create_makeself() {
+ local comp_opt=${1}
+ local archive=${2}
+ local infile=${3}
+
+ mkdir test || die
+ cp "${infile}" test/ || die
+ makeself --quiet "${comp_opt}" test "${archive}" test : || die
+ rm -rf test || die
+}
+
+test_makeself() {
+ local comp_opt=${1}
+ local tool=${2}
+
+ test_unpack "makeself-${tool}.sh" test.in "makeself ${tool}" \
+ "create_makeself '${comp_opt}' \${archive} \${TESTFILE}"
+}
+
test_reject_junk() {
local suffix=${1}
local archive=test${1}
@@ -265,6 +284,16 @@ test_gpkg .lzo lzop
test_gpkg .xz xz
test_gpkg .zst zstd
+test_makeself --gzip gzip
+test_makeself --zstd zstd
+test_makeself --bzip2 bzip2
+test_makeself --xz xz
+test_makeself --lzo lzop
+test_makeself --lz4 lz4
+test_makeself --compress compress
+test_makeself --base64 base64
+test_makeself --nocomp tar
+
test_unpack test.zip test.in zip 'zip -q ${archive} ${TESTFILE}'
# test handling non-adjusted zip with junk prepended
test_unpack test.zip test.in zip \