Hi,
It has been a long demand that ltp should be able to run say N no. of
times sequentially. If we choose the default run, then all the default
test cases will complete one run and then repeat over again and again.
Similar will be the case if you choose selective test cases. This is
mainly required for situations where the test case(s) is doubted to
generate different results in the same environment in continuous runs.
Unlike the -t Option which allows you to run the tests only in a
particular interval (and here you don“t know where it will get
terminated exactly), this option -T <REPETITION> will allow you to run
this <REPETITION> times irrespective of the time it takes, and,
definitely will vary from machine to machine, and the test case that you
have selected to run. Instead of twiking the PAN (as it is stable
enough), i found this simple implementation more attractive.
Please review the attached patch. It works well for me.
--Subrata
--- runltp.orig 2008-01-23 20:35:31.000000000 +0530
+++ runltp 2008-01-23 21:02:58.000000000 +0530
@@ -146,6 +146,7 @@ usage()
-t 45m = 45 minutes
-t 24h = 24 hours
-t 2d = 2 days
+ -T REPEATATION Execute the testsuite for REPEATATION no. of times
-v Print more verbose output to screen.
-w CMDFILEADDR Uses wget to get the user's list of testcases.
-x INSTANCES Run multiple instances of this testsuite.
@@ -166,6 +167,7 @@ main()
local ALT_HTML_OUT=0
local ALT_EMAIL_OUT=0
local RUN_NETEST=0
+ local RUN_REPEATED=0
local QUIET_MODE=""
local VERBOSE_MODE=""
local NETPIPE=0
@@ -185,7 +187,7 @@ main()
local PAN_COMMAND=""
version_date=`head -n 1 $LTPROOT/ChangeLog`
- while getopts a:c:C:d:D:f:ehi:g:l:m:Nno:pqr:s:t:vw:x: arg
+ while getopts a:c:C:d:D:f:ehi:g:l:m:Nno:pqr:s:t:T:vw:x: arg
do case $arg in
a) EMAIL_TO=$OPTARG
ALT_EMAIL_OUT=1;;
@@ -353,7 +355,10 @@ main()
# to run from the command line
# (2m = two minutes, 2h = two hours, etc)
DURATION="-t $OPTARG" ;;
-
+
+ T) # In case you want the testcases to runsequentially RUN_REPEATED times
+ RUN_REPEATED=$OPTARG;;
+
v) VERBOSE_MODE=1;;
w) CMDFILEADDR=$OPTARG;;
@@ -591,6 +596,15 @@ main()
}
}
+ if [ $RUN_REPEATED -gt 1 ]; then # You need to specify at least more than 1 sequential run, else it runs default
+ cp ${TMP}/alltests ${TMP}/alltests.temp
+ inc=1
+ while [ $inc -lt $RUN_REPEATED ] ; do
+ cat ${TMP}/alltests.temp >> ${TMP}/alltests
+ inc=`expr $inc + 1`
+ done
+ fi
+
[ ! -z "$QUIET_MODE" ] && { echo "INFO: Test start time: $(date)" ; }
PAN_COMMAND="${LTPROOT}/pan/pan $QUIET_MODE -e -S $INSTANCES $DURATION -a $$ \
-n $$ $PRETTY_PRT -f ${TMP}/alltests $LOGFILE $OUTPUTFILE $FAILCMDFILE"
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list