#!/bin/bash -x
-set -o nounset
+# Path to sources
+export SOURCES_DIR=$(pwd)
+# Path to build directory
+export BUILD_DIR=$(cd ../build && pwd)
+# Path to linux_run.sh & salome_run.sh
+export AUT_DIR=$(pwd)
+# Path to env_*.sh files
+export TOOLS_DIR=$(pwd)
+
+# Extracts INST_ROOT directory for SALOME
if [[ ! -f env_config.sh ]]; then
echo "Can not find env_config.sh. Please, run config.sh."
exit 1
fi
source env_config.sh
-export ROOT_DIR=$(cd $(dirname $0)/.. && pwd)
-export SOURCES_DIR=${ROOT_DIR}/sources
-export BUILD_DIR=${ROOT_DIR}/build${PLATFORM}
-export INSTALL_DIR=${ROOT_DIR}/install${PLATFORM}
-
+# Path to solvespace-2
export NEWGEOM_PDIR=/dn48/newgeom/common/products
+# Path to install directory
+export NEWGEOM_ROOT_DIR=$(cd ../install && pwd)
#!/bin/bash
+# This script uses:
+#
+# INST_ROOT - path of SALOME (env_products.sh)
+# NEWGEOM_PDIR - path of PRODUCTS for NEWGEOM (SolveSpace, lcov)
+# NEWGEOM_ROOT_DIR - path of NEWGEOM installation
+
+for path in INST_ROOT NEWGEOM_PDIR NEWGEOM_ROOT_DIR; do
+ if [[ -z ${!path+x} ]]; then
+ echo "${path} not found."; exit 1
+ else
+ echo "Found ${path}: ${!path}"
+ fi
+done
+
set +u
-echo "Export SALOME from ${INST_ROOT}..."
source ${INST_ROOT}/env_products.sh
set -u
##
#------ NewGEOM ------
-export NEWGEOM_ROOT_DIR=${INSTALL_DIR}
export PATH=${NEWGEOM_ROOT_DIR}/bin:${NEWGEOM_ROOT_DIR}/plugins:${PATH}
export PYTHONPATH=${NEWGEOM_ROOT_DIR}/swig:${NEWGEOM_ROOT_DIR}/plugins:${NEWGEOM_ROOT_DIR}/addons:${NEWGEOM_ROOT_DIR}/pythonAPI:${PYTHONPATH}
export LD_LIBRARY_PATH=${NEWGEOM_ROOT_DIR}/bin:${NEWGEOM_ROOT_DIR}/swig:${NEWGEOM_ROOT_DIR}/plugins:${LD_LIBRARY_PATH}
#!/bin/bash
-a_dir=$(dirname $0)
-
-source ${a_dir}/env_linux.sh
+source ${TOOLS_DIR}/env_linux.sh
# Correcting path which defined with error
export LD_LIBRARY_PATH=${KERNEL_ROOT_DIR}/lib/salome:${LD_LIBRARY_PATH}
-export SalomeAppConfig=${INSTALL_DIR}/share/salome/resources/newgeom:${GUI_ROOT_DIR}/share/salome/resources/gui
+export SalomeAppConfig=${NEWGEOM_ROOT_DIR}/share/salome/resources/newgeom:${GUI_ROOT_DIR}/share/salome/resources/gui
#!/bin/bash
-a_dir=$(dirname $0)
+for path in TOOLS_DIR; do
+ if [[ -z "${!path}" ]]; then
+ echo "${path} not found."; exit 1
+ else
+ echo "Found ${path}: ${!path}"
+ fi
+done
-source ${a_dir}/env_linux.sh
+source ${TOOLS_DIR}/env_linux.sh
export LD_LIBRARY_PATH=${KERNEL_ROOT_DIR}/lib/salome:${LD_LIBRARY_PATH}
-export LightAppConfig=${INSTALL_DIR}/share/salome/resources/newgeom:${GUI_ROOT_DIR}/share/salome/resources/gui
+export LightAppConfig=${NEWGEOM_ROOT_DIR}/share/salome/resources/newgeom:${GUI_ROOT_DIR}/share/salome/resources/gui
#!/bin/bash
-a_dir=$(dirname $0)
+source env.sh
+source ${TOOLS_DIR}/env_standalone.sh
-cd ${a_dir}
+APP=${NEWGEOM_ROOT_DIR}/bin/GeomApp
-source ${a_dir}/env.sh
-source ${a_dir}/env_standalone.sh
-
-if [ -f GDB ]; then
- ${INSTALL_DIR}/bin/GeomApp >>log_GeomApp 2>>err_GeomApp &
- APP_PID=$!
- echo "Connecting GDB to PID ${APP_PID}..."
- gdb - ${APP_PID} >>log_gdb_linux 2>>err_gdb_linux
-else
- ${INSTALL_DIR}/bin/GeomApp
-fi
+${APP}
-#!/bin/bash -x
+#!/bin/bash
-a_dir=$(dirname $0)
-
-cd ${a_dir}
-
-source ${a_dir}/env.sh
-source ${a_dir}/env_salome.sh
-
-SALOME_ARGS="-r ./test.squish/shared/testdata/SalomeApp.xml"
-if [ -f GDB ]; then
- echo "No --gdb-session"
- #SALOME_ARGS="${SALOME_ARGS} --gdb-session"
-fi
-SALOME_ARGS="${SALOME_ARGS} --ns-port-log=$(pwd)/.salomeport"
+source env.sh
+source ${TOOLS_DIR}/env_salome.sh
# kill processes of previous SALOME run
if [ -f .salomeport ]; then
rm .salomeport
fi
-${KERNEL_ROOT_DIR}/bin/salome/runSalome.py ${SALOME_ARGS} >log_runSalome 2>err_runSalome &
-SALOME_PID=$!
-
-ATTEMPT=0
-while [[ ! -f .salomeport && ${ATTEMPT} -lt 5 ]]; do
- sleep 5
- SALOME_PORT=$(cat .salomeport)
- ATTEMPT=$[${ATTEMPT}+1]
-done
-if [ ${ATTEMPT} = 5 ]; then
- echo "Can not receive SALOME_PORT: file .salomeport does not exist..."
- exit 1
-fi
-
-echo "SALOME_PORT ${SALOME_PORT}"
-
-if [ -f GDB ]; then
- SALOME_SESSION_SERVER_PID="$(salome_pid.py ${SALOME_PORT} 'SALOME_Session_Server' 2>/dev/null)"
- ATTEMPT=0
- while [[ "${SALOME_SESSION_SERVER_PID}" = "" && "${ATTEMPT}" -lt 5 ]]; do
- sleep 5
- SALOME_SESSION_SERVER_PID="$(salome_pid.py ${SALOME_PORT} 'SALOME_Session_Server' 2>/dev/null)"
- ATTEMPT=$[${ATTEMPT}+1]
- done
- if [ ${ATTEMPT} = 5 ]; then
- echo "Can not receive SALOME_SESSION_SERVER_PID..."
- exit 2
- fi
-
- echo "SALOME_SESSION_SERVER_PID ${SALOME_SESSION_SERVER_PID}"
- echo "Connecting GDB to PID ${SALOME_SESSION_SERVER_PID}..."
- gdb - ${SALOME_SESSION_SERVER_PID} >>log_gdb_salome 2>>err_gdb_salome
-fi
+SALOME_ARGS=""
+SALOME_ARGS="${SALOME_ARGS} -r ./test.squish/shared/testdata/SalomeApp.xml"
+SALOME_ARGS="${SALOME_ARGS} --ns-port-log=$(pwd)/.salomeport"
-wait ${SALOME_PID}
+${KERNEL_ROOT_DIR}/bin/salome/runSalome.py ${SALOME_ARGS} >log_runSalome 2>err_runSalome
+SALOME_PORT=$(cat .salomeport)
echo "Kill SALOME on port ${SALOME_PORT}"
${KERNEL_ROOT_DIR}/bin/salome/killSalomeWithPort.py ${SALOME_PORT}
pkill -f "omniNames -start ${SALOME_PORT}"