From 17c79a5fcf3b726b9beb583d93b238dc3da54d31 Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Mon, 26 Apr 2021 11:12:52 +0200 Subject: [PATCH] lacncements des 1ers cas-tests --- .../blocFissure_01_without_session.py | 25 +++++++------------ doc/salome/examples/tests.set | 2 +- .../blocFissure/CasTests/blocFissureTest.py | 23 +---------------- 3 files changed, 11 insertions(+), 39 deletions(-) diff --git a/doc/salome/examples/blocFissure_01_without_session.py b/doc/salome/examples/blocFissure_01_without_session.py index 0be55d4c6..224f917e5 100644 --- a/doc/salome/examples/blocFissure_01_without_session.py +++ b/doc/salome/examples/blocFissure_01_without_session.py @@ -7,39 +7,32 @@ Gérald NICOLAS +33.1.78.19.43.52 """ -__revision__ = "V02.01" +__revision__ = "V02.02" 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 +from blocFissure.CasTests import blocFissureTest +BLOCFISSURE_TEST = blocFissureTest(["cubeAngle", "cubeAngle2", "cubeCoin", "cubeMilieu", "cubeTransverse"]) +TEXTE = BLOCFISSURE_TEST.lancement() +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: +if TEXTE: + for LIGNE in TEXTE: #print (LIGNE[:-1]) if ( "NOOK" in LIGNE ): - MESSAGE_ERREUR = LIGNE + MESSAGE_ERREUR = TEXTE ERREUR = int(LIGNE.split()[-1]) break 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: diff --git a/doc/salome/examples/tests.set b/doc/salome/examples/tests.set index 99000efd5..531a85c51 100644 --- a/doc/salome/examples/tests.set +++ b/doc/salome/examples/tests.set @@ -46,7 +46,7 @@ SET(BAD_TESTS test_smeshplugin_mg_tetra_parallele.py test_smeshplugins.py MGAdaptTests_without_session.py - blocFissure_without_session.py + blocFissure_01_without_session.py ) SET(GOOD_TESTS diff --git a/src/Tools/blocFissure/CasTests/blocFissureTest.py b/src/Tools/blocFissure/CasTests/blocFissureTest.py index ef550f868..a0ccc2121 100644 --- a/src/Tools/blocFissure/CasTests/blocFissureTest.py +++ b/src/Tools/blocFissure/CasTests/blocFissureTest.py @@ -17,7 +17,7 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -__revision__ = "V02.01" +__revision__ = "V03.01" """Lancement des cas-tests de blocFissure""" @@ -533,24 +533,3 @@ if __name__ == "__main__" : sys.stdout.write(TEXTE) del BLOCFISSURE_TEST - - #sys.exit(0) - - -#while True: - - #import sys - #print ("arguments = '{}'".format(sys.argv[1:])) - - #L_PROBLEMES, D_AUX = caract_l_problemes() - - #if ( len(L_PROBLEMES) != len(TORUN) ): - #TEXTE = "\nNombre de problèmes définis : {}\n".format(len(L_PROBLEMES)) - #TEXTE += "Longueur de la liste 'TORUN' : {}\n".format(len(TORUN)) - #TEXTE += "\t==> Incohérence de programmation à corriger dans {}".format(__name__) - #print (TEXTE) - #break - - #calcul_tout (L_PROBLEMES, D_AUX) - - #break -- 2.39.2