Salome HOME
Ajout d'un test de non régression pour blocFissure
authorGérald NICOLAS <gerald.nicolas@edf.fr>
Mon, 19 Apr 2021 09:46:49 +0000 (11:46 +0200)
committerGérald NICOLAS <gerald.nicolas@edf.fr>
Mon, 19 Apr 2021 09:46:49 +0000 (11:46 +0200)
doc/salome/examples/blocFissure_without_session.py [new file with mode: 0644]
doc/salome/examples/tests.set
src/Tools/blocFissure/CasTests/execution_Cas.py

diff --git a/doc/salome/examples/blocFissure_without_session.py b/doc/salome/examples/blocFissure_without_session.py
new file mode 100644 (file)
index 0000000..0be55d4
--- /dev/null
@@ -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)
index e9b6e637504ed6d2c33b0a8dee86145151ba701a..99000efd5da74fcf70d5e214b0cdc72860330fee 100644 (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
index d5a5d41ce16cb08280406a635a59d2523b0aeb62..2213dbce75d8edcb75207a400cb018eb3263474b 100644 (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: