various fixes for the warning mode
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Mon, 27 Jan 2014 08:26:44 +0000 (09:26 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Mon, 27 Jan 2014 08:26:44 +0000 (09:26 +0100)
system/TestMain.py
system/TestPlc.py
system/run_log

index 0c84e35..cf8f670 100755 (executable)
@@ -286,7 +286,7 @@ steps refer to a method in TestPlc or to a step_* module
         if self.options.list_steps:
             self.init_steps()
             self.list_steps()
-            return True
+            return 'SUCCESS'
 
         # steps
         if not self.options.steps:
@@ -299,6 +299,7 @@ steps refer to a method in TestPlc or to a step_* module
         self.options.exclude = [ step.replace('-','_') for step in self.options.exclude ]
         self.options.ignore = [ step.replace('-','_') for step in self.options.ignore ]
 
+        # technicality, decorate known steps to produce the '_ignore' version
         TestPlc.create_ignore_steps()
 
         # exclude
@@ -441,7 +442,7 @@ steps refer to a method in TestPlc or to a step_* module
                                 skip_step=True
                             elif answer in ['q','b']:   # quit/bye
                                 print 'Exiting'
-                                return
+                                return 'FAILURE'
                             elif answer in ['d']:       # dry_run
                                 dry_run=self.options.dry_run
                                 self.options.dry_run=True
@@ -540,4 +541,4 @@ steps refer to a method in TestPlc or to a step_* module
 if __name__ == "__main__":
     exit_code = TestMain().main()
     print 'run_log is exiting',exit_code
-    sys.exit(TestMain().main())
+    sys.exit(exit_code)
index 7c629f0..dd422a8 100644 (file)
@@ -83,7 +83,6 @@ def ignore_result (method):
 class slice_mapper__tasks (object):
     # could not get this to work with named arguments
     def __init__ (self,timeout_minutes,silent_minutes,period_seconds):
-        print "timeout_minutes,silent_minutes,period_seconds",timeout_minutes,silent_minutes,period_seconds
         self.timeout=timedelta(minutes=timeout_minutes)
         self.silent=timedelta(minutes=silent_minutes)
         self.period=timedelta(seconds=period_seconds)
index 16ed934..e170463 100755 (executable)
@@ -12,11 +12,9 @@ tracelast=trace
 rm -f logs/success
 rm -f logs/$runlast; (cd logs; ln -s $runfile $runlast)
 rm -f logs/$tracelast; (cd logs; ln -s $tracefile $tracelast)
-python -u TestMain.py -t logs/$tracefile "$@" &> logs/$runfile && touch logs/success
+python -u TestMain.py -t logs/$tracefile "$@" &> logs/$runfile ; retcod=$?
 cat logs/$runfile
+[ "$retcod" == 0 ] && touch logs/success
 
-if [ -f logs/success ] ; then
-    exit 0
-else
-    exit 1
-fi
+echo "run_log is exiting" $retcod
+exit $retcod