On Fri, 2009-05-08 at 20:55 +0530, Kiran wrote: > Hi, > > The log parser of sched_football sometimes interprets successful runs > as FAILed ones as it gets the final result based on the PASS/FAIL > value of the first run in the log file. > The rationale behind this patch is that sched_football testcase can > itself decide if it has passed or failed based on the_ball value. > There is no need of the log parser as is the case with the other test > cases like pi_perf. > > changelog: > Added pass/fail detection logic to sched_football.c > Removed parse_football.py > Removed the call to parse_football.py from run_auto.sh > > Signed-off by: Kiran Prakash <[email protected]>
Thanks. Regards-- Subrata > Acked-by: Gowrishankar <[email protected]> > Acked-By: Dinakar Guniguntala <[email protected]> > Acked-by: Sripathi Kodi <[email protected]> > > diff -uprN ltp-orig/testcases/realtime/func/sched_football/parse-football.py > ltp/testcases/realtime/func/sched_football/parse-football.py > --- ltp-orig/testcases/realtime/func/sched_football/parse-football.py > 2008-09-18 16:02:03.000000000 +0530 > +++ ltp/testcases/realtime/func/sched_football/parse-football.py > 1970-01-01 05:30:00.000000000 +0530 > @@ -1,58 +0,0 @@ > -# -*- coding: utf-8 -*- > - > -################################################################################ > -## > ## > -## Copyright © International Business Machines Corp., 2007, 2008 > ## > -## > ## > -## This program is 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 program 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 > ## > -## > ## > -## NAME: parse-football.py > ## > -## > ## > -## DESCRIPTION: Log Parser for the sched_football.c test > ## > -## > ## > -## AUTHOR: Chirag <[email protected] > ## > -## > ## > -################################################################################ > - > -from scripts.parser import * > -import re > -class SchedFootballLog(Log): > - def __init__(self,filename): > - Log.__init__(self,filename) > - > - def eval(self): > - exp1= "Final ball position" > - flag=False > - for line in self.read(): > - if exp1 in line: > - list=line.split(" ") > - if(list[3]=="0"): > - return True > - else: > - return False > - > - > - > -def main(): > - if len(sys.argv) < 2: > - sys.exit("Usage : ./%s <logname>" % sys.argv[0]) > - else: > - log_file=sys.argv[1] > - > - log = SchedFootballLog(log_file) > - sys.exit("Result: %s " % (["FAIL", "PASS"][log.eval()])) > - > -if __name__ == "__main__": > - main() > diff -uprN ltp-orig/testcases/realtime/func/sched_football/run_auto.sh > ltp/testcases/realtime/func/sched_football/run_auto.sh > --- ltp-orig/testcases/realtime/func/sched_football/run_auto.sh > 2008-05-22 17:33:14.000000000 +0530 > +++ ltp/testcases/realtime/func/sched_football/run_auto.sh 2009-05-06 > 16:20:06.000000000 +0530 > @@ -12,6 +12,3 @@ source $SCRIPTS_DIR/setenv.sh > > # Warning: tests args are now set in profiles > $SCRIPTS_DIR/run_c_files.sh $profile sched_football > - > -LOG_FILE="$LOG_DIR/$LOG_FORMAT-sched_football.log" > -PYTHONPATH=../../ python parse-football.py $LOG_FILE 2>&1 | tee -a $LOG_FILE > diff -uprN ltp-orig/testcases/realtime/func/sched_football/sched_football.c > ltp/testcases/realtime/func/sched_football/sched_football.c > --- ltp-orig/testcases/realtime/func/sched_football/sched_football.c > 2008-11-28 16:00:13.000000000 +0530 > +++ ltp/testcases/realtime/func/sched_football/sched_football.c > 2009-05-06 16:19:37.000000000 +0530 > @@ -162,6 +162,7 @@ int main(int argc, char* argv[]) > struct sched_param param; > int priority; > int i; > + int result; > setup(); > > rt_init("n:l:h",parse_args,argc,argv); > @@ -197,6 +198,9 @@ int main(int argc, char* argv[]) > > /* Ok, everyone is on the field, bring out the ref */ > printf("Starting referee thread\n"); > - return referee(game_length); > + result = referee(game_length); > + printf("Result: %s\n", result ? "FAIL" : "PASS"); > + return result; > + > } > > Thanks, > Kiran > > > ------------------------------------------------------------------------------ > The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your > production scanning environment may not be a perfect world - but thanks to > Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 > Series Scanner you'll get full speed at 300 dpi even with all image > processing features enabled. http://p.sf.net/sfu/kodak-com > _______________________________________________ > Ltp-list mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/ltp-list ------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
