summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/.gitignore2
-rwxr-xr-xtests/build.sh19
-rw-r--r--tests/pkg/data/dev/null0
-rw-r--r--tests/pkg/specials3
4 files changed, 18 insertions, 6 deletions
diff --git a/tests/.gitignore b/tests/.gitignore
index fd17e2a..1a78c9e 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -2,3 +2,5 @@
*.trs
mode
pkg.opk
+pkg/data/dev/null
+pkg/specials
diff --git a/tests/build.sh b/tests/build.sh
index b17994a..1a50e23 100755
--- a/tests/build.sh
+++ b/tests/build.sh
@@ -22,15 +22,23 @@ set -eu
. "${TOP_SRCDIR}/tests/aux/tap-functions.sh"
. "${TOP_SRCDIR}/tests/aux/common.sh"
-plan_ 2
+plan_ 3
-mkdir -p "${TOP_BUILDDIR}/tests/"
+mkdir -p "${TOP_BUILDDIR}/tests/pkg/"
+if [ x"${TOP_BUILDDIR}" != x"${TOP_SRCDIR}" ]; then
+ cp -Rp "${TOP_SRCDIR}/tests/pkg/data/" "${TOP_BUILDDIR}/tests/pkg/"
+fi
+
+mkdir -p "${TOP_BUILDDIR}/tests/pkg/data/dev/"
+OPK_WORK_AREA="${TOP_BUILDDIR}/tests/pkg/" command_ok_ 'mknod' -- \
+ "${TOP_BUILDDIR}/mknod${EXEEXT}" \
+ "${TOP_BUILDDIR}/tests/pkg/data/dev/null" c 1 3
SOURCE_DATE_EPOCH=1685592000 command_ok_ 'package building' -- \
"${TOP_BUILDDIR}/opkg-opk" \
-b \
-c "${TOP_SRCDIR}/tests/pkg/control/" \
- -d "${TOP_SRCDIR}/tests/pkg/data/" \
+ -d "${TOP_BUILDDIR}/tests/pkg/data/" \
-s "${TOP_SRCDIR}/tests/pkg/specials" \
"${TOP_BUILDDIR}/tests/pkg.opk"
@@ -52,4 +60,9 @@ cmd_is 'package info' \
crw-r--r-- pj/pj 1, 3 2023-06-01 00:00:00 /dev/null
EOF
+if [ x"${TOP_BUILDDIR}" != x"${TOP_SRCDIR}" ]; then
+ rm -Rf "${TOP_BUILDDIR}/tests/pkg/data/"
+fi
+rm -Rf "${TOP_BUILDDIR}/tests/pkg/specials"
+
:
diff --git a/tests/pkg/data/dev/null b/tests/pkg/data/dev/null
deleted file mode 100644
index e69de29..0000000
--- a/tests/pkg/data/dev/null
+++ /dev/null
diff --git a/tests/pkg/specials b/tests/pkg/specials
deleted file mode 100644
index c97eef3..0000000
--- a/tests/pkg/specials
+++ /dev/null
@@ -1,3 +0,0 @@
-version=1
-type major minor name
-c 1 3 /dev/null