summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/aux/common.sh6
-rw-r--r--tests/aux/setup.sh9
-rwxr-xr-xtests/exe/ob-unpacksource.sh9
3 files changed, 16 insertions, 8 deletions
diff --git a/tests/aux/common.sh b/tests/aux/common.sh
index 2ebdc9e..180e5f8 100644
--- a/tests/aux/common.sh
+++ b/tests/aux/common.sh
@@ -70,6 +70,12 @@ cmd_is()
cd "${TOP_BUILDDIR}/tests/pkg/tmp/"
+FOO_SH="$(cat <<-'EOF'
+ #!/bin/sh
+ printf 'Hello, world!\n'
+ EOF
+ )"
+
# SPF 2.0 environment variables:
# <http://specs.proteanos.com/spf-2.0/buildsys.html#env-vars>
# Section 7.3.1 Package Variables
diff --git a/tests/aux/setup.sh b/tests/aux/setup.sh
index ca91b8c..e16b3d6 100644
--- a/tests/aux/setup.sh
+++ b/tests/aux/setup.sh
@@ -40,3 +40,12 @@ cat >'changelog' <<-EOF
* Initial release.
-- ${MAINTAINER} Thu, 01 Jan 1970 00:00:00 +0000
EOF
+
+FOO_SH="$(cat <<-'EOF'
+ #!/bin/sh
+ printf 'Hello, world!\n'
+ EOF
+ )"
+
+mkdir -p '../src/src/'
+printf '%s\n' "${FOO_SH}" >'../src/src/foo.sh'
diff --git a/tests/exe/ob-unpacksource.sh b/tests/exe/ob-unpacksource.sh
index d443529..fbe94a2 100755
--- a/tests/exe/ob-unpacksource.sh
+++ b/tests/exe/ob-unpacksource.sh
@@ -22,16 +22,9 @@ set -eu
. "${TOP_SRCDIR}/tests/aux/tap-functions.sh"
. "${TOP_SRCDIR}/tests/aux/common.sh"
-FOO_SH="$(cat <<-'EOF'
- #!/bin/sh
- printf 'Hello, world!\n'
- EOF
- )"
-
plan_ 4
-mkdir -p '../src/src/'
-printf '%s\n' "${FOO_SH}" >'../src/src/foo.sh'
+cp -Rp '../../src/' '../src/'
command_ok_ 'ob-unpacksource exit status' ob-unpacksource
cmd_is 'native sources unpacked' cat 'src/src/foo.sh' <<-EOF