From babec83424ce68ea2dda5c9e7efd7b0a60645ca3 Mon Sep 17 00:00:00 2001 From: "Philip.Hazel" Date: Fri, 29 Aug 2014 15:24:33 +0000 Subject: [PATCH] Check for pcre2grep's existence before testing; clean up all temporary files afterwards. --- RunGrepTest | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/RunGrepTest b/RunGrepTest index 7080653..dc617a6 100755 --- a/RunGrepTest +++ b/RunGrepTest @@ -20,6 +20,11 @@ unset cp ls mv rm builddir=`pwd` pcre2grep=$builddir/pcre2grep +if [ ! -x $pcre2grep ] ; then + echo "** $pcre2grep does not exist or is not execuatble." + exit 1 +fi + valgrind= while [ $# -gt 0 ] ; do case $1 in @@ -566,6 +571,9 @@ $valgrind $pcre2grep -n --newline=anycrlf "^(abc|def|ghi|jkl)" testNinputgrep >> $cf $srcdir/testdata/grepoutputN testtrygrep if [ $? != 0 ] ; then exit 1; fi +# Clean up local working files +rm -f testNinputgrep teststderrgrep testtrygrep testtemp1grep testtemp2grep + exit 0 # End