#
"""Lancement des cas-tests de blocFissure"""
-import traceback
-
import logging
+import os
+import tempfile
+import traceback
from blocFissure.gmu import initLog
from blocFissure.gmu.casStandard import casStandard
# -----------------------------------------------------------------------------------------------
-#initLog.setDebug()
-#initLog.setVerbose()
-#initLog.setRelease()
-#initLog.setPerfTests()
+LOGFILE = os.path.join(tempfile.gettempdir(),"blocFissure.log")
+#initLog.setDebug(LOGFILE) # debug = 10
+#initLog.setVerbose(LOGFILE) # info = 20
+#initLog.setRelease(LOGFILE) # warning = 30
+#initLog.setPerfTests(LOGFILE) # critical = 50
+#initLog.setAlways(LOGFILE) # critical = 50
# ---tous les cas en séquence, ou les cas sélectionnés ...
-TORUNOK = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0] # OK
+TORUNOK = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 ] # OK 19/04/2021
# 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28
#RUNALL = False
RUNALL = True
if RUNALL:
- TORUN = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
-# 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28
+ TORUN = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
+# 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28
+ TORUN = TORUNOK
else:
TORUNPB = list()
for IAUX in TORUNOK:
nom = cas.nomProbleme
texte_a = "\n=== Exécution du cas n° {}, '{}'".format(n_cas,nom)
logging.critical(ligne+texte_a)
+
try:
ok_maillage = cas.executeProbleme()
except:
if not ok_maillage:
texte = "Problème avec le cas n° {}, '{}'\n".format(n_cas,nom)
print(ligne)
+
return ok_maillage, texte
#=============================================================
def calcul_tout (l_problemes, d_aux):
"""Calcul de tous les cas"""
ligne = "---------------------------------------------------------------------"
- texte = ""
+ texte = "\n"
nb_cas_ok = 0
nb_cas_nook = 0
for n_cas, cas in enumerate(l_problemes):
else:
texte += "Les {} tests se sont bien passés.\n".format(nb_cas)
print (texte+ligne)
+ logging.critical(ligne+texte)
return
#=============================================================