diff options
author | Colin Watson <cjwatson@debian.org> | 2010-09-26 23:57:36 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2010-09-26 23:57:36 +0100 |
commit | 4274affde9622e429f2937c569cd76f38722cb0d (patch) | |
tree | e7b2d15d7adfa1ed46deef01fcbf6d3618539b86 | |
parent | 1548f3ee9ff6844c031123a18a741eb9a8e7b1ad (diff) |
Get the tests working again following the switch to libtool.
* src/tests/Makefile.am (TESTS_ENVIRONMENT): Remove CLEANPATH.
* src/tests/man-1, src/tests/mandb-1, src/tests/mandb-2: Set MANPATH
rather than using run_clean_path; running with a stripped-down
PATH is risky in general and breaks libtool in particular.
* src/tests/testlib.sh (run_clean_path): Remove.
* src/tests/Makefile.am (TESTS_ENVIRONMENT): Add top_builddir.
* src/tests/testlib.sh (run): New function.
* src/tests/lexgrog-1, src/tests/man-1, src/tests/manconv-1,
src/tests/manconv-2, src/tests/manconv-3, src/tests/mandb-1,
src/tests/mandb-2, src/tests/testlib.sh (accessdb_filter): Use run
when running programs from the build tree.
-rw-r--r-- | ChangeLog | 17 | ||||
-rw-r--r-- | src/tests/Makefile.am | 3 | ||||
-rw-r--r-- | src/tests/Makefile.in | 3 | ||||
-rwxr-xr-x | src/tests/lexgrog-1 | 2 | ||||
-rwxr-xr-x | src/tests/man-1 | 5 | ||||
-rwxr-xr-x | src/tests/manconv-1 | 8 | ||||
-rwxr-xr-x | src/tests/manconv-2 | 13 | ||||
-rwxr-xr-x | src/tests/manconv-3 | 2 | ||||
-rwxr-xr-x | src/tests/mandb-1 | 3 | ||||
-rwxr-xr-x | src/tests/mandb-2 | 6 | ||||
-rw-r--r-- | src/tests/testlib.sh | 17 |
11 files changed, 50 insertions, 29 deletions
@@ -1,3 +1,20 @@ +Sun Sep 26 23:53:08 BST 2010 Colin Watson <cjwatson@debian.org> + + Get the tests working again following the switch to libtool. + + * src/tests/Makefile.am (TESTS_ENVIRONMENT): Remove CLEANPATH. + * src/tests/man-1, src/tests/mandb-1, src/tests/mandb-2: Set MANPATH + rather than using run_clean_path; running with a stripped-down + PATH is risky in general and breaks libtool in particular. + * src/tests/testlib.sh (run_clean_path): Remove. + + * src/tests/Makefile.am (TESTS_ENVIRONMENT): Add top_builddir. + * src/tests/testlib.sh (run): New function. + * src/tests/lexgrog-1, src/tests/man-1, src/tests/manconv-1, + src/tests/manconv-2, src/tests/manconv-3, src/tests/mandb-1, + src/tests/mandb-2, src/tests/testlib.sh (accessdb_filter): Use run + when running programs from the build tree. + Sun Sep 26 23:25:31 BST 2010 Colin Watson <cjwatson@debian.org> Move encodings to libman. diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am index 7f690bcb..21e70650 100644 --- a/src/tests/Makefile.am +++ b/src/tests/Makefile.am @@ -18,7 +18,8 @@ ## along with man-db; if not, write to the Free Software Foundation, ## Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -TESTS_ENVIRONMENT = PATH=..:$$PATH CLEANPATH=.. DBTYPE=$(DBTYPE) \ +TESTS_ENVIRONMENT = PATH=..:$$PATH DBTYPE=$(DBTYPE) \ + top_builddir=$(top_builddir) \ @LOCALCHARSET_TESTS_ENVIRONMENT@ $(SHELL) ALL_TESTS = \ lexgrog-1 \ diff --git a/src/tests/Makefile.in b/src/tests/Makefile.in index f1b146ff..15b5aa12 100644 --- a/src/tests/Makefile.in +++ b/src/tests/Makefile.in @@ -1021,7 +1021,8 @@ unlzma = @unlzma@ unxz = @unxz@ vgrind = @vgrind@ xz = @xz@ -TESTS_ENVIRONMENT = PATH=..:$$PATH CLEANPATH=.. DBTYPE=$(DBTYPE) \ +TESTS_ENVIRONMENT = PATH=..:$$PATH DBTYPE=$(DBTYPE) \ + top_builddir=$(top_builddir) \ @LOCALCHARSET_TESTS_ENVIRONMENT@ $(SHELL) ALL_TESTS = \ diff --git a/src/tests/lexgrog-1 b/src/tests/lexgrog-1 index 9d0e4b76..8ab8a0fe 100755 --- a/src/tests/lexgrog-1 +++ b/src/tests/lexgrog-1 @@ -12,7 +12,7 @@ init write_page lextest 1 "$tmpdir/usr/share/man/man1/lextest.1.gz" UTF-8 gz '' \ 'lextest \- simple lexgrog test' echo "$tmpdir/usr/share/man/man1/lextest.1.gz: \"lextest - simple lexgrog test\"" >"$tmpdir/1.exp" -$LEXGROG "$tmpdir/usr/share/man/man1/lextest.1.gz" >"$tmpdir/1.out" +run $LEXGROG "$tmpdir/usr/share/man/man1/lextest.1.gz" >"$tmpdir/1.out" expect_pass 'simple lexgrog test' 'diff -u "$tmpdir/1.exp" "$tmpdir/1.out"' finish diff --git a/src/tests/man-1 b/src/tests/man-1 index 783331b1..7297aa1b 100755 --- a/src/tests/man-1 +++ b/src/tests/man-1 @@ -22,9 +22,8 @@ cat >"$tmpdir/1.exp" <<EOF $(pwd -P)/$tmpdir/usr/share/man/man1/md5sum.textutils.1.gz $(pwd -P)/$tmpdir/usr/share/man/man1/md5sum.1.gz EOF -run_clean_path $MAN -C "$tmpdir/manpath.config" \ - -M "$tmpdir/usr/local/man:$tmpdir/usr/share/man" \ - -aw md5sum >"$tmpdir/1.out" +MANPATH="$tmpdir/usr/local/man:$tmpdir/usr/share/man" run $MAN \ + -C "$tmpdir/manpath.config" -aw md5sum >"$tmpdir/1.out" expect_pass 'symlinks with matching names win' \ 'diff -u "$tmpdir/1.exp" "$tmpdir/1.out"' diff --git a/src/tests/manconv-1 b/src/tests/manconv-1 index 17237f72..0ada3002 100755 --- a/src/tests/manconv-1 +++ b/src/tests/manconv-1 @@ -14,7 +14,7 @@ cat >"$tmpdir/1.exp" <<'EOF' á EOF iconv -f UTF-8 -t ISO-8859-1 <"$tmpdir/1.exp" >"$tmpdir/1.inp" -$MANCONV -f UTF-8 -t UTF-8 <"$tmpdir/1.inp" >"$tmpdir/1.out" +run $MANCONV -f UTF-8 -t UTF-8 <"$tmpdir/1.inp" >"$tmpdir/1.out" expect_pass 'simple coding tag' 'diff -u "$tmpdir/1.exp" "$tmpdir/1.out"' cat >"$tmpdir/2.exp" <<'EOF' @@ -22,7 +22,7 @@ cat >"$tmpdir/2.exp" <<'EOF' á EOF iconv -f UTF-8 -t ISO-8859-1 <"$tmpdir/2.exp" >"$tmpdir/2.inp" -$MANCONV -f UTF-8 -t UTF-8 <"$tmpdir/2.inp" >"$tmpdir/2.out" +run $MANCONV -f UTF-8 -t UTF-8 <"$tmpdir/2.inp" >"$tmpdir/2.out" expect_pass 'mode and coding tags' 'diff -u "$tmpdir/2.exp" "$tmpdir/2.out"' cat >"$tmpdir/3.exp" <<'EOF' @@ -30,13 +30,13 @@ cat >"$tmpdir/3.exp" <<'EOF' á EOF iconv -f UTF-8 -t ISO-8859-1 <"$tmpdir/3.exp" >"$tmpdir/3.inp" -$MANCONV -f UTF-8 -t UTF-8 <"$tmpdir/3.inp" >"$tmpdir/3.out" +run $MANCONV -f UTF-8 -t UTF-8 <"$tmpdir/3.inp" >"$tmpdir/3.out" expect_pass 'iso-latin-1 coding alias' 'diff -u "$tmpdir/3.exp" "$tmpdir/3.out"' cat >"$tmpdir/4.inp" <<'EOF' '\" -*- nroff -*- EOF -$MANCONV -f UTF-8 -t UTF-8 <"$tmpdir/4.inp" >"$tmpdir/4.out" +run $MANCONV -f UTF-8 -t UTF-8 <"$tmpdir/4.inp" >"$tmpdir/4.out" expect_pass 'preprocessor comment but no coding tag' \ 'diff -u "$tmpdir/4.inp" "$tmpdir/4.out"' diff --git a/src/tests/manconv-2 b/src/tests/manconv-2 index 5360f631..43ad13f1 100755 --- a/src/tests/manconv-2 +++ b/src/tests/manconv-2 @@ -15,12 +15,13 @@ done echo) >"$tmpdir/1.inp" iconv -f ISO-8859-1 -t UTF-8 <"$tmpdir/1.inp" >"$tmpdir/1.exp" -$MANCONV -f UTF-8:ISO-8859-1 -t UTF-8 <"$tmpdir/1.inp" >"$tmpdir/1.out" +run $MANCONV -f UTF-8:ISO-8859-1 -t UTF-8 <"$tmpdir/1.inp" >"$tmpdir/1.out" expect_pass '-f UTF-8:ISO-8859-1 -t UTF-8 on ISO-8859-1 input' \ 'diff -u "$tmpdir/1.exp" "$tmpdir/1.out"' iconv -f ISO-8859-2 -t UTF-8 <"$tmpdir/1.inp" >"$tmpdir/1-latin2.exp" -$MANCONV -f UTF-8:ISO-8859-2 -t UTF-8 <"$tmpdir/1.inp" >"$tmpdir/1-latin2.out" +run $MANCONV -f UTF-8:ISO-8859-2 -t UTF-8 \ + <"$tmpdir/1.inp" >"$tmpdir/1-latin2.out" expect_pass '-f UTF-8:ISO-8859-2 -t UTF-8 on ISO-8859-2 input' \ 'diff -u "$tmpdir/1-latin2.exp" "$tmpdir/1-latin2.out"' @@ -30,7 +31,7 @@ done echo 'Б' | iconv -f UTF-8 -t KOI8-R echo '‐') >"$tmpdir/2.inp" iconv -f KOI8-R -t UTF-8 <"$tmpdir/2.inp" >"$tmpdir/2.exp" -$MANCONV -f UTF-8:KOI8-R -t UTF-8 <"$tmpdir/2.inp" >"$tmpdir/2.out" +run $MANCONV -f UTF-8:KOI8-R -t UTF-8 <"$tmpdir/2.inp" >"$tmpdir/2.out" expect_pass '-f UTF-8:KOI8-R -t UTF-8 on KOI8-R input with UTF-8 prefix' \ 'diff -u "$tmpdir/2.exp" "$tmpdir/2.out"' @@ -38,7 +39,7 @@ expect_pass '-f UTF-8:KOI8-R -t UTF-8 on KOI8-R input with UTF-8 prefix' \ printf "\\x$(printf %02x "$x")" done echo) | iconv -f ISO-8859-1 -t UTF-8 >"$tmpdir/3.inp" -$MANCONV -f UTF-8:ISO-8859-1 -t UTF-8 <"$tmpdir/3.inp" >"$tmpdir/3.out" +run $MANCONV -f UTF-8:ISO-8859-1 -t UTF-8 <"$tmpdir/3.inp" >"$tmpdir/3.out" expect_pass '-f UTF-8:ISO-8859-1 -t UTF-8 preserves UTF-8 input' \ 'diff -u "$tmpdir/3.inp" "$tmpdir/3.out"' @@ -51,7 +52,7 @@ EOF iconv -f UTF-8 -t ISO-8859-2 >"$tmpdir/4.exp" <<EOF šł EOF -$MANCONV -f UTF-8:ISO-8859-2 -t ISO-8859-2//IGNORE \ +run $MANCONV -f UTF-8:ISO-8859-2 -t ISO-8859-2//IGNORE \ <"$tmpdir/4.inp" >"$tmpdir/4.out" expect_pass 'recognises input encoding and omits invalid output character' \ 'diff -u "$tmpdir/4.exp" "$tmpdir/4.out"' @@ -66,7 +67,7 @@ trailing data EOF iconv -f ISO-8859-7 -t UTF-8//IGNORE \ <"$tmpdir/5.inp" >"$tmpdir/5.exp" 2>/dev/null -$MANCONV -f UTF-8:ISO-8859-1 -t UTF-8//IGNORE \ +run $MANCONV -f UTF-8:ISO-8859-1 -t UTF-8//IGNORE \ <"$tmpdir/5.inp" >"$tmpdir/5.out" expect_pass 'copes with invalid input characters' \ 'diff -u "$tmpdir/5.exp" "$tmpdir/5.out"' diff --git a/src/tests/manconv-3 b/src/tests/manconv-3 index 9124f70e..771f1ce6 100755 --- a/src/tests/manconv-3 +++ b/src/tests/manconv-3 @@ -10,6 +10,6 @@ init printf '\xcc' >"$tmpdir/1.inp" -expect_pass 'incomplete character at EOF' '! $MANCONV -f EUC-JP -t UTF-8//IGNORE <"$tmpdir/1.inp" >/dev/null' +expect_pass 'incomplete character at EOF' '! run $MANCONV -f EUC-JP -t UTF-8//IGNORE <"$tmpdir/1.inp" >/dev/null' finish diff --git a/src/tests/mandb-1 b/src/tests/mandb-1 index f42369da..a2cc1748 100755 --- a/src/tests/mandb-1 +++ b/src/tests/mandb-1 @@ -14,7 +14,8 @@ db_ext="$(db_ext)" write_page test 1 "$tmpdir/usr/share/man/man1/test.1.gz" UTF-8 gz t \ 'test \- simple mandb test' -run_clean_path $MANDB -C "$tmpdir/manpath.config" -u -q "$tmpdir/usr/share/man" +MANPATH="$tmpdir/usr/share/man" run $MANDB -C "$tmpdir/manpath.config" -u -q \ + "$tmpdir/usr/share/man" echo 'test -> "- 1 1 MTIME A - - gz simple mandb test"' >"$tmpdir/1.exp" accessdb_filter "$tmpdir/usr/share/man/index$db_ext" >"$tmpdir/1.out" expect_pass 'simple mandb test' 'diff -u "$tmpdir/1.exp" "$tmpdir/1.out"' diff --git a/src/tests/mandb-2 b/src/tests/mandb-2 index 478f1152..c90fc1e1 100755 --- a/src/tests/mandb-2 +++ b/src/tests/mandb-2 @@ -16,7 +16,8 @@ db_ext="$(db_ext)" write_page fs 5 "$tmpdir/usr/share/man/man5/fs.5.gz" \ UTF-8 gz t 'fs \- fs(5)' -run_clean_path $MANDB -C "$tmpdir/manpath.config" -u -q "$tmpdir/usr/share/man" +MANPATH="$tmpdir/usr/share/man" run $MANDB -C "$tmpdir/manpath.config" -u -q \ + "$tmpdir/usr/share/man" cat >"$tmpdir/1.exp" <<EOF fs -> "- 5 5 MTIME A - - gz fs(5)" EOF @@ -27,7 +28,8 @@ next_second write_page filesystems 5 "$tmpdir/usr/share/man/man5/filesystems.5.gz" \ UTF-8 gz t 'filesystems \- filesystems(5)' ln -sf filesystems.5.gz "$tmpdir/usr/share/man/man5/fs.5.gz" -run_clean_path $MANDB -C "$tmpdir/manpath.config" -u -q "$tmpdir/usr/share/man" +MANPATH="$tmpdir/usr/share/man" run $MANDB -C "$tmpdir/manpath.config" -u -q \ + "$tmpdir/usr/share/man" cat >"$tmpdir/2.exp" <<EOF filesystems -> "- 5 5 MTIME A - - gz filesystems(5)" fs -> "- 5 5 MTIME B - - gz filesystems(5)" diff --git a/src/tests/testlib.sh b/src/tests/testlib.sh index f2ff2164..b032aa0f 100644 --- a/src/tests/testlib.sh +++ b/src/tests/testlib.sh @@ -6,6 +6,13 @@ init () { trap 'rm -rf "$tmpdir"' HUP INT QUIT TERM } +run () { + "$top_builddir/libtool" --mode=execute \ + -dlopen "$top_builddir/lib/.libs/libman.la" \ + -dlopen "$top_builddir/libdb/.libs/libmandb.la" \ + "$@" +} + fake_config () { for dir; do echo "MANDATORY_MANPATH $tmpdir$dir" @@ -44,17 +51,9 @@ EOF rm -f "$3.tmp1" "$3.tmp2" } -run_clean_path () { - if [ "$CLEANPATH" ]; then - PATH="$CLEANPATH" "$@" - else - "$@" - fi -} - accessdb_filter () { # e.g. 'test -> "- 1 1 1250702063 A - - gz simple mandb test"' - $ACCESSDB "$1" | grep -v '^\$' | \ + run $ACCESSDB "$1" | grep -v '^\$' | \ sed 's/\(-> "[^ ][^ ]* [^ ][^ ]* [^ ][^ ]* \)[^ ][^ ]* /\1MTIME /' } |