head 1.15; access; symbols SHTOOL_2_0_8:1.15 SHTOOL_2_0_7:1.14 SHTOOL_2_0_6:1.13 SHTOOL_2_0_5:1.13 SHTOOL_2_0_4:1.13 SHTOOL_2_0_3:1.12 SHTOOL_2_0_2:1.12 SHTOOL_2_0_1:1.11 SHTOOL_2_0_0:1.11 SHTOOL_2_0b3:1.11 SHTOOL_2_0b2:1.11 SHTOOL_2_0b1:1.11 SHTOOL_1_6:1.9.0.2 SHTOOL_1_6_2:1.9 SHTOOL_1_6_1:1.9 SHTOOL_1_6_0:1.9 SHTOOL_1_5:1.8.0.2 SHTOOL_1_5_4:1.8 SHTOOL_1_5_3:1.7 SHTOOL_1_5_2:1.7 SHTOOL_1_5_1:1.6 SHTOOL_1_5_0:1.6 SHTOOL_1_4_9:1.5 SHTOOL_1_4_8:1.5 SHTOOL_1_4_7:1.4 SHTOOL_1_4_6:1.4 SHTOOL_1_4_5:1.4 SHTOOL_1_4_4:1.4 SHTOOL_1_4_3:1.4 SHTOOL_1_4_2:1.4 SHTOOL_1_4_1:1.4 SHTOOL_1_4_0:1.4; locks; strict; comment @# @; 1.15 date 2008.04.02.20.13.44; author rse; state Exp; branches; next 1.14; commitid eB5Wirx8MdMyDzXs; 1.14 date 2007.05.19.19.09.39; author rse; state Exp; branches; next 1.13; commitid OPUF1UBbllBTwzis; 1.13 date 2006.02.04.09.43.26; author rse; state Exp; branches; next 1.12; commitid oWk7BmnyAitJtfkr; 1.12 date 2005.06.15.08.14.36; author rse; state Exp; branches; next 1.11; 1.11 date 2004.01.01.16.54.20; author rse; state Exp; branches; next 1.10; 1.10 date 2003.02.11.13.00.50; author rse; state Exp; branches; next 1.9; 1.9 date 2001.12.31.15.06.04; author rse; state Exp; branches; next 1.8; 1.8 date 2001.06.14.14.24.17; author rse; state Exp; branches; next 1.7; 1.7 date 2001.01.17.09.55.11; author rse; state Exp; branches; next 1.6; 1.6 date 2000.06.18.11.22.09; author rse; state Exp; branches; next 1.5; 1.5 date 2000.03.12.11.12.21; author rse; state Exp; branches; next 1.4; 1.4 date 99.07.02.08.34.48; author rse; state Exp; branches; next 1.3; 1.3 date 99.07.02.08.34.33; author rse; state Exp; branches; next 1.2; 1.2 date 99.07.02.07.29.57; author rse; state Exp; branches; next 1.1; 1.1 date 99.07.02.07.24.26; author rse; state Exp; branches; next ; desc @@ 1.15 log @adjust copyright for year 2008 @ text @#!/bin/sh ## ## test.sh -- GNU shtool test suite driver ## Copyright (c) 1999-2008 Ralf S. Engelschall ## ## This file is part of shtool and 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 of the License, or (at your option) any later version. ## ## This file 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ## USA, or contact Ralf S. Engelschall . ## shtool=../shtool testdb=../test.db # move to a subdirectory rm -rf test.sd >/dev/null 2>&1 mkdir test.sd || exit 1 cd test.sd || exit 1 # make sure the tool and database exists test -f $shtool || exit 1 test -f $testdb || exit 1 # iterate over all tool tests TOOLS=`grep '^@@begin' $testdb | sed -e 's/^@@begin{//' -e 's/}.*$//'` failed=0 passed=0 ran=0 for tool in $TOOLS; do rm -rf ./* >/dev/null 2>&1 echo "${tool}..............." | awk '{ printf("%s", substr($0, 0, 15)); }' sed -e "/^@@begin{$tool}/,/^@@end{$tool}/p" -e '1,$d' $testdb |\ sed -e '/^@@begin/d' -e '/^@@end/d' \ -e 's/\([^\\]\)[ ]*$/\1 || exit 1/g' \ -e "s;shtool;$shtool;g" >run.sh echo "exit 0" >>run.sh sh -x run.sh >run.log 2>&1 if [ $? -ne 0 ]; then # generate report echo "FAILED" echo "+---Test------------------------------" cat run.sh | sed -e 's/^/| /g' echo "+---Trace-----------------------------" cat run.log | sed -e 's/^/| /g' failed=`expr $failed + 1` echo "+-------------------------------------" else passed=`expr $passed + 1` echo "ok" fi ran=`expr $ran + 1` done # cleanup cd .. rm -rf test.sd >/dev/null 2>&1 # result if [ $failed -gt 0 ]; then echo "FAILED: passed: $passed/$ran, failed: $failed/$ran" else echo "OK: passed: $passed/$ran" fi exit 0 @ 1.14 log @Adjust copyright for year 2007. @ text @d4 1 a4 1 ## Copyright (c) 1999-2007 Ralf S. Engelschall @ 1.13 log @Adjust copyright for year 2006 @ text @d4 1 a4 1 ## Copyright (c) 1999-2006 Ralf S. Engelschall @ 1.12 log @Adjust copyright for year 2005 @ text @d4 1 a4 1 ## Copyright (c) 1999-2005 Ralf S. Engelschall @ 1.11 log @Bump copyright year for 2004 @ text @d4 1 a4 1 ## Copyright (c) 1999-2004 Ralf S. Engelschall @ 1.10 log @Bump year in copyright messages to cover new year 2003. @ text @d4 1 a4 1 ## Copyright (c) 1999-2003 Ralf S. Engelschall @ 1.9 log @bump copyright years @ text @d4 1 a4 1 ## Copyright (c) 1999-2002 Ralf S. Engelschall @ 1.8 log @*** empty log message *** @ text @d4 1 a4 1 ## Copyright (c) 1999-2001 Ralf S. Engelschall @ 1.7 log @*** empty log message *** @ text @d65 1 a65 1 cd .. @ 1.6 log @*** empty log message *** @ text @d4 1 a4 1 ## Copyright (c) 1999-2000 Ralf S. Engelschall @ 1.5 log @*** empty log message *** @ text @d70 1 a70 1 rc="FAILED" d72 1 a72 1 rc="OK" a73 1 echo "$rc: passed: $passed/$ran, failed: $failed/$ran" @ 1.4 log @*** empty log message *** @ text @d4 1 a4 1 ## Copyright (c) 1999 Ralf S. Engelschall @ 1.3 log @*** empty log message *** @ text @a56 1 exit 1 d66 1 a66 1 #rm -rf test.sd >/dev/null 2>&1 @ 1.2 log @*** empty log message *** @ text @d57 1 d67 1 a67 1 rm -rf test.sd >/dev/null 2>&1 @ 1.1 log @*** empty log message *** @ text @d46 1 @