aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-10-13 10:26:06 +0000
committerMattia Rizzolo <mattia@mapreri.org>2015-10-13 10:26:06 +0000
commit72075b8430b826d7dd489765c1004e4161479fa2 (patch)
tree682a8d69bcc478082f1805859eb72445e8b6cf42
parent524cde2e544f40dc2056d2a4c4265ddc4160784d (diff)
downloadpbuilder-72075b8430b826d7dd489765c1004e4161479fa2.tar
pbuilder-72075b8430b826d7dd489765c1004e4161479fa2.tar.gz
move all tests under a t/ directory
-rw-r--r--Makefile2
-rwxr-xr-xt/test_pbuilder-apt-config (renamed from test_pbuilder-apt-config)14
-rwxr-xr-xt/test_pbuilder-buildpackage-funcs (renamed from test_pbuilder-buildpackage-funcs)11
-rwxr-xr-xt/test_pbuilder-checkparams (renamed from test_pbuilder-checkparams)17
-rwxr-xr-xt/test_pbuilder-modules (renamed from test_pbuilder-modules)10
-rwxr-xr-xt/test_pbuilder-satisfydepends-checkparams (renamed from test_pbuilder-satisfydepends-checkparams)10
-rwxr-xr-xt/test_pbuilder-satisfydepends-classic (renamed from test_pbuilder-satisfydepends-classic)10
-rwxr-xr-xt/test_pbuilder-satisfydepends-funcs (renamed from test_pbuilder-satisfydepends-funcs)10
-rwxr-xr-xt/test_testlib.sh (renamed from test_testlib.sh)10
-rw-r--r--t/testlib.sh (renamed from testlib.sh)0
10 files changed, 29 insertions, 65 deletions
diff --git a/Makefile b/Makefile
index 32a1c2a..7e617c5 100644
--- a/Makefile
+++ b/Makefile
@@ -170,7 +170,7 @@ check:
$(foreach script,$(CHECK_SCRIPTS),bash -n $(script)$(newline))
$(foreach mp,$(CHECK_MANPAGES),LANG=C MANWIDTH=80 man --warnings -l $(mp) >/dev/null$(newline))
# unit tests.
- $(foreach test,$(wildcard ./test_*),$(test)$(newline))
+ $(foreach test,$(wildcard ./t/test_*),$(test)$(newline))
full-check:
# system tests that might take long.
diff --git a/test_pbuilder-apt-config b/t/test_pbuilder-apt-config
index 9db4c4e..e00730e 100755
--- a/test_pbuilder-apt-config
+++ b/t/test_pbuilder-apt-config
@@ -4,20 +4,12 @@ set -e
self="$(basename "$0")"
-# if this is set, use pbuilder files from this location; otherwise, use
-# installed files (from PBUILDER_TEST_ROOT, which is a copy of PBUILDER_ROOT)
-PBUILDER_CHECKOUT="${PBUILDER_CHECKOUT:-}"
-
+TD="$(dirname "$0")"
if [ -n "$PBUILDER_CHECKOUT" ]; then
- . "$PBUILDER_CHECKOUT/testlib.sh"
-
+ . "$TD/testlib.sh"
PBUILDER_APT_CONFIG="$PBUILDER_CHECKOUT/pbuilder-apt-config"
else
- # these currently don't need to be exported
- PBUILDER_TEST_ROOT="${PBUILDER_ROOT:-}"
- PBUILDER_TEST_PKGLIBDIR="${PBUILDER_PKGLIBDIR:-$PBUILDER_ROOT/usr/lib/pbuilder}"
- . "$PBUILDER_TEST_PKGLIBDIR/testlib.sh"
-
+ . "$TD/testlib.sh"
PBUILDER_APT_CONFIG="$PBUILDER_TEST_PKGLIBDIR/pbuilder-apt-config"
fi
diff --git a/test_pbuilder-buildpackage-funcs b/t/test_pbuilder-buildpackage-funcs
index ad11c18..80372f1 100755
--- a/test_pbuilder-buildpackage-funcs
+++ b/t/test_pbuilder-buildpackage-funcs
@@ -23,17 +23,12 @@
# testsuite to test pbuilder-satisfydepends-funcs.
-
+TD="$(dirname "$0")"
if [ -n "$PBUILDER_CHECKOUT" ]; then
- . "$PBUILDER_CHECKOUT/testlib.sh"
-
+ . "$TD/testlib.sh"
. "$PBUILDER_CHECKOUT/pbuilder-buildpackage-funcs"
else
- # these currently don't need to be exported
- PBUILDER_TEST_ROOT="${PBUILDER_ROOT:-}"
- PBUILDER_TEST_PKGLIBDIR="${PBUILDER_PKGLIBDIR:-$PBUILDER_ROOT/usr/lib/pbuilder}"
- . "$PBUILDER_TEST_PKGLIBDIR/testlib.sh"
-
+ . "$TD/testlib.sh"
. "$PBUILDER_TEST_PKGLIBDIR/pbuilder-buildpackage-funcs"
fi
diff --git a/test_pbuilder-checkparams b/t/test_pbuilder-checkparams
index cc1af9e..a81ae8d 100755
--- a/test_pbuilder-checkparams
+++ b/t/test_pbuilder-checkparams
@@ -2,26 +2,19 @@
# testsuite for pbuilder-checkparams
+TD="$(dirname "$0")"
if [ -n "$PBUILDER_CHECKOUT" ]; then
- . "$PBUILDER_CHECKOUT/testlib.sh"
+ . "$TD/testlib.sh"
+ PBUILDER_CHECKPARAMS="$PBUILDER_CHECKOUT/pbuilder-checkparams"
else
- # these currently don't need to be exported
- PBUILDER_TEST_ROOT="${PBUILDER_ROOT:-}"
- PBUILDER_TEST_PKGLIBDIR="${PBUILDER_PKGLIBDIR:-$PBUILDER_ROOT/usr/lib/pbuilder}"
- . "$PBUILDER_TEST_PKGLIBDIR/testlib.sh"
+ . "$TD/testlib.sh"
+ PBUILDER_CHECKPARAMS="$PBUILDER_TEST_PKGLIBDIR/pbuilder-checkparams"
fi
# setup a fake installed environment
trap testlib_cleanup_env sigpipe sighup exit
testlib_setup_env
-if [ -n "$PBUILDER_CHECKOUT" ]; then
- PBUILDER_CHECKPARAMS="$PBUILDER_CHECKOUT/pbuilder-checkparams"
-else
- export PBUILDER_PKGLIBDIR="${PBUILDER_PKGLIBDIR:-$PBUILDER_ROOT/usr/lib/pbuilder}"
- PBUILDER_CHECKPARAMS="$PBUILDER_PKGLIBDIR/pbuilder-checkparams"
-fi
-
test_debuildopts() {
. "$PBUILDER_CHECKPARAMS"
echo "$DEBBUILDOPTS"
diff --git a/test_pbuilder-modules b/t/test_pbuilder-modules
index d010c98..9e1f6e0 100755
--- a/test_pbuilder-modules
+++ b/t/test_pbuilder-modules
@@ -1,15 +1,11 @@
#!/bin/bash
+TD="$(dirname "$0")"
if [ -n "$PBUILDER_CHECKOUT" ]; then
- . "$PBUILDER_CHECKOUT/testlib.sh"
-
+ . "$TD/testlib.sh"
. "$PBUILDER_CHECKOUT/pbuilder-modules"
else
- # these currently don't need to be exported
- PBUILDER_TEST_ROOT="${PBUILDER_ROOT:-}"
- PBUILDER_TEST_PKGLIBDIR="${PBUILDER_PKGLIBDIR:-$PBUILDER_ROOT/usr/lib/pbuilder}"
- . "$PBUILDER_TEST_PKGLIBDIR/testlib.sh"
-
+ . "$TD/testlib.sh"
. "$PBUILDER_TEST_PKGLIBDIR/pbuilder-modules"
fi
diff --git a/test_pbuilder-satisfydepends-checkparams b/t/test_pbuilder-satisfydepends-checkparams
index 036a048..ccb044d 100755
--- a/test_pbuilder-satisfydepends-checkparams
+++ b/t/test_pbuilder-satisfydepends-checkparams
@@ -1,15 +1,11 @@
#!/bin/bash
+TD="$(dirname "$0")"
if [ -n "$PBUILDER_CHECKOUT" ]; then
- . "$PBUILDER_CHECKOUT/testlib.sh"
-
+ . "$TD/testlib.sh"
PBUILDER_SATISFYDEPENDS_CHECKPARAMS="$PBUILDER_CHECKOUT/pbuilder-satisfydepends-checkparams"
else
- # these currently don't need to be exported
- PBUILDER_TEST_ROOT="${PBUILDER_ROOT:-}"
- PBUILDER_TEST_PKGLIBDIR="${PBUILDER_PKGLIBDIR:-$PBUILDER_ROOT/usr/lib/pbuilder}"
- . "$PBUILDER_TEST_PKGLIBDIR/testlib.sh"
-
+ . "$TD/testlib.sh"
PBUILDER_SATISFYDEPENDS_CHECKPARAMS="$PBUILDER_TEST_PKGLIBDIR/pbuilder-satisfydepends-checkparams"
fi
diff --git a/test_pbuilder-satisfydepends-classic b/t/test_pbuilder-satisfydepends-classic
index c70c778..929699b 100755
--- a/test_pbuilder-satisfydepends-classic
+++ b/t/test_pbuilder-satisfydepends-classic
@@ -3,16 +3,12 @@
# (. ./pbuilder-satisfydepends-"$flavour")
#done
+TD="$(dirname "$0")"
if [ -n "$PBUILDER_CHECKOUT" ]; then
- . "$PBUILDER_CHECKOUT/testlib.sh"
-
+ . "$TD/testlib.sh"
PBUILDER_SATISFYDEPENDS_CLASSIC="$PBUILDER_CHECKOUT/pbuilder-satisfydepends-classic"
else
- # these currently don't need to be exported
- PBUILDER_TEST_ROOT="${PBUILDER_ROOT:-}"
- PBUILDER_TEST_PKGLIBDIR="${PBUILDER_PKGLIBDIR:-$PBUILDER_ROOT/usr/lib/pbuilder}"
- . "$PBUILDER_TEST_PKGLIBDIR/testlib.sh"
-
+ . "$TD/testlib.sh"
PBUILDER_SATISFYDEPENDS_CLASSIC="$PBUILDER_TEST_PKGLIBDIR/pbuilder-satisfydepends-classic"
fi
diff --git a/test_pbuilder-satisfydepends-funcs b/t/test_pbuilder-satisfydepends-funcs
index 9cfc7f2..5aaee9b 100755
--- a/test_pbuilder-satisfydepends-funcs
+++ b/t/test_pbuilder-satisfydepends-funcs
@@ -2,16 +2,12 @@
# testsuite to test pbuilder-satisfydepends-funcs.
+TD="$(dirname "$0")"
if [ -n "$PBUILDER_CHECKOUT" ]; then
- . "$PBUILDER_CHECKOUT/testlib.sh"
-
+ . "$TD/testlib.sh"
. "$PBUILDER_CHECKOUT/pbuilder-satisfydepends-funcs"
else
- # these currently don't need to be exported
- PBUILDER_TEST_ROOT="${PBUILDER_ROOT:-}"
- PBUILDER_TEST_PKGLIBDIR="${PBUILDER_PKGLIBDIR:-$PBUILDER_ROOT/usr/lib/pbuilder}"
- . "$PBUILDER_TEST_PKGLIBDIR/testlib.sh"
-
+ . "$TD/testlib.sh"
. "$PBUILDER_TEST_PKGLIBDIR/pbuilder-satisfydepends-funcs"
fi
diff --git a/test_testlib.sh b/t/test_testlib.sh
index be20c58..a37f6b1 100755
--- a/test_testlib.sh
+++ b/t/test_testlib.sh
@@ -1,13 +1,13 @@
#!/bin/bash
# testsuite for testlib
+TD="$(dirname "$0")"
if [ -n "$PBUILDER_CHECKOUT" ]; then
- . "$PBUILDER_CHECKOUT/testlib.sh"
+ . "$TD/testlib.sh"
+ . "$PBUILDER_CHECKOUT/pbuilder-modules"
else
- # these currently don't need to be exported
- PBUILDER_TEST_ROOT="${PBUILDER_ROOT:-}"
- PBUILDER_TEST_PKGLIBDIR="${PBUILDER_PKGLIBDIR:-$PBUILDER_ROOT/usr/lib/pbuilder}"
- . "$PBUILDER_TEST_PKGLIBDIR/testlib.sh"
+ . "$TD/testlib.sh"
+ . "$PBUILDER_TEST_PKGLIBDIR/pbuilder-modules"
fi
test_success() {
diff --git a/testlib.sh b/t/testlib.sh
index 7d31888..7d31888 100644
--- a/testlib.sh
+++ b/t/testlib.sh