#!/bin/bash
-# Find absolute path to ROOT_DIR
-export ROOT_DIR=$(pwd)/..
-export ROOT_DIR=`cd "${ROOT_DIR}";pwd`
+source env.sh
-SRC_DIR=${ROOT_DIR}/sources
+mkdir -p ${BUILD_DIR}
+cd ${BUILD_DIR}
-BUILD_DIR=build
-INSTALL_DIR=install
-if [ $1 ]; then
- BUILD_DIR=${BUILD_DIR}-$1
- INSTALL_DIR=${INSTALL_DIR}-$1
-fi
-
-source ${SRC_DIR}/salome_env.sh
-source ${SRC_DIR}/linux_env.sh $1
-mkdir -p ${ROOT_DIR}/${BUILD_DIR}
-cd ${ROOT_DIR}/${BUILD_DIR}
+export DISPLAY="localhost:0.0"
-CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=Release"
-CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=${ROOT_DIR}/${INSTALL_DIR}"
-CMAKE_ARGS="${CMAKE_ARGS} ${SRC_DIR}"
+# check for __init__.py in the SHAPER's Python scripts directory
+# for correct parsing PYTHONPATH and use the actual version of SHAPER
+# instead of distributed with SALOME
+if [[ ! -f ${SHAPER_PYTHON_SCRIPTS_DIR}/salome/__init__.py ]]; then
+ touch ${SHAPER_PYTHON_SCRIPTS_DIR}/salome/__init__.py
+fi
-ctest --no-compress-output -T Test
+if [[ $# > 0 ]]; then
+ ctest --no-compress-output -T Test "$@" -R $1
+else
+ ctest --no-compress-output -T Test "$@"
+fi