Salome HOME
0be55d4c69f596f0fbe12aec6be41b82d2b4041c
[modules/smesh.git] / doc / salome / examples / blocFissure_01_without_session.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 """Tests de blocFissure ; en standalone
4
5 Copyright 2021 EDF
6 GĂ©rald NICOLAS
7 +33.1.78.19.43.52
8 """
9
10 __revision__ = "V02.01"
11
12 import os
13 import tempfile
14 import sys
15
16 # Fichier de diagnostic
17 LOGFILE = os.path.join(tempfile.gettempdir(),"blocFissure.log")
18 if os.path.isfile(LOGFILE):
19   os.remove(LOGFILE)
20
21 # Lancement des cas-tests
22 import salome
23 salome.standalone()
24 salome.salome_init()
25
26 from blocFissure.materielCasTests import genereMateriel
27
28 from blocFissure.CasTests import execution_Cas
29
30 # Diagnostic
31 ERREUR = 0
32 if os.path.isfile(LOGFILE):
33   with open(LOGFILE, 'r') as FICHIER:
34     LES_LIGNES = FICHIER.readlines()
35   for LIGNE in LES_LIGNES:
36     #print (LIGNE[:-1])
37     if ( "NOOK" in LIGNE ):
38       MESSAGE_ERREUR = LIGNE
39       ERREUR = int(LIGNE.split()[-1])
40       break
41 else:
42   MESSAGE_ERREUR = "Impossible de trouver le fichier de diagnostic {}".format(LOGFILE)
43   ERREUR = -1
44
45 if ERREUR:
46   sys.stderr.write(MESSAGE_ERREUR)
47   #raise Exception(MESSAGE_ERREUR)
48   assert(False)