# -*- coding: utf-8 -*-
"""Tests de blocFissure ; en standalone
+Cas tests basés sur les matériels :
+. cubeAngle
+. cubeFin
+
Copyright 2021 EDF
Gérald NICOLAS
+33.1.78.19.43.52
"""
-__revision__ = "V02.01"
+__revision__ = "V02.04"
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()
+salome.salome_init_without_session()
-from blocFissure.materielCasTests import genereMateriel
-
-from blocFissure.CasTests import execution_Cas
+from blocFissure.CasTests.blocFissureTest import blocFissureTest
+BLOCFISSURE_TEST = blocFissureTest(["cubeAngle", "cubeAngle_2","cubeCoin", "cubeMilieu", "cubeTransverse"])
+MESSAGE_ERREUR = BLOCFISSURE_TEST.lancement()
+#sys.stdout.write(MESSAGE_ERREUR)
+del BLOCFISSURE_TEST
# 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
+if MESSAGE_ERREUR:
+ if ( "NOOK" in MESSAGE_ERREUR ):
+ LAUX = MESSAGE_ERREUR.split()
+ ERREUR = int(LAUX[LAUX.index("NOOK")+2])
+ else:
+ ERREUR = 0
else:
- MESSAGE_ERREUR = "Impossible de trouver le fichier de diagnostic {}".format(LOGFILE)
+ MESSAGE_ERREUR = "Impossible de trouver le diagnostic de la procédure de tests."
ERREUR = -1
if ERREUR:
sys.stderr.write(MESSAGE_ERREUR)
#raise Exception(MESSAGE_ERREUR)
assert(False)
+