Ajout d'un test de non régression pour blocFissure

This commit is contained in:
Gérald NICOLAS 2021-04-19 11:46:49 +02:00
parent 953204ba55
commit efd8080634
3 changed files with 53 additions and 3 deletions

View File

@ -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)

View File

@ -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

View File

@ -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: