[PATCH] more build tweaks

Jim Meyering meyering at redhat.com
Fri Jun 6 08:28:03 UTC 2008


* tests/Makefile.am (TESTS_ENVIRONMENT): Pass srcdir to tests.
* tests/t*.sh: Default srcdir=3D. in each test, so it may be run
independently of "make".
---
 tests/Makefile.am                     |    3 +++
 tests/t0000-basic.sh                  |    3 ++-
 tests/t0100-print.sh                  |    3 ++-
 tests/t1000-mkpartfs.sh               |    3 ++-
 tests/t1100-busy-label.sh             |    3 ++-
 tests/t1500-small-ext2.sh             |    3 ++-
 tests/t2000-mkfs.sh                   |    3 ++-
 tests/t2100-mkswap.sh                 |    3 ++-
 tests/t2200-dos-label-recog.sh        |    3 ++-
 tests/t3000-constraints.sh            |    3 ++-
 tests/t3100-resize-ext2-partion.sh    |    3 ++-
 tests/t4100-dvh-partition-limits.sh   |    3 ++-
 tests/t4100-msdos-partition-limits.sh |    3 ++-
 tests/t5000-tags.sh                   |    3 ++-
 tests/t6000-dm.sh                     |    3 ++-
 15 files changed, 31 insertions(+), 14 deletions(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index e070b61..3c268d6 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -27,3 +27,6 @@ init.sh: Makefile.in
 	echo 'export PATH' >> $@-t
 	chmod a-w $@-t
 	mv $@-t $@
+
+TESTS_ENVIRONMENT =3D	\
+  srcdir=3D'$(srcdir)'
diff --git a/tests/t0000-basic.sh b/tests/t0000-basic.sh
index 93d6fe6..202a70b 100755
--- a/tests/t0000-basic.sh
+++ b/tests/t0000-basic.sh
@@ -24,7 +24,8 @@ fi

 test_description=3D'Test the very basics part #1.'

-. ./test-lib.sh
+: ${srcdir=3D.}
+. $srcdir/test-lib.sh

 # FIXME: is id -u portable enough?
 uid=3D`id -u` || uid=3D1
diff --git a/tests/t0100-print.sh b/tests/t0100-print.sh
index 3ec0db8..a765a90 100755
--- a/tests/t0100-print.sh
+++ b/tests/t0100-print.sh
@@ -17,7 +17,8 @@

 test_description=3D"the most basic 'print' test"

-. ./test-lib.sh
+: ${srcdir=3D.}
+. $srcdir/test-lib.sh

 dev=3Dloop-file

diff --git a/tests/t1000-mkpartfs.sh b/tests/t1000-mkpartfs.sh
index 9b63b10..f57a330 100755
--- a/tests/t1000-mkpartfs.sh
+++ b/tests/t1000-mkpartfs.sh
@@ -17,7 +17,8 @@

 test_description=3D'Create some file systems using mkpartfs.'

-. ./test-lib.sh
+: ${srcdir=3D.}
+. $srcdir/test-lib.sh

 N=3D1M
 dev=3Dloop-file
diff --git a/tests/t1100-busy-label.sh b/tests/t1100-busy-label.sh
index f48fa4e..6ed0334 100755
--- a/tests/t1100-busy-label.sh
+++ b/tests/t1100-busy-label.sh
@@ -20,7 +20,8 @@ test_description=3D'partitioning (parted -s DEV mklabel) =
a busy disk must fail.'
 privileges_required_=3D1
 erasable_device_required_=3D1

-. ./test-lib.sh
+: ${srcdir=3D.}
+. $srcdir/test-lib.sh
 dev=3D$DEVICE_TO_ERASE

 test_expect_success \
diff --git a/tests/t1500-small-ext2.sh b/tests/t1500-small-ext2.sh
index dd9e398..6e1ac9f 100755
--- a/tests/t1500-small-ext2.sh
+++ b/tests/t1500-small-ext2.sh
@@ -17,7 +17,8 @@

 test_description=3D'Create very small ext2 file systems.'

-. ./test-lib.sh
+: ${srcdir=3D.}
+. $srcdir/test-lib.sh

 dev=3Dloop-file
 test_expect_success \
diff --git a/tests/t2000-mkfs.sh b/tests/t2000-mkfs.sh
index b03ebe5..ab0d8ed 100755
--- a/tests/t2000-mkfs.sh
+++ b/tests/t2000-mkfs.sh
@@ -17,7 +17,8 @@

 test_description=3D'Create some file systems using mkfs.'

-. ./test-lib.sh
+: ${srcdir=3D.}
+. $srcdir/test-lib.sh

 N=3D40M
 dev=3Dloop-file
diff --git a/tests/t2100-mkswap.sh b/tests/t2100-mkswap.sh
index 5b63dbc..148ea05 100755
--- a/tests/t2100-mkswap.sh
+++ b/tests/t2100-mkswap.sh
@@ -17,7 +17,8 @@

 test_description=3D'create linux-swap partitions'

-. ./test-lib.sh
+: ${srcdir=3D.}
+. $srcdir/test-lib.sh

 ######################################################################
 # When creating a partition of type linux-swap(new) in a DOS partition
diff --git a/tests/t2200-dos-label-recog.sh b/tests/t2200-dos-label-recog.sh
index 8b6459b..dd7b905 100755
--- a/tests/t2200-dos-label-recog.sh
+++ b/tests/t2200-dos-label-recog.sh
@@ -17,7 +17,8 @@

 test_description=3D'improved MSDOS partition-table recognition'

-. ./test-lib.sh
+: ${srcdir=3D.}
+. $srcdir/test-lib.sh

 ######################################################################
 # With vestiges of a preceding FAT file system boot sector in the MBR,
diff --git a/tests/t3000-constraints.sh b/tests/t3000-constraints.sh
index 54a7197..183f2db 100755
--- a/tests/t3000-constraints.sh
+++ b/tests/t3000-constraints.sh
@@ -17,7 +17,8 @@

 test_description=3D"exercise Parted's constraint-management code"

-. ./test-lib.sh
+: ${srcdir=3D.}
+. $srcdir/test-lib.sh

 dev=3Dloop-file
 N=3D2
diff --git a/tests/t3100-resize-ext2-partion.sh b/tests/t3100-resize-ext2-p=
artion.sh
index 2549c67..b893e0c 100755
--- a/tests/t3100-resize-ext2-partion.sh
+++ b/tests/t3100-resize-ext2-partion.sh
@@ -18,7 +18,8 @@

 test_description=3D'Exercise an EXT2-resize bug in at least 1.8.7'

-. ./test-lib.sh
+: ${srcdir=3D.}
+. $srcdir/test-lib.sh

 dev=3Dloop-file
 # The "device size", $N, must be larger than $NEW_SIZE.
diff --git a/tests/t4100-dvh-partition-limits.sh b/tests/t4100-dvh-partitio=
n-limits.sh
index 3c1a18a..95ec02b 100755
--- a/tests/t4100-dvh-partition-limits.sh
+++ b/tests/t4100-dvh-partition-limits.sh
@@ -20,7 +20,8 @@ test_description=3D'enforce limits on partition start sec=
tor and length'
 # Need root privileges to use mount.
 privileges_required_=3D1

-. ./test-lib.sh
+: ${srcdir=3D.}
+. $srcdir/test-lib.sh

 ####################################################
 # Create and mount a file system capable of dealing with >=3D2TB files.
diff --git a/tests/t4100-msdos-partition-limits.sh b/tests/t4100-msdos-part=
ition-limits.sh
index 737f430..47000a8 100755
--- a/tests/t4100-msdos-partition-limits.sh
+++ b/tests/t4100-msdos-partition-limits.sh
@@ -20,7 +20,8 @@ test_description=3D'enforce limits on partition start sec=
tor and length'
 # Need root privileges to use mount.
 privileges_required_=3D1

-. ./test-lib.sh
+: ${srcdir=3D.}
+. $srcdir/test-lib.sh

 ####################################################
 # Create and mount a file system capable of dealing with >=3D2TB files.
diff --git a/tests/t5000-tags.sh b/tests/t5000-tags.sh
index 3902729..3096123 100755
--- a/tests/t5000-tags.sh
+++ b/tests/t5000-tags.sh
@@ -17,7 +17,8 @@

 test_description=3D"test bios_grub flag in gpt labels"

-. ./test-lib.sh
+: ${srcdir=3D.}
+. $srcdir/test-lib.sh

 dev=3Dloop-file

diff --git a/tests/t6000-dm.sh b/tests/t6000-dm.sh
index 48f579b..4038997 100755
--- a/tests/t6000-dm.sh
+++ b/tests/t6000-dm.sh
@@ -20,7 +20,8 @@ test_description=3D'determine type of devicemaps.'
 privileges_required_=3D1
 device_mapper_required_=3D1

-. ./test-lib.sh
+: ${srcdir=3D.}
+. $srcdir/test-lib.sh

 # Device maps names - should be random to not conflict with existing ones =
on
 # the system
--=20
1.5.6.rc0.30.g7c3f3




More information about the parted-devel mailing list