Signed-off-by: Michał Górny <
mgorny@gentoo.org>
---
eclass/tests/tests-common.sh | 7 ++
eclass/tests/unpacker.sh | 233 +++++++++++++++++++++++++++++++++++
2 files changed, 240 insertions(+)
create mode 100755 eclass/tests/unpacker.sh
diff --git a/eclass/tests/tests-common.sh b/eclass/tests/tests-common.sh
index a677842b6ac5..45b1e20b933a 100644
--- a/eclass/tests/tests-common.sh
+++ b/eclass/tests/tests-common.sh
@@ -60,6 +60,13 @@ die() {
exit 1
}
+assert() {
+ local x pipestatus=${PIPESTATUS[*]}
+ for x in ${pipestatus} ; do
+ [[ ${x} -eq 0 ]] || die "$@"
+ done
+}
+
has_version() {
while [[ $1 == -* ]]; do
shift
diff --git a/eclass/tests/unpacker.sh b/eclass/tests/unpacker.sh
new file mode 100755
index 000000000000..af979b0e2995
--- /dev/null
+++ b/eclass/tests/unpacker.sh
@@ -0,0 +1,233 @@
+#!/bin/bash
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+source tests-common.sh || exit
+
+inherit unpacker
+
+# silence the output
+u