From 8ea6e2acc6b59698b42400918af2d022e9135c8b Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Wed, 25 Feb 2015 15:27:11 +0000
Subject: [PATCH] Add MiniTel simulation to CTests, add batch parameter to
 MiniTel.py

---
 examples/ClientTests/CMakeLists.txt     | 6 ++++++
 examples/ClientTests/scripts/MiniTel.py | 4 +++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/examples/ClientTests/CMakeLists.txt b/examples/ClientTests/CMakeLists.txt
index d0a3cbfc9..848f7a754 100644
--- a/examples/ClientTests/CMakeLists.txt
+++ b/examples/ClientTests/CMakeLists.txt
@@ -103,3 +103,9 @@ foreach (file Assemblies BoxTrafos FCC_HcalBarrel IronCylinder LheD_tracker Magn
   endforeach(type)
 
 endforeach()
+
+SET( test_name "${PackageName}_sim_MiniTel" )
+ADD_TEST( t_${test_name} "${CMAKE_INSTALL_PREFIX}/bin/run_test_${PackageName}.sh"
+  python ${CMAKE_CURRENT_SOURCE_DIR}/scripts/MiniTel.py batch)
+#----- here we simply require that at least 1 volume have been converted
+SET_TESTS_PROPERTIES( t_${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION  "Exception;EXCEPTION;ERROR;Error" )
diff --git a/examples/ClientTests/scripts/MiniTel.py b/examples/ClientTests/scripts/MiniTel.py
index 8e7900185..b26e588b0 100644
--- a/examples/ClientTests/scripts/MiniTel.py
+++ b/examples/ClientTests/scripts/MiniTel.py
@@ -1,4 +1,4 @@
-import os, time, DDG4
+import os, time, DDG4, sys
 from DDG4 import OutputLevel as Output
 from SystemOfUnits import *
 #
@@ -23,6 +23,8 @@ def run():
   simple = DDG4.Simple(kernel)
   simple.printDetectors()
   simple.setupCshUI()
+  if len(sys.argv) >= 2 and sys.argv[1] =="batch":
+    kernel.UI = ''
 
   # Configure I/O
   evt_root = simple.setupROOTOutput('RootOutput','MiniTel_'+time.strftime('%Y-%m-%d_%H-%M'),mc_truth=True)
-- 
GitLab