From: Subrata <sub...@us...> - 2008-05-19 08:48:51
|
Update of /cvsroot/ltp/ltp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31425/ltp Modified Files: runltp Log Message: Adding default Log File generation support for LTP. By, Subrata Modak<su...@li...> Index: runltp =================================================================== RCS file: /cvsroot/ltp/ltp/runltp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** runltp 13 May 2008 10:44:02 -0000 1.25 --- runltp 19 May 2008 08:48:46 -0000 1.26 *************** *** 61,64 **** --- 61,66 ---- # Nov 28 2007 - Modified - Subrata Modak # - Added a new option to mail back LTP reports + # May 19 2008 - Modified - Subrata Modak + # - Added capability for default Log file generation # ################################################################################# *************** *** 176,179 **** --- 178,182 ---- local DURATION="" local CMDFILEADDR="" + local FAILCMDFILE="" local LOGFILE_NAME="" local LOGFILE="" *************** *** 186,189 **** --- 189,193 ---- local TAG_RESTRICT_STRING="" local PAN_COMMAND="" + local DEFAULT_FILE_NAME_GENERATION_TIME=`date +"%Y_%b_%d-%Hh_%Mm_%Ss"` version_date=`head -n 1 $LTPROOT/ChangeLog` *************** *** 377,380 **** --- 381,392 ---- esac done + + ## It would be nice to create a default log file even if the user has not mentioned + if [ ! "$LOGFILE" ]; then ## User has not mentioned about Log File name + LOGFILE_NAME=$DEFAULT_FILE_NAME_GENERATION_TIME + LOGFILE="-l $LTPROOT/results/LTP_RUN_ON-$LOGFILE_NAME.log" + ALT_DIR_RES=1 + PRETTY_PRT=" -p " + fi ## It would be nice if a Failed File is compulsorily created (gives User better Idea of Tests that failed) *************** *** 384,388 **** if [ ! "$OUTPUTFILE" ]; then ## User has not mentioned about Output File name either if [ ! "$LOGFILE" ]; then ## User has not mentioned about Log File name either ! FAILED_FILE_NAME=`date +"%Y_%b_%d-%Hh_%Mm_%Ss"` FAILCMDFILE="-C $LTPROOT/output/LTP_RUN_ON-$FAILED_FILE_NAME.failed" else ## User Fortunately wanted a log file, --- 396,400 ---- if [ ! "$OUTPUTFILE" ]; then ## User has not mentioned about Output File name either if [ ! "$LOGFILE" ]; then ## User has not mentioned about Log File name either ! FAILED_FILE_NAME=$DEFAULT_FILE_NAME_GENERATION_TIME FAILCMDFILE="-C $LTPROOT/output/LTP_RUN_ON-$FAILED_FILE_NAME.failed" else ## User Fortunately wanted a log file, *************** *** 400,404 **** ## which the HTML parser will require if [ ! "$OUTPUTFILE" ]; then ## User has not mentioned about the Outputfile name, then we need to definitely generate one ! OUTPUTFILE_NAME=`date +"%Y_%b_%d-%Hh_%Mm_%Ss"` OUTPUTFILE="-o $LTPROOT/output/LTP_RUN_ON-$OUTPUTFILE_NAME.output" ALT_DIR_OUT=1 --- 412,416 ---- ## which the HTML parser will require if [ ! "$OUTPUTFILE" ]; then ## User has not mentioned about the Outputfile name, then we need to definitely generate one ! OUTPUTFILE_NAME=$DEFAULT_FILE_NAME_GENERATION_TIME OUTPUTFILE="-o $LTPROOT/output/LTP_RUN_ON-$OUTPUTFILE_NAME.output" ALT_DIR_OUT=1 *************** *** 621,624 **** --- 633,654 ---- fi #$PAN_COMMAND #Duplicated code here, because otherwise if we fail, only "PAN_COMMAND" gets output + + ## Display the Output/Log/Failed/HTML file names here + echo -e "LOG File: \c" + echo $LOGFILE | cut -b4- + + if [ "$OUTPUTFILE" ]; then + echo -e "OUTPUT File: \c" + echo $OUTPUTFILE | cut -b4- + fi + + echo -e "FAILED COMMAND File: \c" + echo $FAILCMDFILE | cut -b4- + + if [ "$HTMLFILE" ]; then + echo "HTML File: $HTMLFILE" + fi + + echo "Running tests......." test_start_time=$(date) ${LTPROOT}/pan/pan $QUIET_MODE -e -S $INSTANCES $DURATION -a $$ -n $$ $PRETTY_PRT -f ${TMP}/alltests $LOGFILE $OUTPUTFILE $FAILCMDFILE *************** *** 655,659 **** echo "Nothing to be mailed here...." else ! TAR_FILE_NAME=LTP_RUN_$version_date`date +"%Y_%b_%d-%Hh_%Mm_%Ss"`.tar if [ "$HTMLFILE_NAME" ] ; then ## HTML file Exists if [ "$ALT_HTML_OUT" -ne 1 ] ; then ## The HTML file path is absolute and not $LTPROOT/output --- 685,689 ---- echo "Nothing to be mailed here...." else ! TAR_FILE_NAME=LTP_RUN_$version_date$DEFAULT_FILE_NAME_GENERATION_TIME.tar if [ "$HTMLFILE_NAME" ] ; then ## HTML file Exists if [ "$ALT_HTML_OUT" -ne 1 ] ; then ## The HTML file path is absolute and not $LTPROOT/output *************** *** 736,741 **** Done executing testcases." - log result(s) is in $LTPROOT/results directory" - output/failed result(s) in $LTPROOT/output directory [If you did not provide Absolute Path] LTP Version: $version_date ###############################################################" --- 766,769 ---- |