summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2013-05-22 13:00:48 +0200
committerStefano Lattarini <stefano.lattarini@gmail.com>2013-05-22 13:02:50 +0200
commit15996acc36367acf3a653eea6e1fbec03b00a964 (patch)
tree5cf964d7d65663554c15253d3bd359f193171406
parentedbe522d6e9abe71a018d1323ae00f7e7c1625eb (diff)
downloadautomake-15996acc36367acf3a653eea6e1fbec03b00a964.tar.gz
tests: remove some code duplication
* t/ax/am-test-lib (null_install): New function. * t/instdir-java.sh: Use it instead of copied & pasted code. * t/instdir-lisp.sh: Likewise. * t/instdir-ltlib.sh: Likewise. * t/instdir-prog.sh: Likewise. * t/instdir-python.sh: Likewise. * t/instdir-texi.sh: Likewise. * t/instdir.sh: Likewise. * t/instdir2.sh: Likewise. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
-rw-r--r--t/ax/am-test-lib.sh32
-rw-r--r--t/instdir-java.sh13
-rw-r--r--t/instdir-lisp.sh13
-rw-r--r--t/instdir-ltlib.sh13
-rw-r--r--t/instdir-prog.sh16
-rw-r--r--t/instdir-python.sh13
-rw-r--r--t/instdir-texi.sh14
-rw-r--r--t/instdir.sh13
-rw-r--r--t/instdir2.sh13
9 files changed, 48 insertions, 92 deletions
diff --git a/t/ax/am-test-lib.sh b/t/ax/am-test-lib.sh
index 74311f3c3..8072ce0d1 100644
--- a/t/ax/am-test-lib.sh
+++ b/t/ax/am-test-lib.sh
@@ -373,6 +373,7 @@ grep_configure_help ()
$EGREP "$2" am--our-help || exit 1
}
+
# using_gmake
# -----------
# Return success if $MAKE is GNU make, return failure otherwise.
@@ -483,6 +484,37 @@ am__useless_vpath_rebuild=""
yl_distcheck () { useless_vpath_rebuild || run_make distcheck ${1+"$@"}; }
+
+null_install ()
+{
+ for am__v in nulldirs destdir instdir; do
+ if ! eval 'test -n "$'$am__v'"'; then
+ fatal_ "null_install() invoked with \$$am__v unset"
+ fi
+ done
+ unset am__v
+ case $#,$1 in
+ 0,)
+ am__inst='install';;
+ 1,-t|1,--texi)
+ am__inst='install install-html install-dvi install-ps install-pdf';;
+ *)
+ fatal_ "null_install(): invalid usage";;
+ esac
+ run_make $nulldirs $am__inst
+ test ! -e "$instdir"
+ run_make $nulldirs $am__inst DESTDIR="$destdir"
+ test ! -e "$instdir"
+ test ! -e "$destdir"
+ run_make -M $nulldirs uninstall
+ # Creative quoting below to please maintainer-check.
+ grep 'rm'' ' output && exit 1
+ run_make -M $nulldirs uninstall DESTDIR="$destdir"
+ # Creative quoting below to please maintainer-check.
+ grep 'rm'' ' output && exit 1
+ : # For 'set -e'.
+}
+
# count_test_results total=N pass=N fail=N xpass=N xfail=N skip=N error=N
# -----------------------------------------------------------------------
# Check that a testsuite run driven by the parallel-tests harness has
diff --git a/t/instdir-java.sh b/t/instdir-java.sh
index 547ec5f7c..1356f2437 100644
--- a/t/instdir-java.sh
+++ b/t/instdir-java.sh
@@ -45,16 +45,7 @@ cd build
../configure --prefix="$instdir"
$MAKE
-nukedirs='javadir='
-
-run_make $nukedirs install
-test ! -e "$instdir"
-run_make $nukedirs install DESTDIR="$destdir"
-test ! -e "$instdir"
-test ! -e "$destdir"
-run_make $nukedirs uninstall > stdout || { cat stdout; exit 1; }
-cat stdout
-grep 'rm -f' stdout && exit 1
-run_make $nukedirs uninstall DESTDIR="$destdir"
+nulldirs='javadir='
+null_install
:
diff --git a/t/instdir-lisp.sh b/t/instdir-lisp.sh
index 97605571c..b37e6fe8c 100644
--- a/t/instdir-lisp.sh
+++ b/t/instdir-lisp.sh
@@ -42,16 +42,7 @@ cd build
../configure --prefix="$instdir"
$MAKE
-nukedirs='lispdir='
-
-run_make $nukedirs install
-test ! -e "$instdir"
-run_make $nukedirs install DESTDIR="$destdir"
-test ! -e "$instdir"
-test ! -e "$destdir"
-run_make $nukedirs uninstall > stdout || { cat stdout; exit 1; }
-cat stdout
-grep 'rm -f' stdout && exit 1
-run_make $nukedirs uninstall DESTDIR="$destdir"
+nulldirs='lispdir='
+null_install
:
diff --git a/t/instdir-ltlib.sh b/t/instdir-ltlib.sh
index 0299d5a6a..526e29cdf 100644
--- a/t/instdir-ltlib.sh
+++ b/t/instdir-ltlib.sh
@@ -69,16 +69,7 @@ cd build
am_cv_python_pyexecdir="$instdir/pyexec"
$MAKE
-nukedirs='bindir= libdir= pyexecdir='
-
-run_make $nukedirs install
-test ! -e "$instdir"
-run_make $nukedirs install DESTDIR="$destdir"
-test ! -e "$instdir"
-test ! -e "$destdir"
-run_make $nukedirs uninstall > stdout || { cat stdout; exit 1; }
-cat stdout
-grep 'rm -f' stdout && exit 1
-run_make $nukedirs uninstall DESTDIR="$destdir"
+nulldirs='bindir= libdir= pyexecdir='
+null_install
:
diff --git a/t/instdir-prog.sh b/t/instdir-prog.sh
index 2c57157a9..26e6c42fe 100644
--- a/t/instdir-prog.sh
+++ b/t/instdir-prog.sh
@@ -68,19 +68,7 @@ cd build
am_cv_python_pyexecdir="$instdir/pyexec"
$MAKE
-nukedirs='bindir= libdir= pyexecdir='
-
-run_make $nukedirs install
-test ! -e "$instdir"
-run_make $nukedirs install DESTDIR="$destdir"
-test ! -e "$instdir"
-test ! -e "$destdir"
-run_make $nukedirs uninstall > stdout \
- || { cat stdout; exit 1; }
-cat stdout
-# Creative quoting below to please maintainer-check.
-grep 'rm'' ' stdout && exit 1
-run_make $nukedirs uninstall DESTDIR="$destdir" > stdout \
- || { cat stdout; exit 1; }
+nulldirs='bindir= libdir= pyexecdir='
+null_install
:
diff --git a/t/instdir-python.sh b/t/instdir-python.sh
index e431a0635..2bd4014ed 100644
--- a/t/instdir-python.sh
+++ b/t/instdir-python.sh
@@ -46,16 +46,7 @@ cd build
../configure --prefix="$instdir"
$MAKE
-nukedirs='pythondir='
-
-run_make $nukedirs install
-test ! -e "$instdir"
-run_make $nukedirs install DESTDIR="$destdir"
-test ! -e "$instdir"
-test ! -e "$destdir"
-run_make $nukedirs uninstall > stdout || { cat stdout; exit 1; }
-cat stdout
-grep 'rm -f' stdout && exit 1
-run_make $nukedirs uninstall DESTDIR="$destdir"
+nulldirs='pythondir='
+null_install
:
diff --git a/t/instdir-texi.sh b/t/instdir-texi.sh
index 5cdaddbef..6f30419f7 100644
--- a/t/instdir-texi.sh
+++ b/t/instdir-texi.sh
@@ -56,17 +56,7 @@ cd build
$MAKE all dvi ps pdf html
ls -l
-nukedirs='infodir= htmldir= dvidir= psdir= pdfdir='
-
-run_make $nukedirs install install-html install-dvi install-ps install-pdf
-test ! -e "$instdir"
-run_make $nukedirs install install-html install-dvi install-ps install-pdf \
- DESTDIR="$destdir"
-test ! -e "$instdir"
-test ! -e "$destdir"
-run_make $nukedirs uninstall > stdout || { cat stdout; exit 1; }
-cat stdout
-grep 'rm -f' stdout && exit 1
-run_make $nukedirs uninstall DESTDIR="$destdir"
+nulldirs='infodir= htmldir= dvidir= psdir= pdfdir='
+null_install --texi
:
diff --git a/t/instdir.sh b/t/instdir.sh
index 6cc4c2c3e..872f3dca7 100644
--- a/t/instdir.sh
+++ b/t/instdir.sh
@@ -55,16 +55,7 @@ cd build
../configure --prefix="$instdir"
$MAKE
-nukedirs='bindir= datadir= includedir= foodir= bardir= man1dir= man2dir='
-
-run_make $nukedirs install
-test ! -e "$instdir"
-run_make $nukedirs install DESTDIR="$destdir"
-test ! -e "$instdir"
-test ! -e "$destdir"
-run_make $nukedirs uninstall > stdout || { cat stdout; exit 1; }
-cat stdout
-grep 'rm -f' stdout && exit 1
-run_make $nukedirs uninstall DESTDIR="$destdir"
+nulldirs='bindir= datadir= includedir= foodir= bardir= man1dir= man2dir='
+null_install
:
diff --git a/t/instdir2.sh b/t/instdir2.sh
index e85e9c190..184859193 100644
--- a/t/instdir2.sh
+++ b/t/instdir2.sh
@@ -77,16 +77,7 @@ cd build
../configure --prefix="$instdir"
$MAKE
-nukedirs='bindir= datadir= includedir= foodir= bardir= man1dir= man2dir='
-
-run_make $nukedirs install
-test ! -e "$instdir"
-run_make $nukedirs install DESTDIR="$destdir"
-test ! -e "$instdir"
-test ! -e "$destdir"
-run_make $nukedirs uninstall > stdout || { cat stdout; exit 1; }
-cat stdout
-grep 'rm -f' stdout && exit 1
-run_make $nukedirs uninstall DESTDIR="$destdir"
+nulldirs='bindir= datadir= includedir= foodir= bardir= man1dir= man2dir='
+null_install
: