diff options
author | James Youngman <jay@gnu.org> | 2007-04-08 19:10:59 +0000 |
---|---|---|
committer | James Youngman <jay@gnu.org> | 2007-04-08 19:10:59 +0000 |
commit | 4302a37c0a71abde8e56bb40580ce09f66c6c3ea (patch) | |
tree | 516232407fab21b57e0146b4192da6facb6866f4 /build-aux | |
parent | 09a1b4bcc860ef6e4427d7be0791dc270c3f064d (diff) | |
download | findutils-4302a37c0a71abde8e56bb40580ce09f66c6c3ea.tar.gz |
Use a better way of locating any exp files (or other test files) that are missing from the source archive generated by 'make dist'
Diffstat (limited to 'build-aux')
-rwxr-xr-x | build-aux/check-testfiles.sh | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/build-aux/check-testfiles.sh b/build-aux/check-testfiles.sh new file mode 100755 index 00000000..bd354480 --- /dev/null +++ b/build-aux/check-testfiles.sh @@ -0,0 +1,64 @@ +#! /bin/sh +# check-testfiles.sh -- Check we distributed all the test files we need +# Copyright (C) 2007 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. + +rv=0 + + +makelist () { + ls "${1}"/*/testsuite/*/*"${2}" | sed -e 's/.*\///' | sort +} + +diagnose () { + makelist "${distdir}" "$1" > dist"${1}".txt && + makelist "${srcdir}" "$1" > src"${1}".txt && + diff src"${1}".txt dist"${1}".txt + rm -f src"${1}".txt dist"${1}".txt + echo +} + + +check_shipfiles () { + distcount=`ls ${distdir}/*/testsuite/*/*${suffix} | wc -l` + srccount=`ls ${srcdir}/*/testsuite/*/*${suffix} | wc -l` + if test $distcount -eq $srccount ; then + echo "All $srccount of the $suffix files are accounted for" + else + echo "ERROR: Missing $suffix files: source $srccount distributed $distcount" >&2 + rv=1 + diagnose "${suffix}" + fi +} + + +main () { + distdir="$1" + srcdir="$2" + shift 2 + if test "$#" -gt 0 ; then + for suffix ; do + check_shipfiles "$suffix" + done + exit $rv + else + echo "You did not specify any test file suffixes." >&2 + exit 1 + fi +} + +main "$@" |