Skip to content

Commit

Permalink
tests/mansyntax.sh: fix 'make distcheck' with recent autotools
Browse files Browse the repository at this point in the history
Do not create symbolic links off the build directory.  Recent autotools
verify that out-of-source build works even if the source directory tree
is not writable.
  • Loading branch information
kdudka committed Jul 2, 2015
1 parent 418be87 commit 13f8add
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
7 changes: 4 additions & 3 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ find_program(MAN_EXECUTABLE man)
find_program(GREP_EXECUTABLE grep)
mark_as_advanced(SH_EXECUTABLE MAN_EXECUTABLE GREP_EXECUTABLE)
if(SH_EXECUTABLE AND MAN_EXECUTABLE AND GREP_EXECUTABLE)
add_test(mansyntax
${SH_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/mansyntax.sh")
set(cmd "srcdir=${CMAKE_CURRENT_SOURCE_DIR}")
set(cmd "${cmd} ${CMAKE_CURRENT_SOURCE_DIR}/mansyntax.sh")
add_test(mansyntax ${SH_EXECUTABLE} -c "${cmd}")
endif()

add_test(simple test-simple)
Expand Down Expand Up @@ -107,4 +108,4 @@ if(SSHD_EXECUTABLE AND CHMOD_EXECUTABLE AND KILL_EXECUTABLE)
${CMAKE_CURRENT_BINARY_DIR}/test-${TEST_NAME}_fixture.sh
$<TARGET_FILE:test-${TEST_NAME}>)

endif()
endif()
1 change: 1 addition & 0 deletions tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ endif
check_PROGRAMS = $(ctests)

TESTS_ENVIRONMENT = SSHD=$(SSHD) EXEEXT=$(EXEEXT)
TESTS_ENVIRONMENT += srcdir=$(top_srcdir)/tests builddir=$(top_builddir)/tests

EXTRA_DIST = ssh2.sh mansyntax.sh
EXTRA_DIST += etc/host etc/host.pub etc/user etc/user.pub
9 changes: 5 additions & 4 deletions tests/mansyntax.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ set -e
# Run syntax checks for all manpages in the documentation tree.
#

srcdir="`cd $(dirname $0);pwd`"
srcdir=${srcdir:-$PWD}
dstdir=${builddir:-$PWD}
mandir=${srcdir}/../docs

#
Expand All @@ -19,13 +20,13 @@ fi

ec=0

trap "rm -f $srcdir/man3" EXIT
trap "rm -f $dstdir/man3" EXIT

ln -sf "$mandir" "$srcdir/man3"
ln -sf "$mandir" "$dstdir/man3"

for manpage in $mandir/libssh2_*.*; do
echo "$manpage"
warnings=$(LANG=en_US.UTF-8 MANWIDTH=80 man -M "$srcdir" --warnings \
warnings=$(LANG=en_US.UTF-8 MANWIDTH=80 man -M "$dstdir" --warnings \
-E UTF-8 -l "$manpage" 2>&1 >/dev/null)
if [ -n "$warnings" ]; then
echo "$warnings"
Expand Down

0 comments on commit 13f8add

Please sign in to comment.