From 352a4fa39695321feceda983a62e084cc23df58d Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 4 Mar 2009 09:06:49 +0000 Subject: [PATCH] modify salome_test to skip SUPERV tests in SALOME series5x --- src/KERNEL_PY/salome_test.py | 20 +++++++++++++------- src/KERNEL_PY/salome_version.py | 23 +++++++++++++++++++++++ 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/src/KERNEL_PY/salome_test.py b/src/KERNEL_PY/salome_test.py index 23d7d4a1a..a62cbafe9 100755 --- a/src/KERNEL_PY/salome_test.py +++ b/src/KERNEL_PY/salome_test.py @@ -253,14 +253,16 @@ print ret smesh.Compute(mesh, box) sg.updateObjBrowser(1); +##################################################################### # SUPERVISOR module is not available since SALOME 5.0 version -defineSuperV = 0 - -if (defineSuperV != 0) & (sys.platform != "win32"): - print - print "============= Test Supervisor =============================" - print - +##################################################################### +print +print "============= Test Supervisor =============================" +print +import salome_version +versions = salome_version.getVersions() +if versions[0] < 5: + # SUPERV module is avaiable comp = catalog.GetComponent("SUPERV") if comp is None: raise RuntimeError,"Component SUPERV not found in Module Catalog." @@ -455,6 +457,10 @@ if (defineSuperV != 0) & (sys.platform != "win32"): sg.updateObjBrowser(1); pass +else: + # SUPERV module is NOT avaiable + print "WARNING! Supervisor is not avaiable in this version of SALOME!" + pass print print "============= Test VISU and MED =============================" diff --git a/src/KERNEL_PY/salome_version.py b/src/KERNEL_PY/salome_version.py index 2c95b4219..696cd48db 100644 --- a/src/KERNEL_PY/salome_version.py +++ b/src/KERNEL_PY/salome_version.py @@ -84,3 +84,26 @@ def getVersionRelease( mod = "KERNEL" ): except: pass return None + +def getVersions( mod = "KERNEL" ): + """ + Get SALOME module version as list of [major, minor, release] numbers + Returns: version numbers list + """ + try: + major = int( getVersionMajor( mod ) ) + except: + major = 0 + pass + try: + minor = int( getVersionMinor( mod ) ) + except: + minor = 0 + pass + try: + rel = int( getVersionRelease( mod ) ) + except: + rel = 0 + pass + return [ major, minor, rel ] + -- 2.39.2