From 54a1669cb3b066f89d023b882462686c1f4ac294 Mon Sep 17 00:00:00 2001
From: Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Date: Sat, 5 Apr 2008 08:27:29 +0000
Subject: [PATCH] correct retcod - was always returning OK because of the tee
 thing

---
 system/TestMain.py |  2 +-
 system/runtest     | 11 ++++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/system/TestMain.py b/system/TestMain.py
index 1bf482d..9450c19 100755
--- a/system/TestMain.py
+++ b/system/TestMain.py
@@ -235,7 +235,7 @@ steps refer to a method in TestPlc or to a step_* module
                     names.sort()
                     all_step_infos += [ ("%s.%s"%(step,name),module_dict[name],force) for name in names ]
                 except :
-                    print 'Step %s -- ignored'%(step)
+                    print '********** step %s NOT FOUND -- ignored'%(step)
                     traceback.print_exc()
                     overall_result = False
             
diff --git a/system/runtest b/system/runtest
index 9fb8e9a..6c46786 100755
--- a/system/runtest
+++ b/system/runtest
@@ -2,4 +2,13 @@
 cd $(dirname $0)
 mkdir -p logs
 logfile=logs/runtest-$(date +%H-%M).log
-exec python -u TestMain.py "$@" | tee $logfile
+
+# figure if TestMain succeeds, as the retcod gets lost in the pipe
+rm -f logs/success
+(python -u TestMain.py "$@" && touch logs/success) | tee $logfile
+
+if [ -f logs/success ] ; then
+    exit 0
+else
+    exit 1
+fi
-- 
2.47.0