commit:     467e21cbdab04a21e006825a17fd9344f7dcd688
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 28 08:56:16 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Oct  1 17:19:34 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=467e21cb

eclass/tests/unpacker.sh: Add tests for makeself

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 eclass/tests/unpacker.sh | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

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 \

Reply via email to