diff --git a/doc/salome/examples/blocFissure_without_session.py b/doc/salome/examples/blocFissure_without_session.py new file mode 100644 index 000000000..0be55d4c6 --- /dev/null +++ b/doc/salome/examples/blocFissure_without_session.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +"""Tests de blocFissure ; en standalone + +Copyright 2021 EDF +Gérald NICOLAS ++33.1.78.19.43.52 +""" + +__revision__ = "V02.01" + +import os +import tempfile +import sys + +# Fichier de diagnostic +LOGFILE = os.path.join(tempfile.gettempdir(),"blocFissure.log") +if os.path.isfile(LOGFILE): + os.remove(LOGFILE) + +# Lancement des cas-tests +import salome +salome.standalone() +salome.salome_init() + +from blocFissure.materielCasTests import genereMateriel + +from blocFissure.CasTests import execution_Cas + +# Diagnostic +ERREUR = 0 +if os.path.isfile(LOGFILE): + with open(LOGFILE, 'r') as FICHIER: + LES_LIGNES = FICHIER.readlines() + for LIGNE in LES_LIGNES: + #print (LIGNE[:-1]) + if ( "NOOK" in LIGNE ): + MESSAGE_ERREUR = LIGNE + ERREUR = int(LIGNE.split()[-1]) + break +else: + MESSAGE_ERREUR = "Impossible de trouver le fichier de diagnostic {}".format(LOGFILE) + ERREUR = -1 + +if ERREUR: + sys.stderr.write(MESSAGE_ERREUR) + #raise Exception(MESSAGE_ERREUR) + assert(False) diff --git a/doc/salome/examples/tests.set b/doc/salome/examples/tests.set index e9b6e6375..99000efd5 100644 --- a/doc/salome/examples/tests.set +++ b/doc/salome/examples/tests.set @@ -46,6 +46,7 @@ SET(BAD_TESTS test_smeshplugin_mg_tetra_parallele.py test_smeshplugins.py MGAdaptTests_without_session.py + blocFissure_without_session.py ) SET(GOOD_TESTS diff --git a/src/Tools/blocFissure/CasTests/execution_Cas.py b/src/Tools/blocFissure/CasTests/execution_Cas.py index d5a5d41ce..2213dbce7 100644 --- a/src/Tools/blocFissure/CasTests/execution_Cas.py +++ b/src/Tools/blocFissure/CasTests/execution_Cas.py @@ -36,13 +36,14 @@ LOGFILE = os.path.join(tempfile.gettempdir(),"blocFissure.log") #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: