diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | tests/Makefile.am | 6 | ||||
-rwxr-xr-x | tests/t0000-basic.sh | 2 | ||||
-rwxr-xr-x | tests/t1000-mkpartfs.sh | 2 | ||||
-rwxr-xr-x | tests/t2000-mkfs.sh | 2 | ||||
-rw-r--r-- | tests/test-lib.sh | 10 |
6 files changed, 10 insertions, 13 deletions
@@ -30,3 +30,4 @@ parted-*.xdelta.sig parted.spec partprobe/partprobe stamp-h1 +tests/init.sh diff --git a/tests/Makefile.am b/tests/Makefile.am index 2948ae2..1d2a043 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -8,3 +8,9 @@ TESTS_ENVIRONMENT = \ EXTRA_DIST = \ $(TESTS) test-lib.sh + +CLEANFILES = init.sh +all: init.sh +init.sh: Makefile.in + ( echo 'srcdir=$(srcdir)'; echo '. $$srcdir/test-lib.sh' ) > $@-t + mv $@-t $@ diff --git a/tests/t0000-basic.sh b/tests/t0000-basic.sh index 6049e15..f7a0c67 100755 --- a/tests/t0000-basic.sh +++ b/tests/t0000-basic.sh @@ -26,7 +26,7 @@ fi test_description='Test the very basics part #1.' -. $srcdir/test-lib.sh +. ./init.sh # FIXME: is id -u portable enough? uid=`id -u` || uid=1 diff --git a/tests/t1000-mkpartfs.sh b/tests/t1000-mkpartfs.sh index 37dc43a..30f7238 100755 --- a/tests/t1000-mkpartfs.sh +++ b/tests/t1000-mkpartfs.sh @@ -19,7 +19,7 @@ test_description='Create some file systems using mkpartfs.' -. $srcdir/test-lib.sh +. ./init.sh N=1M dev=loop-file diff --git a/tests/t2000-mkfs.sh b/tests/t2000-mkfs.sh index e47da8f..14140f6 100755 --- a/tests/t2000-mkfs.sh +++ b/tests/t2000-mkfs.sh @@ -19,7 +19,7 @@ test_description='Create some file systems using mkfs.' -. $srcdir/test-lib.sh +. ./test-lib.sh N=40M dev=loop-file diff --git a/tests/test-lib.sh b/tests/test-lib.sh index d6804cf..235f515 100644 --- a/tests/test-lib.sh +++ b/tests/test-lib.sh @@ -32,16 +32,6 @@ say () { test "${test_description}" != "" || error "Test script did not set test_description." -# If $srcdir is not set, set it, if it's ".". Otherwise, fail. -if test -a "$srcdir"; then - if test -f test-lib.sh; then - srcdir=. - else - error '$srcdir is not set; either set it, or run the test' \ - 'from the source directory' - fi -fi - while test "$#" -ne 0 do case "$1" in |