test_all.sh create now a log file

This commit is contained in:
Laurent Saboret 2008-08-20 14:31:55 +00:00
parent e93e696f40
commit 5e61260a99
4 changed files with 21 additions and 7 deletions

View File

@ -5,8 +5,5 @@ rem Double-clickable version of test_all.sh on Windows/Cygwin
rem Path to Cygwin is hard-coded rem Path to Cygwin is hard-coded
PATH=%PATH%;c:\Applis\cygwin\bin PATH=%PATH%;c:\Applis\cygwin\bin
rem Create test folder (if needed) sh ./test_all.sh
mkdir test
sh ./test_all.sh 2>&1 | tee test/test_all.log
pause pause

View File

@ -8,6 +8,7 @@
ERRORFILE=error.txt ERRORFILE=error.txt
# Find executable name (different on Windows and Unix) # Find executable name (different on Windows and Unix)
# ----------------------------------------------------
find_executable() find_executable()
{ {
PARAM_APPLICATION="" PARAM_APPLICATION=""
@ -20,6 +21,7 @@ find_executable()
} }
# run 1 test # run 1 test
# ----------
run() run()
{ {
# Find exe # Find exe
@ -43,13 +45,18 @@ run()
echo "------------------------------------------------------------------" echo "------------------------------------------------------------------"
echo echo
if eval $COMMAND 2>&1 ; then if eval $COMMAND 2>&1 ; then
echo " succesful execution of $1" >> $ERRORFILE echo " successful execution of $1" >> $ERRORFILE
else else
echo " ERROR: execution of $1" >> $ERRORFILE echo " ERROR: execution of $1" >> $ERRORFILE
fi fi
echo echo
} }
# main
# ----
(
# remove the previous error file # remove the previous error file
rm -f $ERRORFILE rm -f $ERRORFILE
touch $ERRORFILE touch $ERRORFILE
@ -78,4 +85,5 @@ cat $ERRORFILE
echo echo
rm -f $ERRORFILE rm -f $ERRORFILE
) 2>&1 | tee test_all.log

View File

@ -5,5 +5,5 @@ rem Double-clickable version of test_all.sh on Windows/Cygwin
rem Path to Cygwin is hard-coded rem Path to Cygwin is hard-coded
PATH=%PATH%;c:\Applis\cygwin\bin PATH=%PATH%;c:\Applis\cygwin\bin
sh ./test_all.sh 2>&1 | tee test_all.log sh ./test_all.sh
pause pause

View File

@ -8,6 +8,7 @@
ERRORFILE=error.txt ERRORFILE=error.txt
# Find executable name (different on Windows and Unix) # Find executable name (different on Windows and Unix)
# ----------------------------------------------------
find_executable() find_executable()
{ {
PARAM_APPLICATION="" PARAM_APPLICATION=""
@ -20,6 +21,7 @@ find_executable()
} }
# run 1 test # run 1 test
# ----------
run() run()
{ {
# Find exe # Find exe
@ -43,13 +45,18 @@ run()
echo "------------------------------------------------------------------" echo "------------------------------------------------------------------"
echo echo
if eval $COMMAND 2>&1 ; then if eval $COMMAND 2>&1 ; then
echo " succesful execution of $1" >> $ERRORFILE echo " successful execution of $1" >> $ERRORFILE
else else
echo " ERROR: execution of $1" >> $ERRORFILE echo " ERROR: execution of $1" >> $ERRORFILE
fi fi
echo echo
} }
# main
# ----
(
# remove the previous error file # remove the previous error file
rm -f $ERRORFILE rm -f $ERRORFILE
touch $ERRORFILE touch $ERRORFILE
@ -72,3 +79,5 @@ cat $ERRORFILE
echo echo
rm -f $ERRORFILE rm -f $ERRORFILE
) 2>&1 | tee test_all.log