# Project name, upper case
STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
-SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7)
-SET(${PROJECT_NAME_UC}_MINOR_VERSION 8)
+SET(${PROJECT_NAME_UC}_MAJOR_VERSION 8)
+SET(${PROJECT_NAME_UC}_MINOR_VERSION 0)
SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
SET(${PROJECT_NAME_UC}_VERSION
${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
-SET(${PROJECT_NAME_UC}_VERSION_DEV 0)
+SET(${PROJECT_NAME_UC}_VERSION_DEV 1)
# Our own set of macros:
LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/salome_adm/cmake_files")
OPTION(SALOME_USE_LIBBATCH "Use LibBatch in KERNEL" OFF)
CMAKE_DEPENDENT_OPTION(SALOME_PACO_PARALLEL "Build with PACO (implies SALOME_USE_MPI)" OFF
"NOT SALOME_LIGHT_ONLY" OFF)
-OPTION(SALOME_USE_PORTMANAGER "Add PortManager support" ON)
CMAKE_DEPENDENT_OPTION(SALOME_USE_MPI "Use MPI containers" OFF
"NOT SALOME_PACO_PARALLEL" ON)
CMAKE_DEPENDENT_OPTION(SALOME_USE_MPI "Use MPI containers" ${SALOME_USE_MPI}
"NOT SALOME_LIGHT_ONLY" OFF)
-MARK_AS_ADVANCED(SALOME_LIGHT_ONLY SALOME_USE_LIBBATCH SALOME_PACO_PARALLEL SALOME_USE_PORTMANAGER)
+MARK_AS_ADVANCED(SALOME_LIGHT_ONLY SALOME_USE_LIBBATCH SALOME_PACO_PARALLEL)
# Required prerequisites
# Find "big" prerequisites first - they reference themselves many others
IF(SALOME_PACO_PARALLEL)
FIND_PACKAGE(SalomePaco REQUIRED)
ENDIF()
-IF(SALOME_USE_PORTMANAGER)
- ADD_DEFINITIONS(-DWITH_PORTMANAGER)
-ENDIF()
IF(SALOME_BUILD_TESTS)
ENABLE_TESTING()
FIND_PACKAGE(SalomeCppUnit)
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
SET(SALOME_TEST_DRIVER "@CMAKE_INSTALL_PREFIX@/bin/salome/appliskel/salome_test_driver.py")
SET(COMPONENT_NAME KERNEL)
-SET(TIMEOUT 500)
+SET(TIMEOUT 200)
SET(KERNEL_TEST_LIB "@CMAKE_INSTALL_PREFIX@/@KERNEL_TEST_LIB@")
SET(SALOME_KERNEL_LIGHT_ONLY @SALOME_LIGHT_ONLY@)
SET(SALOME_USE_LIBBATCH @SALOME_USE_LIBBATCH@)
-SET(SALOME_USE_PORTMANAGER @SALOME_USE_PORTMANAGER@)
-IF(SALOME_USE_PORTMANAGER)
- LIST(APPEND KERNEL_DEFINITIONS "-DWITH_PORTMANAGER")
-ENDIF()
-
# Prerequisites:
IF(SALOME_KERNEL_BUILD_TESTS)
SET_AND_CHECK(CPPUNIT_ROOT_DIR_EXP "@PACKAGE_CPPUNIT_ROOT_DIR@")
orbmodule.py
ORBConfigFile.py
parseConfigFile.py
- runSalome
+ PortManager.py
runSalome.py
runSession.py
runConsole.py
waitNS.py
)
-IF(SALOME_USE_PORTMANAGER)
- SET(PORTMANAGER_SCRIPTS
- PortManager.py
- )
- LIST(APPEND SCRIPTS ${PORTMANAGER_SCRIPTS})
-ENDIF()
-
SALOME_INSTALL_SCRIPTS("${SCRIPTS}" ${SALOME_INSTALL_SCRIPT_SCRIPTS})
logger = createLogger()
#------------------------------------
-# A file locker (Linux only)
+# A file locker
def __acquire_lock(lock):
if sys.platform == "win32":
import msvcrt
import fcntl
fcntl.flock(lock, fcntl.LOCK_UN)
#
+#------------------------------------
def _getConfigurationFilename():
omniorbUserPath = os.getenv("OMNIORB_USER_PATH")
__release_lock(lock)
logger.debug("released port port: %s"%str(port))
-
+
os.umask(oldmask)
#
#clean appli
-DELCOM="rm -rf bin lib share doc idl env.d envd USERS getAppliPath.py runAppli runConsole runSession runRemote.sh SalomeApp.xml runSalomeScript update_catalogs.py kill_remote_containers.py salome *.pyc *~ .bashrc"
+DELCOM="rm -rf bin lib share doc idl env.d envd USERS getAppliPath.py runRemote.sh SalomeApp.xml update_catalogs.py kill_remote_containers.py salome *.pyc *~ .bashrc"
DOIT="false"
if [ $# -gt 0 ]
pass
pass
+ # Generate CTestCustom.cmake to handle long output
+ ctest_custom = os.path.join(home_dir, 'bin', 'salome', 'test', "CTestCustom.cmake")
+ with open(ctest_custom, 'w') as f:
+ f.write("SET(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 1048576) # 1MB\n")
+ f.write("SET(CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 1048576) # 1MB\n")
+
appliskel_dir = os.path.join(home_dir, 'bin', 'salome', 'appliskel')
for fn in ('envd',
'getAppliPath.py',
'kill_remote_containers.py',
- 'runAppli', # OBSOLETE (replaced by salome)
- 'runConsole', # OBSOLETE (replaced by salome)
'runRemote.sh',
- 'runSalomeScript', # OBSOLETE (replaced by salome)
- 'runSession', # OBSOLETE (replaced by salome)
'salome',
'update_catalogs.py',
'.bashrc',
SET(SCRIPTS
envd
runRemote.sh
- runAppli
- runConsole
- runSession
- runSalomeScript
.bashrc
getAppliPath.py
update_catalogs.py
+++ /dev/null
-#!/bin/bash
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-
-###############################################
-############### IMPORTANT NOTE ################
-###############################################
-# The runAppli script is obsolete. #
-# Please consider the new salome launcher. #
-###############################################
-
-
-#APPLI_HOME=`dirname $0`
-APPLI_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-
-# --- retrieve APPLI path, relative to $HOME, set ${APPLI}
-
-export APPLI=`${APPLI_HOME}/getAppliPath.py`
-
-# --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...)
-
-. ${HOME}/${APPLI}/envd ${HOME}/${APPLI}
-
-#export OMNIORB_USER_PATH="${HOME}/.salomeConfig/USERS"
-export OMNIORB_USER_PATH="${HOME}/${APPLI}/USERS"
-
-# --- if mpi lam, start lam (seems safe to be done several times)
-# (manual stop with lamhalt)
-
-if [ "$LAMBHOST" ]; then
- lamboot
-fi
-
-# --- run SALOME
-# (default arguments defined in local SalomeApp.xml could be completed
-# by arguments to this command)
-
-if [ $# -ne 0 ] ; then
- ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py $*
-
-else
- ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py
-fi
+++ /dev/null
-#!/bin/bash
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-
-###############################################
-############### IMPORTANT NOTE ################
-###############################################
-# The runConsole script is obsolete. #
-# Please consider the new salome launcher. #
-###############################################
-
-
-APPLI_HOME=`dirname $0`
-
-# --- retrieve APPLI path, relative to $HOME, set ${APPLI}
-
-export APPLI=`${APPLI_HOME}/getAppliPath.py`
-
-# --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...)
-
-. ${HOME}/${APPLI}/envd ${HOME}/${APPLI}
-
-#export OMNIORB_USER_PATH="${HOME}/.salomeConfig/USERS"
-export OMNIORB_USER_PATH="${HOME}/${APPLI}/USERS"
-
-# --- open a Python interpreter with SALOME environment
-
-${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python -i ${KERNEL_ROOT_DIR}/bin/salome/salomeConsole.py $*
+++ /dev/null
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-###############################################
-############### IMPORTANT NOTE ################
-###############################################
-# The runSalomeScript script is obsolete. #
-# Please consider the new salome launcher. #
-###############################################
-
-import os,sys,optparse
-import socket,shutil
-import re
-
-usage="""
- Connect to a SALOME session (local or remote) and execute a Python script with data files in argument (optional)
-
- Usage: %prog [ options ] script
-
- script : The Python script to execute in the SALOME session
-
- SALOME SESSION
- --------------
- If PORT and MACHINE are not given, try to connect to the last active session on the local machine
- If PORT and MACHINE are given, try to connect to the remote session associated with PORT on MACHINE
- If MACHINE is not given, try to connect to the session associated to PORT on the local machine
- If PORT is not given, try to connect to the remote session associated to port 2810 on MACHINE
-
- If MACHINE isn't localhost or hostname, USER is needed
-
- If Salome isn't installed on the local machine, use APPLI_DIST to execute a distant session
-
-
- INPUTS AND OUPUTS
- -----------------
- script is needed in all case
- INPUT and OUTPUT are used only when Salome isn't on local machine. It defines a list of script (full path, blank separated)
- Actions done with these two lists are :
- - adjustment of path in a temporary script file
- - copy of the input files and script file on the distant machine
-
-"""
-
-appli_local=os.path.realpath(os.path.dirname(__file__))
-
-def get_hostname():
- return socket.gethostname().split('.')[0]
-
-def vararg_callback(option, opt_str, value, parser):
- """optparse callback for variable length arguments"""
- assert value is None
-
- done = 0
- value = []
- rargs = parser.rargs
- while rargs:
- arg = rargs[0]
-
- # Stop if we hit an arg like "--foo", "-a", "-fx", "--file=f",
- # etc. Note that this also stops on "-3" or "-3.0", so if
- # your option takes numeric values, you will need to handle this.
- if ((arg[:2] == "--" and len(arg) > 2) or
- (arg[:1] == "-" and len(arg) > 1 and arg[1] != "-")):
- break
- else:
- value.append(arg)
- del rargs[0]
-
- setattr(parser.values, option.dest, value)
-
-def parse_args():
- """parse arguments, check validity and set defaults"""
- parser = optparse.OptionParser(usage=usage)
- parser.add_option('-p','--port', dest="port", default='', help="The port to connect to")
- parser.add_option('-m','--machine', dest="machine", default='', help="The computer to connect to")
- parser.add_option('-d','--directory', dest="directory", help="[Distant Mode] The APPLI_HOME path on the distant machine (must be used if Salome isn't on the local machine)")
- parser.add_option('-u','--user', dest="user", default='', help="[Distant Mode] The user on the computer to connect to")
- parser.add_option('-i','--infiles', dest="infiles", default=[], action="callback", callback=vararg_callback,
- help="[Distant Mode] The list of input files (blank separated) used in the Python script")
- parser.add_option('-o','--outfiles', dest="outfiles", default=[], action="callback", callback=vararg_callback,
- help="[Distant Mode] The list of output files (blank separated) generated by the Python script")
-
- args=sys.argv[1:]
-
- script=""
- if args:
- script=args.pop()
-
- options, args = parser.parse_args(args)
-
- #check the arguments
- if not os.path.exists(script):
- print "ERROR: the script file is mandatory"
- sys.exit(1)
-
- machine=options.machine
- port=options.port
- user=options.user
- infiles = options.infiles
- outfiles = options.outfiles
- directory=options.directory
-
- mode="local"
-
- if machine:
- here=get_hostname()
- if machine != here and machine != "localhost":
- #SALOME server is on a remote computer
- mode="remote"
-
- if not user:
- print "ERROR: the remote execution needs -u user argument"
- sys.exit(1)
-
- if not os.path.exists(os.path.join(appli_local,"runSession")):
- if not directory:
- print "ERROR: the remote execution without SALOME installation needs -d directory argument"
- sys.exit(1)
-
- return mode,user,machine,port,directory,infiles,outfiles,script
-
-def copy_files(user,machine,script,infiles,outfiles,directory):
- """modify script, copy files to remote computer and return lists of copied files"""
-
- namescript=os.path.basename(script)
- import getpass
- logname = getpass.getuser()
- tmp_script="/tmp/%s_%s_%s" % (logname,os.getpid(),namescript)
- with open(script, 'r') as fscript:
- script_text=fscript.read()
-
- list_infiles=[]
- list_outfiles=[]
-
- n=0
- for infile in infiles:
- # generate a temporary file name
- namefile=os.path.basename(infile)
- tmp_file="/tmp/%s_%s_i%s_%s" % (logname,os.getpid(),n,namefile)
-
- #modify the salome script
- script_text = re.sub(infile,tmp_file,script_text)
-
- # copy the infile to the remote server
- cmd="scp %s %s@%s:%s" % (infile,user,machine,tmp_file)
- print "[ SCP ]",cmd
- os.system(cmd)
-
- list_infiles.append(tmp_file)
- n=n+1
-
- n=0
- for outfile in outfiles:
- # generate a temporary file name
- namefile=os.path.basename(outfile)
- tmp_file="/tmp/%s_%s_o%s_%s" % (logname,os.getpid(),n,namefile)
-
- #modify the salome script
- script_text = re.sub(outfile,tmp_file,script_text)
-
- list_outfiles.append(tmp_file)
- n=n+1
-
- with open(tmp_script,'w') as fscript:
- fscript.write(script_text)
-
- if directory:
- #copy the salome script on the remote server
- cmd="scp %s %s@%s:%s" % (tmp_script,user,machine,tmp_script)
- print "[ SCP ]",cmd
- os.system(cmd)
-
- return list_infiles, list_outfiles, tmp_script
-
-def main():
-
- mode,user,machine,port,directory,infiles,outfiles,script = parse_args()
-
- tmp_script=script
-
- if mode == "remote":
- list_infiles, list_outfiles, tmp_script = copy_files(user,machine,script,infiles,outfiles,directory)
-
- #################################################
- # Execution #
- #################################################
- if mode == "remote":
- print "[ REMOTE ]"
-
- # execute runSession from the remote SALOME application
- cmd="ssh %s@%s %s/runSession " % (user,machine,directory)
- if port:
- cmd=cmd+"-p %s "%port
- cmd = cmd +"python " + tmp_script
- print '[ SSH ] ' + cmd
- os.system(cmd)
-
- else:
- print "[ LOCAL ]"
-
- # execute runSession from the local SALOME application
- cmd="%s/runSession " % appli_local
- if machine:
- cmd=cmd+"-m %s "%machine
- if port:
- cmd=cmd+"-p %s "%port
- cmd = cmd +"python " + tmp_script
- print '[ SH ] ' + cmd
- os.system(cmd)
-
- #################################################
- # Get remote files and clean #
- #################################################
- if mode == "remote":
- temp_files=list_infiles+list_outfiles+[tmp_script]
-
- #get the outfiles
- for outfile in outfiles:
- remote_outfile=list_outfiles.pop(0)
- cmd="scp %s@%s:%s %s" %(user,machine,remote_outfile,outfile)
- print "[ SCP ] "+cmd
- os.system(cmd)
-
- #clean temporary files
- cmd="ssh %s@%s \\rm -f %s" % (user,machine," ".join(temp_files))
- print '[ SSH ] ' + cmd
- os.system(cmd)
- os.remove(tmp_script)
-
-if __name__ == '__main__':
- main()
+++ /dev/null
-#!/bin/bash
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-# Useful shell to run executable progs or shells under Salome env
-# Use it with args to run a program : runSession python -i myprog.py
-# Use it without args to run an interactive shell under Salome env
-
-
-###############################################
-############### IMPORTANT NOTE ################
-###############################################
-# The runSession script is obsolete. #
-# Please consider the new salome launcher. #
-###############################################
-
-
-APPLI_HOME=`dirname $0`
-
-NSPORT=last
-NSHOST=localhost
-
-usage()
-{
- echo "Connect to a SALOME session (local or remote)"
- echo ""
- echo "Usage: $(basename $0) [ -p PORT ] [ -m MACHINE ] [ -h ] [command]"
- echo ""
- echo " -p PORT : The port to connect to "
- echo " -m MACHINE : The machine to connect to "
- echo " -h : Print this message"
- echo " command : The command to execute in the SALOME session"
- echo ""
- echo "If the command is not given a shell is opened"
- echo "If PORT and MACHINE are not given, try to connect to the last active session on the local machine"
- echo "If PORT and MACHINE are given, try to connect to the remote session associated with PORT on MACHINE"
- echo "If MACHINE is not given, try to connect to the session associated to PORT on the local machine"
- echo "If PORT is not given, try to connect to the remote session associated to port 2810 on MACHINE"
- echo ""
-}
-
-while getopts 'm:p:h' OPTION
- do
- case $OPTION in
- m)NSHOST="$OPTARG" ;;
- p)NSPORT="$OPTARG" ;;
- h|?) usage
- exit 1 ;;
- esac
- done
-shift $(($OPTIND - 1))
-
-# --- retrieve APPLI path, relative to $HOME, set ${APPLI}
-
-export APPLI=`${APPLI_HOME}/getAppliPath.py`
-
-# --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...)
-
-. ${HOME}/${APPLI}/envd ${HOME}/${APPLI}
-
-#export OMNIORB_USER_PATH="${HOME}/.salomeConfig/USERS"
-export OMNIORB_USER_PATH="${HOME}/${APPLI}/USERS"
-
-# --- set the OMNIORB_CONFIG file and environment relative to this run of SALOME
-# Usage: writeConfigFile PORT HOST
-function writeConfigFile
-{
- if [ $# -ne 2 ]; then
- echo "Usage: $0 PORT HOST"
- return
- fi
- export NSPORT=$1
- export NSHOST=$2
-
- # Get (in bash) the configuration filename from (Python) ORBConfigFile return values
- RETURN_VALUES=$(${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python ${KERNEL_ROOT_DIR}/bin/salome/ORBConfigFile.py ${OMNIORB_USER_PATH} ${NSHOST} ${NSPORT} with_username=${USER})
- export OMNIORB_CONFIG=$(echo ${RETURN_VALUES} | cut -d' ' -f1)
-}
-
-
-if test "x${NSPORT}" == "xlast"; then
- #PORT is not given
- if test "x${NSHOST}" == "xlocalhost"; then
- #MACHINE and PORT are not given
- # --- set omniORB configuration to current session if any
- fileOmniConfig=${OMNIORB_USER_PATH}/.omniORB_${USER}_last.cfg
- if [ -f $fileOmniConfig ]; then
- export OMNIORB_CONFIG=${OMNIORB_USER_PATH}/.omniORB_${USER}_last.cfg
- # --- set environment variables for port and hostname of NamingService
- export NSHOST=`${KERNEL_ROOT_DIR}/bin/salome/NSparam.py host`
- export NSPORT=`${KERNEL_ROOT_DIR}/bin/salome/NSparam.py port`
- fi
- else
- #MACHINE is given PORT is not given
- writeConfigFile 2810 ${NSHOST}
- fi
-else
- #PORT is given
- if test "x${NSHOST}" == "xlocalhost"; then
- #MACHINE is not given PORT is given
- NSHOST=`hostname`
- fi
- writeConfigFile ${NSPORT} ${NSHOST}
-fi
-
-# --- invoke shell with or without args
-
-if [ $# -ne 0 ] ; then
- ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py -exec $*
-else
- ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/bash --rcfile ${HOME}/${APPLI}/.bashrc
-fi
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
)
FOREACH(tfile ${TEST_NAMES})
- SET(TEST_NAME SALOME_CONCURRENT_${tfile})
+ SET(TEST_NAME ${COMPONENT_NAME}_SALOME_CONCURRENT_${tfile})
ADD_TEST(${TEST_NAME} python ${tfile}.py)
- SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}")
+ SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}" TIMEOUT ${TIMEOUT})
ENDFOREACH()
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
)
FOREACH(tfile ${TEST_NAMES})
- SET(TEST_NAME SALOME_COMMAND_${tfile})
+ SET(TEST_NAME ${COMPONENT_NAME}_SALOME_COMMAND_${tfile})
ADD_TEST(${TEST_NAME} python ${tfile}.py)
- SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}")
+ SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}" TIMEOUT ${TIMEOUT})
ENDFOREACH()
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
SET(TEST_NAMES instances)
FOREACH(tfile ${TEST_NAMES})
- SET(TEST_NAME SALOME_INSTANCE_${tfile})
+ SET(TEST_NAME ${COMPONENT_NAME}_SALOME_INSTANCE_${tfile})
ADD_TEST(${TEST_NAME} python ${tfile}.py)
- SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}")
+ SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}" TIMEOUT ${TIMEOUT})
ENDFOREACH()
+++ /dev/null
-#!/bin/bash
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-
-###############################################
-############### IMPORTANT NOTE ################
-###############################################
-# The runSalome script is obsolete. #
-# Please consider the new salome launcher. #
-###############################################
-
-
-# **********************************************************
-# This file is used by m4 files in many modules to detect SALOME KERNEL.
-# Its initial purpose (starting salome) can be replaced by new salome command.
-# When definitively switching from autotools to Cmake, this file may be removed.
-# **********************************************************
-
-
-
-${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py $*
-
-
-
-
-# -----------------------------------------------------------------------------
-# examples:
-# ---------
-# $: ${KERNEL_ROOT_DIR}/bin/salome/runSalome
-#
-# - parameters for launching are taken from SalomeApp.xml;
-# - if the config file does not exist, it is created with default values.
-#
-# $: ${KERNEL_ROOT_DIR}/bin/salome/runSalome --modules=GEOM,SMESH,VISU,MED --embedded=registry,study,moduleCatalog --standalone=cppContainer --xterm --killall
-#
-# - parameters from command line supersede those from SalomeApp.xml
-#
-# Some CORBA servers can be launched in the SALOME_Session_Server's process
-# (embedded = same process) or in a separate process (standalone).
-# In above example, Registry, Study and Module Catalog servers are started
-# in the embedded mode; default C++ container (FactoryServer) is started in
-# the standalone mode.
-#
-# $: ${KERNEL_ROOT_DIR}/bin/salome/runSalome -h
-#
-# - print help on the runSalome command
-# -----------------------------------------------------------------------------
-#
-# The -i option starts Python interpreter after launching SALOME session
-# (see runSalome.py script).
-# Logger server is optional.
-#
-# -----------------------------------------------------------------------------
p.start()
p.join()
except ImportError:
+ # :TODO: should be declared obsolete
from killSalome import killAllPorts
killAllPorts()
pass
#
#
-def searchFreePort_withoutPortManager(args={}, save_config=1, use_port=None):
- # :NOTE: Under windows:
- # netstat options -l and -t are unavailable
- # grep command is unavailable
- from subprocess import Popen, PIPE
- (stdout, stderr) = Popen(['netstat','-an'], stdout=PIPE).communicate()
- import StringIO
- buf = StringIO.StringIO(stdout)
- ports = buf.readlines()
-
- #
- def portIsUsed(port, data):
- import re
- regObj = re.compile( ".*tcp.*:([0-9]+).*:.*listen", re.IGNORECASE );
- for item in data:
- try:
- p = int(regObj.match(item).group(1))
- if p == port: return True
- pass
- except:
- pass
- pass
- return False
- #
-
- if use_port:
- print "Check if port can be used: %d" % use_port,
- if not portIsUsed(use_port, ports):
- print "- OK"
- __setup_config(use_port, args, save_config)
- return
- else:
- print "- KO: port is busy"
- pass
- #
-
- print "Searching for a free port for naming service:",
- #
-
- NSPORT=2810
- limit=NSPORT+100
- #
-
- while 1:
- if not portIsUsed(NSPORT, ports):
- print "%s - OK"%(NSPORT)
- __setup_config(NSPORT, args, save_config)
- break
- print "%s"%(NSPORT),
- if NSPORT == limit:
- msg = "\n"
- msg += "Can't find a free port to launch omniNames\n"
- msg += "Try to kill the running servers and then launch SALOME again.\n"
- raise RuntimeError, msg
- NSPORT=NSPORT+1
- pass
- #
-#
-
def searchFreePort_withPortManager(queue, args={}, save_config=1, use_port=None):
from PortManager import getPort
port = getPort(use_port)
p.join() # this blocks until the process terminates
except ImportError:
- searchFreePort_withoutPortManager(args, save_config, use_port)
- __savePortToFile(args)
+ raise Exception('PortManager module not found')
#
See \subpage SALOME_Application to define your own configuration of %SALOME and run it
on one or several computers. This is the recommended way of configuration.
-# <b>How to launch %SALOME</b>:
- - Using \b NEW \subpage salome_command, based on \ref SALOME_Application.
- - In a %SALOME application, see \ref SALOME_Application.
- - Using \c runSalome script, see \subpage running_salome_page
+ - Using the python \subpage salome_command.
-# <b>How to use KERNEL services in Python scripts</b>\n
The %SALOME KERNEL offers a list of services available in Python. See \subpage KERNEL_Services.
-# <b>How to use KERNEL services from a C++ context</b>\n
-/*!\r
-\r
-\page running_salome_page Running Salome\r
-\r
-There are three ways to run %SALOME:\r
-\r
-\section S1_run_sal Using the "salome" command\r
-\r
-%A simply %SALOME application is defined by :\r
-- a set of modules (GEOM, SMESH, YACS, ...)\r
-- a profile: set of informatic resources (images, documentation, tests...) binding the modules together\r
-- "salome" command is a launcher as a python script that creates a context (set of environment variables usable by the SALOME modules) and runs an instance of SALOME, for more details see \ref salome_command.\r
-\r
-How to generation of a profile of an application ?\r
-\r
-The user can generate a default profile for its application using the following command:\r
-\code\r
-python ${KERNEL_ROOT_DIR}/bin/salome/app-quickstart.py --prefix=<generation directory> --name=<application's name> --modules=<list,of,modules>\r
-\endcode\r
-\r
-Likely, the user would like to personalize its application's profile. Then, the profile\r
-can be compiled using the standard cmake procedure:\r
-\r
-\code\r
-cmake\r
-make\r
-make install\r
-\endcode\r
-\r
-This profile can be used within a python launcher - like the \subpage salome_command - by setting\r
-context variable <b>SalomeAppConfig</b> to the path where the profile is installed.\r
-\r
-\section S2_run_sal Using Salome Application Concept approach\r
-\r
-For more details see \ref SALOME_Application.\r
-\r
-\section S3_run_sal Using "runSalome" script supplied with SALOME KERNEL module distribution\r
-\r
-To launch %SALOME using \c %runSalome script, you have first to\r
-set-up proper environment for %SALOME. If you installed %SALOME using\r
-%SALOME Installation Wizard (Linux), you can use \c salome.sh or\r
-\c salome.csh script (that is located in the \c KERNEL_<version>\r
-directory of your %SALOME installation), for example:\r
-\r
-\code\r
-cd /home/user/salome_6.5.0/KERNEL_6.5.0\r
-source salome.csh\r
-\endcode\r
-\r
-Launch %SALOME session using the \c %runSalome script located\r
-in the \c SALOME/KERNEL/bin/salome directory:\r
-\r
-\code\r
-runSalome [options] [STUDY_FILE] [PYTHON_FILE [PYTHON_FILE ...]]\r
-\endcode\r
-\r
-Optionally, you can specify in the command line:\r
-- Study (document) file to be opened in %SALOME session passing;\r
-- One or more Python scripts to be executed after %SALOME\r
- start-up. Python scripts will be executed in the new or opened study\r
- in the order they appear in the command line.\r
-\r
-The \c %runSalome script supports large set of options that allow\r
-specifying the way to launch %SALOME session. Complete description of\r
-all options can be obtained using \c --help or -h option:\r
-\r
-\code\r
-runSalome --help\r
-\endcode\r
-\r
-Here below is a description of most important options:\r
-\r
-- \c --help or \c -h\r
-\r
-Print detail help information on the \c %runSalome script.\r
-\r
-- \c --version\r
-\r
-Print version of %SALOME platform.\r
-\r
-- \c --gui or \c -g\r
-\r
-Launch %SALOME sesssion in GUI mode (with GUI desktop).\r
-\r
-- \c --terminal or \c -t\r
-\r
-Launch %SALOME session in terminal mode (without GUI).\r
-\r
-- \c --resources=<file> or \c -r \c <file>\r
-\r
-Parse application settings from the <file> instead of default resource\r
-file. Default resource file is situated in user's home directory; for\r
-example, for %SALOME version 6.5.0, the file is ${HOME}/.config/salome/.SalomeApprc.6.5.0 \r
-\r
-- \c --modules=module1,module2,... or \c -m=module1,module2,...\r
-\r
-Specify the list of modules which will be used in the %SALOME session\r
-being launched. Note, that list of modules is separated be comma\r
-symbols, with no any spaces.\r
-\r
-- \c --xterm or \c -x\r
-\r
-The servers open in separate terminal window and log messages are displayed in this window.\r
-\r
-- <code>--embedded=registry,study,moduleCatalog,cppContainer/</code> or\r
- <code>-e=registry,study,moduleCatalog,cppContainer</code>\r
-\r
-Run listed %SALOME servers in the GUI embedded mode (default value is\r
-<code>registry,study,moduleCatalog,cppContainer</code>). Note that logger\r
-server cannot be embedded to GUI. Note, that this option implies running %SALOME in GUI mode (\c -g\r
-option); in terminal mode all servers are running in standalone mode.\r
-\r
-- <code>--standalone=registry,study,moduleCatalog,cppContainerr</code> or\r
- <code>-s=registry,study,moduleCatalog,cppContainer</code>\r
-\r
-Standalone CORBA servers (default: none).\r
-\r
-- \c --portkill or \c -p\r
-\r
-Kill %SALOME session launched with the current port.\r
-\r
-- \c --killall or \c -k\r
-\r
-Kill (stop) all running %SALOME sessions before launching new session.\r
-\r
-- \c --splash=<1/0> or \c -z <1/0>\r
-\r
-Use 1 to display splash screen [default] at start-up, 0 to disable\r
-splash screen. This option is ignored in the terminal mode.\r
-\r
-- \c --pinter\r
-\r
-Launch with interactive Python console.\r
-\r
-- <code>--interp=n</code> or <code>-i=n</code>\r
-\r
-Number of additional Python interpreters to open, with session\r
-environment propely set-up.\r
-\r
-*/\r
+/*!
+
+\page running_salome_page Running Salome
+
+To run %SALOME, use the python \ref salome_command.
+
+Using this command, you DO NOT need to first set-up proper environment for %SALOME; all is done by the command itself.
+
+Launch %SALOME session using the following command:
+
+\code
+salome start [options] [STUDY_FILE] [PYTHON_FILE [args] [PYTHON_FILE [args]...]]
+\endcode
+
+Optionally, you can specify in the command line:
+- Study (document) file to be opened in %SALOME session passing;
+- One or more Python scripts to be executed after %SALOME
+ start-up. Python scripts will be executed in the new or opened study
+ in the order they appear in the command line. Passing args to these scripts
+ is possible but require a specific \c args: syntax (see \ref salome_command).
+
+This command supports large set of options that allow
+specifying the way to launch %SALOME session. Complete description of
+all options can be obtained using \c --help or -h option:
+
+\code
+salome start --help
+\endcode
+
+Here below is a description of most important options:
+
+- \c --help or \c -h
+
+Print detail help information on the command.
+
+- \c --version
+
+Print version of %SALOME platform.
+
+- \c --gui or \c -g
+
+Launch %SALOME sesssion in GUI mode (with GUI desktop).
+
+- \c --terminal or \c -t
+
+Launch %SALOME session in terminal mode (without GUI).
+
+- \c --resources=<file> or \c -r \c <file>
+
+Parse application settings from the <file> instead of default resource
+file. Default resource file is situated in user's home directory; for
+example, for %SALOME version 6.5.0, the file is ${HOME}/.config/salome/.SalomeApprc.6.5.0
+
+- \c --modules=module1,module2,... or \c -m=module1,module2,...
+
+Specify the list of modules which will be used in the %SALOME session
+being launched. Note, that list of modules is separated be comma
+symbols, with no any spaces.
+
+- \c --xterm or \c -x
+
+The servers open in separate terminal window and log messages are displayed in this window.
+
+- <code>--embedded=registry,study,moduleCatalog,cppContainer/</code> or
+ <code>-e=registry,study,moduleCatalog,cppContainer</code>
+
+Run listed %SALOME servers in the GUI embedded mode (default value is
+<code>registry,study,moduleCatalog,cppContainer</code>). Note that logger
+server cannot be embedded to GUI. Note, that this option implies running %SALOME in GUI mode (\c -g
+option); in terminal mode all servers are running in standalone mode.
+
+- <code>--standalone=registry,study,moduleCatalog,cppContainerr</code> or
+ <code>-s=registry,study,moduleCatalog,cppContainer</code>
+
+Standalone CORBA servers (default: none).
+
+- \c --portkill or \c -p
+
+Kill %SALOME session launched with the current port.
+
+- \c --killall or \c -k
+
+Kill (stop) all running %SALOME sessions before launching new session.
+
+- \c --splash=<1/0> or \c -z <1/0>
+
+Use 1 to display splash screen [default] at start-up, 0 to disable
+splash screen. This option is ignored in the terminal mode.
+
+- \c --pinter
+
+Launch with interactive Python console.
+
+- <code>--interp=n</code> or <code>-i=n</code>
+
+Number of additional Python interpreters to open, with session
+environment propely set-up.
+
+*/
\section S1_sal_appl General principles
-%A %SALOME application is defined by a set of modules (GEOM, SMESH, ASTER...). %A %SALOME application
-lives in an application directory.
-%A %SALOME application is a virtual installation of %SALOME in the application directory
-(bin, lib, doc, share...), with, for each file (executable, script, data,
-library, resources...), symbolic links to the actual files.
+%A %SALOME application is defined by :
+- a set of modules (GEOM, SMESH, ASTER...)
+- a profile: set of informatic resources (images, documentation, tests...) binding the modules together.
+- a launcher: python script that creates a context (set of environment variables usable by the SALOME modules) and runs an instance of SALOME.
+
%A %SALOME User can define several %SALOME Applications. These applications are
runnable from the same user account. These applications may share the same
password (key exchange for ssh). Account may be different on each
computer.
-\section S2_sal_appl Application Directory
+\section S2_sal_appl Generation of a profile
+
+The user can generate a default profile for its application using the following command:
+\code
+python ${KERNEL_ROOT_DIR}/bin/salome/app-quickstart.py --prefix=<generation directory> --name=<application's name> --modules=<list,of,modules>
+\endcode
+
+Likely, the user would like to personalize its application's profile. Then, the profile
+can be compiled using the standard cmake procedure:
+
+\code
+cmake
+make
+make install
+\endcode
+
+This profile can be used within a python launcher - like the \subpage salome_command - by setting
+context variable <b>SalomeAppConfig</b> to the path where the profile is installed.
+
+
+\section S3_sal_appl Deprecated Application Directory
First, the user must create a %SALOME application configuration file by modifying a
copy of ${KERNEL_ROOT_DIR}/bin/salome/config_appli.xml.
For a distributed application (several computers), one must copy and adapt
CatalogResources.xml from ${KERNEL_ROOT_DIR}/bin/salome/appliskel (see below).
-\section S3_sal_appl General rules
+\section S4_sal_appl Deprecated general rules
The application directory must be created on each computer of the application.
The easiest way is to use the same relative path (to ${HOME}) on each computer.
</li>
</ol>
-\section S4_sal_appl Examples of use
+\section S5_sal_appl Deprecated examples of use
<ol>
<li>
\section handling_concurrency Handling concurrent starts
A SALOME instance uses a dedicated TCP port number on which the CORBA name server of each SALOME application will connect. This refers to a technical solution that allows multiple software components belonging to the same application to communicate with each other. This approach is a standard used when multiple applications are running at the same time (components should not interfere with each other), and when application components can be distributed across multiple machines.
-Each SALOME application owns a specific port number. This port is determined automatically when application starts. When multiple applications are started at the same time, assigning a number to each port could be conflicting, and the same port could be assigned to several applications. To prevent from such a situation, a Python object named \c Portmanager has been implemented (Linux only). In SALOME 7, this object is available when activating a specific compilation flag of KERNEL module:
-- For gcc: -DWITH_PORTMANAGER
-- With CMake: SALOME_USE_PORTMANAGER=ON
+Each SALOME application owns a specific port number. This port is determined automatically when application starts. When multiple applications are started at the same time, assigning a number to each port could be conflicting, and the same port could be assigned to several applications. To prevent from such a situation, a Python object named \c Portmanager has been implemented. This object has been introduced in SALOME 7 as an optional tool, then evaluated on Linux and Windows. In SALOME 8, this object becomes the standard.
-Since SALOME 7.5.0 this flag is switched ON by default.
Several instances can be safely started concurrently. For example in an automated process, calling several times the following commands (WORK_DIR variable changes at each call):
\code
salome start -t --ns-port-log=${WORK_DIR}/session.log
when the job type is "yacs_file". It gives the number of seconds
between two updates of the state dump file. There will be no dump file
if this parameter is missing or if its value is less than 1.
+ - YACSDriverOptions : options of the driver command when the job type is
+ "yacs_file".
+ - LoalLevelerJobType : LL_JOBTYPE.
*/
Engines::ParameterList specific_parameters;
FindSalomeOmniORB.cmake
FindSalomeOmniORBPy.cmake
FindSalomePThread.cmake
-# FindSalomePython.cmake
FindSalomePythonLibs.cmake
FindSalomePythonInterp.cmake
FindSalomeNumPySciPy.cmake
#
IF(NOT CAS_FIND_QUIETLY)
- MESSAGE(STATUS "Looking for OpenCascade (CAS) ...")
+ MESSAGE(STATUS "Looking for Open CASCADE Technology ...")
ENDIF()
SET(_CAS_VERSION_FILE_NAME Standard_Version.hxx)
# Include directories:
-FIND_PATH(CAS_INCLUDE_DIRS ${_CAS_VERSION_FILE_NAME} PATH_SUFFIXES inc)
-FIND_FILE(CAS_VERSION_FILE ${_CAS_VERSION_FILE_NAME} PATH_SUFFIXES inc)
+FIND_PATH(CAS_INCLUDE_DIRS ${_CAS_VERSION_FILE_NAME} PATH_SUFFIXES include/opencascade)
+FIND_FILE(CAS_VERSION_FILE ${_CAS_VERSION_FILE_NAME} PATH_SUFFIXES include/opencascade)
+IF(CAS_INCLUDE_DIRS)
+ SET(CAS_UPCOUNT 2)
+ELSE()
+ FIND_PATH(CAS_INCLUDE_DIRS ${_CAS_VERSION_FILE_NAME} PATH_SUFFIXES include inc)
+ FIND_FILE(CAS_VERSION_FILE ${_CAS_VERSION_FILE_NAME} PATH_SUFFIXES include inc)
+ENDIF()
MARK_AS_ADVANCED(CAS_VERSION_FILE)
SET(CAS_VERSION_DEVELOPMENT 0)
SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DHAVE_CONFIG_H")
ENDIF()
-SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DOCC_CONVERT_SIGNALS")
-
# Test for 64 bit machine:
IF(CMAKE_SIZEOF_VOID_P STREQUAL 8)
SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -D_OCC64")
ENDIF()
ENDIF()
-FIND_LIBRARY(CAS_FWOSPlugin FWOSPlugin )
-FIND_LIBRARY(CAS_TKBin TKBin )
-FIND_LIBRARY(CAS_TKBinL TKBinL )
-FIND_LIBRARY(CAS_TKBinTObj TKBinTObj )
-FIND_LIBRARY(CAS_TKBinXCAF TKBinXCAF )
-FIND_LIBRARY(CAS_TKBO TKBO )
-FIND_LIBRARY(CAS_TKBool TKBool )
-FIND_LIBRARY(CAS_TKBRep TKBRep )
-FIND_LIBRARY(CAS_TKCAF TKCAF )
-FIND_LIBRARY(CAS_TKCDF TKCDF )
-FIND_LIBRARY(CAS_TKernel TKernel )
-FIND_LIBRARY(CAS_TKFeat TKFeat )
-FIND_LIBRARY(CAS_TKFillet TKFillet )
-FIND_LIBRARY(CAS_TKG2d TKG2d )
-FIND_LIBRARY(CAS_TKG3d TKG3d )
-FIND_LIBRARY(CAS_TKGeomAlgo TKGeomAlgo )
-FIND_LIBRARY(CAS_TKGeomBase TKGeomBase )
-FIND_LIBRARY(CAS_TKHLR TKHLR )
-FIND_LIBRARY(CAS_TKIGES TKIGES )
-FIND_LIBRARY(CAS_TKLCAF TKLCAF )
-FIND_LIBRARY(CAS_TKMath TKMath )
-FIND_LIBRARY(CAS_TKMesh TKMesh )
-FIND_LIBRARY(CAS_TKMeshVS TKMeshVS )
+FIND_LIBRARY(CAS_FWOSPlugin FWOSPlugin PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKBin TKBin PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKBinL TKBinL PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKBinTObj TKBinTObj PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKBinXCAF TKBinXCAF PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKBO TKBO PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKBool TKBool PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKBRep TKBRep PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKCAF TKCAF PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKCDF TKCDF PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKernel TKernel PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKFeat TKFeat PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKFillet TKFillet PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKG2d TKG2d PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKG3d TKG3d PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKGeomAlgo TKGeomAlgo PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKGeomBase TKGeomBase PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKHLR TKHLR PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKIGES TKIGES PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKLCAF TKLCAF PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKMath TKMath PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKMesh TKMesh PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKMeshVS TKMeshVS PATH_SUFFIXES lib lin64/gcc/lib bin)
IF(CAS_VERSION_STR VERSION_LESS "6.9.1")
- FIND_LIBRARY(CAS_TKNIS TKNIS )
+ FIND_LIBRARY(CAS_TKNIS TKNIS PATH_SUFFIXES lib lin64/gcc/lib bin)
ENDIF()
-FIND_LIBRARY(CAS_TKOffset TKOffset )
-FIND_LIBRARY(CAS_TKOpenGl TKOpenGl )
-FIND_LIBRARY(CAS_TKPrim TKPrim )
-FIND_LIBRARY(CAS_TKService TKService )
-FIND_LIBRARY(CAS_TKShHealing TKShHealing )
-FIND_LIBRARY(CAS_TKSTEP TKSTEP )
-FIND_LIBRARY(CAS_TKSTEP209 TKSTEP209 )
-FIND_LIBRARY(CAS_TKSTEPAttr TKSTEPAttr )
-FIND_LIBRARY(CAS_TKSTEPBase TKSTEPBase )
-FIND_LIBRARY(CAS_TKSTL TKSTL )
-FIND_LIBRARY(CAS_TKTObj TKTObj )
-FIND_LIBRARY(CAS_TKTopAlgo TKTopAlgo )
-FIND_LIBRARY(CAS_TKV3d TKV3d )
-FIND_LIBRARY(CAS_TKVRML TKVRML )
-FIND_LIBRARY(CAS_TKXCAF TKXCAF )
-FIND_LIBRARY(CAS_TKXDEIGES TKXDEIGES )
-FIND_LIBRARY(CAS_TKXDESTEP TKXDESTEP )
-FIND_LIBRARY(CAS_TKXMesh TKXMesh )
-FIND_LIBRARY(CAS_TKXml TKXml )
-FIND_LIBRARY(CAS_TKXmlL TKXmlL )
-FIND_LIBRARY(CAS_TKXmlTObj TKXmlTObj )
-FIND_LIBRARY(CAS_TKXmlXCAF TKXmlXCAF )
-FIND_LIBRARY(CAS_TKXSBase TKXSBase )
+FIND_LIBRARY(CAS_TKOffset TKOffset PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKOpenGl TKOpenGl PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKPrim TKPrim PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKService TKService PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKShHealing TKShHealing PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKSTEP TKSTEP PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKSTEP209 TKSTEP209 PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKSTEPAttr TKSTEPAttr PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKSTEPBase TKSTEPBase PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKSTL TKSTL PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKTObj TKTObj PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKTopAlgo TKTopAlgo PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKV3d TKV3d PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKVRML TKVRML PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKXCAF TKXCAF PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKXDEIGES TKXDEIGES PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKXDESTEP TKXDESTEP PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKXMesh TKXMesh PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKXml TKXml PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKXmlL TKXmlL PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKXmlTObj TKXmlTObj PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKXmlXCAF TKXmlXCAF PATH_SUFFIXES lib lin64/gcc/lib bin)
+FIND_LIBRARY(CAS_TKXSBase TKXSBase PATH_SUFFIXES lib lin64/gcc/lib bin)
IF(CAS_VERSION_STR VERSION_LESS "7.0")
- FIND_LIBRARY(CAS_PTKernel PTKernel )
- FIND_LIBRARY(CAS_TKPCAF TKPCAF )
- FIND_LIBRARY(CAS_TKPLCAF TKPLCAF )
- FIND_LIBRARY(CAS_TKPShape TKPShape )
- FIND_LIBRARY(CAS_TKShapeSchema TKShapeSchema )
- FIND_LIBRARY(CAS_TKStdLSchema TKStdLSchema )
- FIND_LIBRARY(CAS_TKStdSchema TKStdSchema )
- FIND_LIBRARY(CAS_TKXCAFSchema TKXCAFSchema )
+ FIND_LIBRARY(CAS_PTKernel PTKernel PATH_SUFFIXES lib lin64/gcc/lib bin)
+ FIND_LIBRARY(CAS_TKPCAF TKPCAF PATH_SUFFIXES lib lin64/gcc/lib bin)
+ FIND_LIBRARY(CAS_TKPLCAF TKPLCAF PATH_SUFFIXES lib lin64/gcc/lib bin)
+ FIND_LIBRARY(CAS_TKPShape TKPShape PATH_SUFFIXES lib lin64/gcc/lib bin)
+ FIND_LIBRARY(CAS_TKShapeSchema TKShapeSchema PATH_SUFFIXES lib lin64/gcc/lib bin)
+ FIND_LIBRARY(CAS_TKStdLSchema TKStdLSchema PATH_SUFFIXES lib lin64/gcc/lib bin)
+ FIND_LIBRARY(CAS_TKStdSchema TKStdSchema PATH_SUFFIXES lib lin64/gcc/lib bin)
+ FIND_LIBRARY(CAS_TKXCAFSchema TKXCAFSchema PATH_SUFFIXES lib lin64/gcc/lib bin)
ENDIF()
SET(CAS_KERNEL ${CAS_TKernel} ${CAS_TKMath})
CAS_TKXmlXCAF CAS_TKXSBase CAS_XCAFPlugin CAS_XmlLPlugin CAS_XmlPlugin CAS_XmlTObjPlugin
CAS_XmlXCAFPlugin CAS_Xmu)
-IF(CAS_StdLPlugin)
- SET(CAS_STDPLUGIN StdPlugin)
+
+IF(CAS_VERSION_STR VERSION_LESS "7.0")
+ SET(CAS_STDPLUGIN TKStdSchema)
ELSE()
- IF(CAS_TKStdSchema)
- SET(CAS_STDPLUGIN TKStdSchema)
- ENDIF()
+ SET(CAS_STDPLUGIN TKStd)
+ SET(CAS_BINPLUGIN TKBin)\r
ENDIF()
IF(CAS_FOUND)
# Note the double de-reference of "referenceVariable":
SET(_tmp_ROOT_DIR "${${referenceVariable}}")
ENDIF()
- IF(${upCount})
- FOREACH(_unused RANGE 1 ${upCount})
+ # Up cound can be reset by detection procedure
+ SET(_upCount ${upCount})
+ IF(DEFINED ${pkg_UC}_UPCOUNT)
+ SET(_upCount ${${pkg_UC}_UPCOUNT})
+ ENDIF()
+ IF(${_upCount})
+ FOREACH(_unused RANGE 1 ${_upCount})
GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${_tmp_ROOT_DIR}" PATH)
ENDFOREACH()
ENDIF()
ENDIF()
ENDIF()
-IF(NOT DEFINED NO_CXX11_SUPPORT)
- SET(NO_CXX11_SUPPORT ON)
-ENDIF()
IF(NOT NO_CXX11_SUPPORT)
# C++11 support
INCLUDE(CheckCXXCompilerFlag)
pass
# --
newlines.append("""
- set(VERSION 7.8.0)
- set(SHORT_VERSION 7.8)
- set(XVERSION 0x070800)
+ set(VERSION 8.0.0)
+ set(SHORT_VERSION 8.0)
+ set(XVERSION 0x080000)
set(VERSION_DEV 0)
""")
pass
MESSAGE(FATAL_ERROR "We absolutely need a Salome GUI, please define GUI_ROOT_DIR")
ENDIF(EXISTS ${GUI_ROOT_DIR})
-# Qt4
-FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui)
-INCLUDE(${QT_USE_FILE})
+# Qt
+IF(NOT SALOME_GUI_BUILD_WITH_QT5)
+ FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui)
+ELSE()
+ FIND_PACKAGE(SalomeQt5 REQUIRED)
+ENDIF()
# Directories
# (default values taken from KERNEL)
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
+INCLUDE(UseQtExt)
# --- resources ---
# --- rules ---
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_[NAME_OF_APPLICATION]_PROFILE_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_[NAME_OF_APPLICATION]_PROFILE_INSTALL_RES_DATA}")
#include <Standard_Version.hxx>
+#include <Standard_DefineHandle.hxx>
+
//
// NOTE: Since version 6.7.0 OCC_VERSION_DEVELOPMENT macro in the Standard_Version.hxx
// points to the development status of the OCCT version: for example "dev", "alpha",
# endif
#endif
+// temporary code for backward compatibility with OCCT
+#if OCC_VERSION_MAJOR < 7
+ #define OCCT_DEFINE_STANDARD_RTTIEXT(C1,C2) DEFINE_STANDARD_RTTI(C1)
+ #define OCCT_IMPLEMENT_STANDARD_RTTIEXT(C1,C2) \
+ IMPLEMENT_STANDARD_HANDLE(C1,C2) \
+ IMPLEMENT_STANDARD_RTTIEXT(C1,C2)
+#else
+ #define OCCT_DEFINE_STANDARD_RTTIEXT(C1,C2) DEFINE_STANDARD_RTTIEXT(C1,C2)
+ #define OCCT_IMPLEMENT_STANDARD_RTTIEXT(C1,C2) IMPLEMENT_STANDARD_RTTIEXT(C1,C2)
+#endif
+
#endif // BASICS_OCCTVERSION_HXX
#ifndef WIN32
#include <sys/time.h>
#else
-#include <winsock2.h>
#include <windows.h>
#pragma comment(lib,"winmm.lib")
#endif
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
IF(NOT WIN32)
- ADD_TEST(KernelHelpers python ${SALOME_TEST_DRIVER} ${TIMEOUT} TestKernelHelpers.py)
- SET_TESTS_PROPERTIES(KernelHelpers PROPERTIES
- LABELS "${COMPONENT_NAME}"
- ENVIRONMENT "LD_LIBRARY_PATH=${KERNEL_TEST_LIB}:$ENV{LD_LIBRARY_PATH}"
- # TIMEOUT 500
+ SET(TEST_NAME ${COMPONENT_NAME}_KernelHelpers)
+ ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} TestKernelHelpers.py)
+ SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES
+ LABELS "${COMPONENT_NAME}"
+ ENVIRONMENT "LD_LIBRARY_PATH=${KERNEL_TEST_LIB}:$ENV{LD_LIBRARY_PATH}"
+ # TIMEOUT 500
)
# /!\ DO NOT SET TIMEOUT PROPERTY IF USING ${SALOME_TEST_DRIVER}
# BUT PASS TIMEOUT VALUE TO THE DRIVER
#ifdef WIN32
# include <io.h>
#endif
-BatchTest::BatchTest(const Engines::ResourceDefinition& batch_descr)
+BatchTest::BatchTest(const Engines::ResourceDefinition& batch_descr)
{
#ifdef WITH_LIBBATCH
_batch_descr = batch_descr;
BatchTest::test()
{
bool rtn = false;
- INFOS(std::endl
+ INFOS(std::endl
<< "--- Testing batch Machine :" << std::endl
<< "--- Name : " << _batch_descr.hostname << std::endl
<< "--- hostname : " << _batch_descr.hostname << std::endl
<< "--- Submit mpi job : " << result_jobsubmit_mpi << std::endl
<< "--- Application : " << result_appli << std::endl
);
-
- if (result_connection == "OK" &&
+
+ if (result_connection == "OK" &&
result_filecopy == "OK" &&
result_getresult == "OK" &&
result_jobsubmit_simple == "OK" &&
result_jobsubmit_mpi == "OK" &&
result_appli == "OK")
rtn = true;
-
+
return rtn;
}
command = "scp";
if(protocol == "rsh")
command = "rcp";
- command += " " + username + "@" + hostname + ":" + home
+ command += " " + username + "@" + hostname + ":" + home
+ "/" + _base_filename + " " + _test_filename + "_copy";
// Test
result += oss.str();
return result;
}
-
+
// Compare files
std::ifstream src_file(_test_filename.c_str());
if (!src_file)
return result;
}
-std::string
-BatchTest::test_jobsubmit_simple()
+std::string
+BatchTest::test_jobsubmit_simple()
{
int status;
std::string home;
}
std::getline(file_job, jobid);
file_job.close();
-
+
// Wait the end of the job
command = protocol + " " + username + "@" + hostname + " qstat -f " + jobid + " > " + file_job_name;
bool stop = false;
- while (!stop)
+ while (!stop)
{
status = system(command.c_str());
if(status && status != 153 && status != 256*153)
command = "scp";
if(protocol == "rsh")
command = "rcp";
- command += " "
+ command += " "
+ username + "@" + hostname + ":" + home + "/" + _date + "_simple* /tmp";
status = system(command.c_str());
if(status) {
result += oss.str();
return result;
}
-
+
// Test results
std::string normal_input;
std::string file_normal_name = "/tmp/" + _date + "_simple_output.log";
return result;
}
-std::string
-BatchTest::test_jobsubmit_mpi()
+std::string
+BatchTest::test_jobsubmit_mpi()
{
#ifdef WITH_LIBBATCH
int status;
}
std::getline(file_job, jobid);
file_job.close();
-
+
// Wait the end of the job
command = protocol + " " + username + "@" + hostname + " qstat -f " + jobid + " > " + file_job_name;
bool stop = false;
- while (!stop)
+ while (!stop)
{
status = system(command.c_str());
if(status && status != 153 && status != 256*153)
command = "scp";
if(protocol == "rsh")
command = "rcp";
- command += " "
+ command += " "
+ username + "@" + hostname + ":" + home + "/" + _date + "_mpi* /tmp";
status = system(command.c_str());
if(status) {
result += oss.str();
return result;
}
-
+
// Test results
std::string normal_input;
std::string file_normal_name = "/tmp/" + _date + "_mpi_output.log";
return result;
}
result = "OK";
- return result;
+ return result;
#else
throw LauncherException("Method BatchTest::test_jobsubmit_mpi is not available "
"(libBatch was not present at compilation time)");
#endif
}
-std::string
+std::string
BatchTest::test_appli()
{
int status;
std::string username = _batch_descr.username.in();
std::string protocol = _batch_descr.protocol.in();
std::string applipath = _batch_descr.applipath.in();
-
+
// Getting home directory
std::string rst = get_home(&home);
if(rst != "") {
std::ofstream file_appli;
file_appli.open(_test_file_appli.c_str(), std::ofstream::out);
file_appli << "#!/bin/bash\n"
- << "if [ -f " << applipath << "/runAppli ]\n"
+ << "if [ -f " << applipath << "/salome ]\n"
<< "then\n"
<< " echo OK\n"
<< "else\n"
}
// Launch test
- command = protocol + " " + username + "@" + hostname
- + " sh " + home + "/" + _base_filename + "_appli_test > "
+ command = protocol + " " + username + "@" + hostname
+ + " sh " + home + "/" + _base_filename + "_appli_test > "
+ _test_filename + "_appli_test_result";
status = system(command.c_str());
}
std::getline(file_appli_result, rst_appli);
file_appli_result.close();
-
+
if (rst_appli != "OK")
{
result += "Error checking application on remote host ! result = " + rst;
std::string protocol = _batch_descr.protocol.in();
std::string file_home_name = _test_filename + "_home";
- command = protocol + " " + username + "@" + hostname + " 'echo $HOME' > " + file_home_name;
+ command = protocol + " " + username + "@" + hostname + " 'echo $HOME' > " + file_home_name;
status = system(command.c_str());
if(status) {
std::ostringstream oss;
{
_job_type = "yacs_file";
_dumpState = -1;
+ _yacsDriverOptions = "";
}
Launcher::Job_YACSFile::~Job_YACSFile() {}
void
Launcher::Job_YACSFile::addJobTypeSpecificScript(std::ofstream & launch_script_stream)
{
- launch_script_stream << _resource_definition.AppliPath << "/salome shell -p \"$appli_port\" driver args:-k,\"$appli_port\"," << _job_file_name_complete;
+ launch_script_stream << _resource_definition.AppliPath << "/salome shell -p \"$appli_port\" -- driver -k\"$appli_port\" " << _job_file_name_complete;
if (_dumpState > 0)
- launch_script_stream << ",--dump=" << _dumpState;
+ launch_script_stream << " --dump=" << _dumpState;
+ if(not _yacsDriverOptions.empty())
+ launch_script_stream << " " << _yacsDriverOptions ;
launch_script_stream << " > logs/yacs_" << _launch_date << ".log 2>&1" << std::endl;
}
if (!(iss >> _dumpState))
throw LauncherException("Specific parameter EnableDumpYACS is not correctly defined: it should be an integer. Value given is " + user_value);
}
+
+ it = _specific_parameters.find("YACSDriverOptions");
+ if (it != _specific_parameters.end())
+ {
+ // Decode info
+ _yacsDriverOptions = it->second;
+ }
}
protected:
int _dumpState;
+ std::string _yacsDriverOptions;
};
}
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
IF(NOT WIN32)
- ADD_TEST(SalomeLauncher python ${SALOME_TEST_DRIVER} ${TIMEOUT} test_launcher.py)
- SET_TESTS_PROPERTIES(SalomeLauncher PROPERTIES LABELS "${COMPONENT_NAME}"
+ SET(TEST_NAME ${COMPONENT_NAME}_Launcher)
+ ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} test_launcher.py)
+ SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}"
# TIMEOUT 500
)
# /!\ DO NOT SET TIMEOUT PROPERTY IF USING ${SALOME_TEST_DRIVER}
self.verifyFile(os.path.join(job_params.result_directory, "result.txt"),
"expected")
+ ##############################
+ # test of yacs job type using "--init_port" driver option
+ ##############################
+ def test_yacsopt(self):
+ yacs_path = os.getenv("YACS_ROOT_DIR", "")
+ if not os.path.isdir(yacs_path):
+ self.skipTest("Needs YACS module to run. Please define YACS_ROOT_DIR.")
+
+ case_test_dir = os.path.join(TestCompo.test_dir, "yacs_opt")
+ os.mkdir(case_test_dir)
+
+ # job script
+ script_text = """<?xml version='1.0' encoding='iso-8859-1' ?>
+<proc name="myschema">
+ <property name="DefaultStudyID" value="1"/>
+ <type name="string" kind="string"/>
+ <type name="bool" kind="bool"/>
+ <type name="double" kind="double"/>
+ <type name="int" kind="int"/>
+ <container name="DefaultContainer">
+ <property name="container_kind" value="Salome"/>
+ <property name="attached_on_cloning" value="0"/>
+ <property name="container_name" value="FactoryServer"/>
+ <property name="name" value="localhost"/>
+ </container>
+ <inline name="mynode">
+ <script><code><![CDATA[
+text_result = "i=%s,d=%s,b=%s,s=%s" % (i,d,b,s)
+f = open('result.txt', 'w')
+f.write(text_result)
+f.close()
+]]></code></script>
+ <load container="DefaultContainer"/>
+ <inport name="i" type="int"/>
+ <inport name="d" type="double"/>
+ <inport name="b" type="bool"/>
+ <inport name="s" type="string"/>
+ </inline>
+</proc>
+"""
+ yacs_file = "simpleSchema.xml"
+ job_script_file = os.path.join(case_test_dir, yacs_file)
+ f = open(job_script_file, "w")
+ f.write(script_text)
+ f.close()
+
+ local_result_dir = os.path.join(case_test_dir, "result_yacsopt_job")
+ job_params = salome.JobParameters()
+ job_params.job_type = "yacs_file"
+ job_params.job_file = job_script_file
+ #job_params.env_file = os.path.join(case_test_dir,env_file)
+ job_params.out_files = ["result.txt"]
+
+ # define the interval between two YACS schema dumps (3 seconds)
+ import Engines
+ job_params.specific_parameters = [Engines.Parameter("YACSDriverOptions",
+ "-imynode.i=5 -imynode.d=3.7 -imynode.b=False -imynode.s=lili")]
+ expected_result="i=5,d=3.7,b=False,s=lili"
+ job_params.resource_required = salome.ResourceParameters()
+ job_params.resource_required.nb_proc = 1
+
+ launcher = salome.naming_service.Resolve('/SalomeLauncher')
+ resManager= salome.lcc.getResourcesManager()
+
+ for resource in self.ressources:
+ print "Testing yacs job with options on ", resource
+ job_params.result_directory = local_result_dir + resource
+ job_params.job_name = "YacsJobOpt_" + resource
+ job_params.resource_required.name = resource
+
+ # use the working directory of the resource
+ resParams = resManager.GetResourceDefinition(resource)
+ wd = os.path.join(resParams.working_directory,
+ "YacsJobOpt_" + self.suffix)
+ job_params.work_directory = wd
+
+ job_id = launcher.createJob(job_params)
+ launcher.launchJob(job_id)
+ jobState = launcher.getJobState(job_id)
+
+ yacs_dump_success = False
+ print "Job %d state: %s" % (job_id,jobState)
+ while jobState != "FINISHED" and jobState != "FAILED" :
+ time.sleep(5)
+ jobState = launcher.getJobState(job_id)
+ print "Job %d state: %s " % (job_id,jobState)
+ pass
+
+ self.assertEqual(jobState, "FINISHED")
+
+ # getJobResults to default directory (result_directory)
+ launcher.getJobResults(job_id, "")
+ self.verifyFile(os.path.join(job_params.result_directory, "result.txt"),
+ expected_result)
+
if __name__ == '__main__':
# creat study
import salome
system( cmd.c_str() );
}
-#ifdef WITH_PORTMANAGER
// shutdown portmanager
if ( !portNumber.empty() )
{
MESSAGE(cmd);
system( cmd.c_str() );
}
-#endif
}
//=============================================================================
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
IF(NOT WIN32)
- ADD_TEST(LifeCycleCORBA python ${SALOME_TEST_DRIVER} ${TIMEOUT} TestLifeCycleCORBA.py)
- SET_TESTS_PROPERTIES(LifeCycleCORBA PROPERTIES
- LABELS "${COMPONENT_NAME}"
- ENVIRONMENT "LD_LIBRARY_PATH=${KERNEL_TEST_LIB}:$ENV{LD_LIBRARY_PATH}"
+ SET(TEST_NAME ${COMPONENT_NAME}_LifeCycleCORBA)
+ ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} TestLifeCycleCORBA.py)
+ SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES
+ LABELS "${COMPONENT_NAME}"
+ ENVIRONMENT "LD_LIBRARY_PATH=${KERNEL_TEST_LIB}:$ENV{LD_LIBRARY_PATH}"
)
ENDIF()
TestLifeCycleCORBA_SWIG.py
)
-SALOME_INSTALL_SCRIPTS("${SCRIPTS}" ${SALOME_INSTALL_SCRIPT_PYTHON})
+SET(LOCAL_TEST_DIR ${KERNEL_TEST_DIR}/LifeCycleCORBA_SWIG)
+INSTALL(FILES ${SCRIPTS} DESTINATION ${LOCAL_TEST_DIR})
+INSTALL(FILES CTestTestfileInstall.cmake
+ DESTINATION ${LOCAL_TEST_DIR}
+ RENAME CTestTestfile.cmake)
if __name__ == '__main__':
- suite = unittest.TestLoader().loadTestsFromTestCase(TestContainerManager)
- unittest.TextTestRunner().run(suite)
-
+ #suite = unittest.TestLoader().loadTestsFromTestCase(TestContainerManager)
+ #unittest.TextTestRunner().run(suite)
+ unittest.main()
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
IF(NOT WIN32)
- ADD_TEST(NamingService python ${SALOME_TEST_DRIVER} ${TIMEOUT} TestNamingService.py)
- SET_TESTS_PROPERTIES(NamingService PROPERTIES
- LABELS "${COMPONENT_NAME}"
- ENVIRONMENT "LD_LIBRARY_PATH=${KERNEL_TEST_LIB}:$ENV{LD_LIBRARY_PATH}"
+ SET(TEST_NAME ${COMPONENT_NAME}_NamingService)
+ ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} TestNamingService.py)
+ SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES
+ LABELS "${COMPONENT_NAME}"
+ ENVIRONMENT "LD_LIBRARY_PATH=${KERNEL_TEST_LIB}:$ENV{LD_LIBRARY_PATH}"
)
ENDIF()
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# IF(NOT WIN32)
-# ADD_TEST(SALOMEDS python ${SALOME_TEST_DRIVER} ${TIMEOUT} TestSALOMEDS.py)
-# SET_TESTS_PROPERTIES(SALOMEDS PROPERTIES
-# LABELS "${COMPONENT_NAME}"
-# ENVIRONMENT "LD_LIBRARY_PATH=${KERNEL_TEST_LIB}:$ENV{LD_LIBRARY_PATH}"
+# SET(TEST_NAME ${COMPONENT_NAME}_SALOMEDS)
+# ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} TestSALOMEDS.py)
+# SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES
+# LABELS "${COMPONENT_NAME}"
+# ENVIRONMENT "LD_LIBRARY_PATH=${KERNEL_TEST_LIB}:$ENV{LD_LIBRARY_PATH}"
# )
# ENDIF()
CPPUNIT_ASSERT(sm);
//Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
+ std::vector<std::string> ost(sm->GetOpenStudies());
+ _PTR(Study) study;
+ if(ost.empty())
+ study = sm->NewStudy("Test");
+ else
+ study = sm->GetStudyByName(ost[0]);
CPPUNIT_ASSERT(study);
//Check method GetAllAttributes
std::vector< _PTR(GenericAttribute) > v = so->GetAllAttributes();
- CPPUNIT_ASSERT(v.size() == 5); //+AttributeTarget +AttributeTreeNode
+ CPPUNIT_ASSERT(v.size() == 4); //+AttributeTarget +AttributeTreeNode
//Check method GetName
CPPUNIT_ASSERT(so->GetName() == "SO name");
CPPUNIT_ASSERT(so);
//Try to create SObject with empty and invalid entries
- CPPUNIT_ASSERT(!study->CreateObjectID(""));
+ //CPPUNIT_ASSERT(!study->CreateObjectID(""));
CPPUNIT_ASSERT(!study->CreateObjectID("entry"));
//Check method NewChildIterator
CPPUNIT_ASSERT(so4 && so4->GetID() == so1->GetID());
//Try to find SObject with empty ID
- CPPUNIT_ASSERT(!study->FindObjectID(""));
+ //CPPUNIT_ASSERT(!study->FindObjectID(""));
//Check method FindObjectByName
std::vector< _PTR(SObject) > v = study->FindObjectByName("so1", sco1->ComponentDataType());
studyBuilder->Addreference(so2, so1);
studyBuilder->Addreference(sco1, so1);
std::vector< _PTR(SObject) > vso = study->FindDependances(so1);
- CPPUNIT_ASSERT(vso.size() == 2 && vso[0]->GetID() == so2->GetID() && vso[1]->GetID() == sco1->GetID());
+ CPPUNIT_ASSERT(vso.size() == 2 && vso[0]->GetID() == sco1->GetID() && vso[1]->GetID() == so2->GetID());
//Check method GetProperties
_PTR(AttributeStudyProperties) sp = study->GetProperties();
CPPUNIT_ASSERT(sp);
//Check Lock functionality
- sp->SetLocked(true);
+ /*sp->SetLocked(true);
bool isLockRaised = false;
try {
name_attr_so1->SetValue("test");
catch(...) {
isLockRaised = true;
}
- CPPUNIT_ASSERT(!isLockRaised);
+ CPPUNIT_ASSERT(!isLockRaised);*/
//Check method GetLastModificationDate
sp->SetModification("srn", 1, 2, 3, 4, 5);
std::fstream f("SRN.py");
char buffer[128];
buffer[81] = (char)0;
- f.getline(buffer, 80);
+ for(int i=0;i<4;i++)
+ f.getline(buffer, 80);
std::string line(buffer);
f.close();
system("rm -f SRN.py");
- CPPUNIT_ASSERT(line == "### This file is generated by SALOME automatically by dump python functionality");
+ CPPUNIT_ASSERT(line.substr(0,50) == "### This file is generated automatically by SALOME");
//Check method Close
bool isException = false;
_PTR(Study) study1 = sm->NewStudy("Study1");
CPPUNIT_ASSERT(study1);
- _PTR(Study) study2 = sm->NewStudy("Study2");
- CPPUNIT_ASSERT(study2);
-
//Check method GetStudyByName
_PTR(Study) study3 = sm->GetStudyByName("Study1");
CPPUNIT_ASSERT(study3->StudyId() == study1->StudyId());
CPPUNIT_ASSERT(study3->Name() == study1->Name());
- //Check method GetStudyByName with empty name
- CPPUNIT_ASSERT(!sm->GetStudyByName(""));
-
- //Try to create Study with empty name
- _PTR(Study) study_empty = sm->NewStudy("");
- CPPUNIT_ASSERT(study_empty);
- CPPUNIT_ASSERT(sm->GetStudyByName(""));
- sm->Close(study_empty);
-
- //Check method FindStudyByID
- _PTR(Study) study4 = sm->GetStudyByID(study2->StudyId());
- CPPUNIT_ASSERT(study4->StudyId() == study2->StudyId());
- CPPUNIT_ASSERT(study4->Name() == study2->Name());
-
//Check method GetOpenStudies
std::vector<std::string> v = sm->GetOpenStudies();
- CPPUNIT_ASSERT(v.size() == 2);
-
- //Check method Close
- int id = study2->StudyId();
- sm->Close(study2);
- CPPUNIT_ASSERT(!sm->GetStudyByID(id));
+ CPPUNIT_ASSERT(v.size() == 1);
//Check method GetStudyByID for invalid ID
CPPUNIT_ASSERT(!sm->GetStudyByID(-1));
#include "SALOMEDS_StudyManager_i.hxx"
#ifdef WIN32
+#include <winsock2.h>
#define setenv Kernel_Utils::setenv
-#endif
+#endif
// ============================================================================
/*!
int main(int argc, char* argv[])
{
- // --- Run Salome without GUI
-
- setenv("SALOME_trace", "file:./traceUnitTest.log", 1); // 1: overwrite
-
- system("runSalome -t &");
-
- // --- Wait till SALOMEDS server is launched
-
- char hostname[511];
- int size;
- gethostname(hostname, size);
- char* chr_port = getenv("SALOMEDS_UNITTESTS_PORT");
- std::string port;
- if(chr_port) port = chr_port;
- if(port.empty()) port = "2810";
- std::string cfg_file = std::string(getenv("HOME"))+"/.omniORB_"+std::string(hostname)+"_"+port+".cfg";
- setenv("OMNIORB_CONFIG", cfg_file.c_str(), 1);
-
ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
- ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
CORBA::ORB_var orb = init(argc , argv ) ;
-
- #ifndef WIN32
- sleep(15);
- #else
- Sleep(15000);
- #endif
-
-
std::string host; // = Kernel_Utils::GetHostname();
char* wait_Superv = getenv("SALOMEDS_UNITTESTS_WAIT_SUPERVISOR");
- if(wait_Superv) host = Kernel_Utils::GetHostname();
+ if(wait_Superv) host = Kernel_Utils::GetHostname();
SALOME_NamingService NS(orb);
if(host.empty())
// Activate the objects. This tells the POA that the objects are ready to accept requests.
PortableServer::ObjectId_var aStudyManager_iid = poa->activate_object(aStudyManager_i);
aStudyManager_i->register_name("/myStudyManager_embedded");
-
+
// Obtain a POAManager, and tell the POA to start accepting
// requests on its objects.
PortableServer::POAManager_var pman = poa->the_POAManager();
pman->activate();
}
-
+
// --- Create the event manager and test controller
CPPUNIT_NS::TestResult controller;
// --- Add a listener that colllects test result
CPPUNIT_NS::TestResultCollector result;
- controller.addListener( &result );
+ controller.addListener( &result );
// --- Add a listener that print dots as test run.
#ifdef WIN32
#else
CPPUNIT_NS::BriefTestProgressListener progress;
#endif
- controller.addListener( &progress );
+ controller.addListener( &progress );
// --- Get the top level suite from the registry
testFile.open("UnitTestsResult", std::ios::out | std::ios::trunc);
//CPPUNIT_NS::CompilerOutputter outputter( &result, std::cerr );
CPPUNIT_NS::CompilerOutputter outputter( &result, testFile );
- outputter.write();
+ outputter.write();
// --- Run the tests.
bool wasSucessful = result.wasSuccessful();
testFile.close();
- // --- Kill all created Salome process
-
- system("killSalome.py");
-
// --- Return error code 1 if the one of test failed.
return wasSucessful ? 0 : 1;
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
IF(NOT WIN32)
- ADD_TEST(SALOMEDSImpl python ${SALOME_TEST_DRIVER} ${TIMEOUT} TestSALOMEDSImpl.py)
- SET_TESTS_PROPERTIES(SALOMEDSImpl PROPERTIES
- LABELS "${COMPONENT_NAME}"
- ENVIRONMENT "LD_LIBRARY_PATH=${KERNEL_TEST_LIB}:$ENV{LD_LIBRARY_PATH}"
+ SET(TEST_NAME ${COMPONENT_NAME}_SALOMEDSImpl)
+ ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} TestSALOMEDSImpl.py)
+ SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES
+ LABELS "${COMPONENT_NAME}"
+ ENVIRONMENT "LD_LIBRARY_PATH=${KERNEL_TEST_LIB}:$ENV{LD_LIBRARY_PATH}"
)
ENDIF()
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
IF(NOT WIN32)
- ADD_TEST(SALOMELocalTrace python ${SALOME_TEST_DRIVER} ${TIMEOUT} TestSALOMELocalTrace.py)
- SET_TESTS_PROPERTIES(SALOMELocalTrace PROPERTIES
- LABELS "${COMPONENT_NAME}"
- ENVIRONMENT "LD_LIBRARY_PATH=${KERNEL_TEST_LIB}:$ENV{LD_LIBRARY_PATH}"
+ SET(TEST_NAME ${COMPONENT_NAME}_LocalTrace)
+ ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} TestSALOMELocalTrace.py)
+ SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES
+ LABELS "${COMPONENT_NAME}"
+ ENVIRONMENT "LD_LIBRARY_PATH=${KERNEL_TEST_LIB}:$ENV{LD_LIBRARY_PATH}"
)
ENDIF()
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
IF(NOT WIN32)
- ADD_TEST(TestSalomeSDS python ${SALOME_TEST_DRIVER} ${TIMEOUT} TestSalomeSDS.py)
- SET_TESTS_PROPERTIES(TestSalomeSDS PROPERTIES LABELS "${COMPONENT_NAME}" ENVIRONMENT "PYTHONPATH=${KERNEL_TEST_LIB}:$ENV{PYTHONPATH}")
+ SET(TEST_NAME ${COMPONENT_NAME}_SalomeSDS)
+ ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} TestSalomeSDS.py)
+ SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}" ENVIRONMENT "PYTHONPATH=${KERNEL_TEST_LIB}:$ENV{PYTHONPATH}")
ENDIF(NOT WIN32)
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
IF(NOT WIN32)
- ADD_TEST(SALOMETraceCollector python ${SALOME_TEST_DRIVER} ${TIMEOUT} TestSALOMETraceCollector.py)
- SET_TESTS_PROPERTIES(SALOMETraceCollector PROPERTIES
- LABELS "${COMPONENT_NAME}"
- ENVIRONMENT "LD_LIBRARY_PATH=${KERNEL_TEST_LIB}:$ENV{LD_LIBRARY_PATH}"
+ SET(TEST_NAME ${COMPONENT_NAME}_SALOMETraceCollector)
+ ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} TestSALOMETraceCollector.py)
+ SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES
+ LABELS "${COMPONENT_NAME}"
+ ENVIRONMENT "LD_LIBRARY_PATH=${KERNEL_TEST_LIB}:$ENV{LD_LIBRARY_PATH}"
)
ENDIF()
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
IF(NOT WIN32)
- ADD_TEST(UnitTests python ${SALOME_TEST_DRIVER} ${TIMEOUT} UnitTests.py)
- SET_TESTS_PROPERTIES(UnitTests PROPERTIES
- LABELS "${COMPONENT_NAME}"
- ENVIRONMENT "LD_LIBRARY_PATH=${KERNEL_TEST_LIB}:$ENV{LD_LIBRARY_PATH}"
+ SET(TEST_NAME ${COMPONENT_NAME}_UnitTests)
+ ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} UnitTests.py)
+ SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES
+ LABELS "${COMPONENT_NAME}"
+ ENVIRONMENT "LD_LIBRARY_PATH=${KERNEL_TEST_LIB}:$ENV{LD_LIBRARY_PATH}"
)
ENDIF()
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
IF(NOT WIN32)
- ADD_TEST(Utils python ${SALOME_TEST_DRIVER} ${TIMEOUT} TestUtils.py)
- SET_TESTS_PROPERTIES(Utils PROPERTIES
- LABELS "${COMPONENT_NAME}"
- ENVIRONMENT "LD_LIBRARY_PATH=${KERNEL_TEST_LIB}:$ENV{LD_LIBRARY_PATH}"
+ SET(TEST_NAME ${COMPONENT_NAME}_Utils)
+ ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} TestUtils.py)
+ SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES
+ LABELS "${COMPONENT_NAME}"
+ ENVIRONMENT "LD_LIBRARY_PATH=${KERNEL_TEST_LIB}:$ENV{LD_LIBRARY_PATH}"
)
ENDIF()