cmake -G "Eclipse CDT4 - Unix Makefiles" ${CMAKE_ARGS}
-/dn48/newgeom/common/eclipse-4.4.0/eclipse&
+/dn48/newgeom/common/eclipse-4.4.0/eclipse &
# SHAPER_ROOT_DIR - path of SHAPER installation
for path in SHAPER_PDIR SHAPER_ROOT_DIR; do
- if [[ -z ${!path+x} ]]; then
- echo "${path} not found."; exit 1
- else
- echo "Found ${path}: ${!path}"
- fi
+ if [[ -z ${!path+x} ]]; then
+ echo "${path} not found."
+ exit 1
+ else
+ echo "Found ${path}: ${!path}"
+ fi
done
#------ lcov ------
#!/bin/bash
-function isDOSFile
-{
- local FILENAME="$1"
- file "$FILENAME" | grep -q "CRLF line terminators"
+function isDOSFile {
+ local FILENAME="$1"
+ file "$FILENAME" | grep -q "CRLF line terminators"
}
-if git-rev-parse --verify HEAD >/dev/null 2>&1 ; then
- against=HEAD
+if git-rev-parse --verify HEAD >/dev/null 2>&1; then
+ against=HEAD
else
- # Initial commit: diff against an empty tree object
- against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
+ # Initial commit: diff against an empty tree object
+ against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
# Find files with DOS line endings
FOUND=0
-for FILE in $(exec git diff-index --check --cached $against -- | sed '/^[+-]/d' | sed -r 's/:[0-9]+:.*//' | uniq) ; do
+for FILE in $(exec git diff-index --check --cached $against -- | sed '/^[+-]/d' | sed -r 's/:[0-9]+:.*//' | uniq); do
isDOSFile "$FILE"
- if (( $? == 0 ))
- then
- echo "\"$FILE\" has DOS line endings" >&2
- FOUND=1
+ if (($? == 0)); then
+ echo "\"$FILE\" has DOS line endings" >&2
+ FOUND=1
fi
done
FIX_LINE_ENDINGS=0
while [[ $# > 0 ]]; do
- key="$1"
+ key="$1"
- case $key in
+ case $key in
fix)
- FIX_LINE_ENDINGS=1
- shift
- ;;
+ FIX_LINE_ENDINGS=1
+ shift
+ ;;
*)
- shift
- ;;
- esac
+ shift
+ ;;
+ esac
done
source env.sh
-find . \( -name "*.h" -o -name "*.cpp" \) -exec cpplint.py --filter=-,+whitespace/end_of_line --verbose=0 --counting=detailed {} \+ 2>&1 | grep -v Done | tee ./tofix
+find . \( -name "*.h" -o -name "*.cpp" \) -exec cpplint.py --filter=-,+whitespace/end_of_line --verbose=0 --counting=detailed {} \+ 2>&1 | grep -v Done | tee ./tofix
WRONG=0
if [ -s ./tofix ]; then
- if [[ ${FIX_LINE_ENDINGS} == 1 ]]; then
- python correction_auto_2.py --cpplint_output_file ./tofix
- echo "NOTE: Line endings are fixed"
- else
- WRONG=1
- fi
+ if [[ ${FIX_LINE_ENDINGS} == 1 ]]; then
+ python correction_auto_2.py --cpplint_output_file ./tofix
+ echo "NOTE: Line endings are fixed"
+ else
+ WRONG=1
+ fi
fi
rm ./tofix
#!/bin/bash
-find_duplicated_images_usage()
-{
+find_duplicated_images_usage() {
echo "Find duplicated images."
echo
echo "Usage: $(basename ${0}) [options]"
exit 0
}
-
-
-find_duplicated_images_main()
-{
+find_duplicated_images_main() {
local verbose=0
local where=$(readlink -f $(dirname "${0}"))
# parse command line
local option
- while getopts ":-:hp" option ${@}
- do
- if [ "${option}" = "-" ]
- then
+ while getopts ":-:hp" option ${@}; do
+ if [ "${option}" = "-" ]; then
case ${OPTARG} in
- help ) find_duplicated_images_usage ;;
- print ) verbose=1 ;;
- * ) echo "Wrong option: --${OPTARG}" > /dev/stderr ; exit 1 ;;
+ help) find_duplicated_images_usage ;;
+ print) verbose=1 ;;
+ *)
+ echo "Wrong option: --${OPTARG}" >/dev/stderr
+ exit 1
+ ;;
esac
else
case ${option} in
- h ) find_duplicated_images_usage ;;
- p ) verbose=1 ;;
- ? ) echo "Wrong option" > /dev/stderr ; exit 1 ;;
+ h) find_duplicated_images_usage ;;
+ p) verbose=1 ;;
+ ?)
+ echo "Wrong option" >/dev/stderr
+ exit 1
+ ;;
esac
fi
done
local result=0
- if [ "${verbose}" = "1" ]
- then
- local filename
- for filename in $(find ${where} -type f -wholename "*/doc/*.png" -exec basename {} \; | sort | uniq -d)
- do
- find ${where} -type f -wholename "*/doc/*/${filename}"
- result=$((result+1))
- done
+ if [ "${verbose}" = "1" ]; then
+ local filename
+ for filename in $(find ${where} -type f -wholename "*/doc/*.png" -exec basename {} \; | sort | uniq -d); do
+ find ${where} -type f -wholename "*/doc/*/${filename}"
+ result=$((result + 1))
+ done
else
- result=$(find -type f -wholename "*/doc/*.png" -exec basename {} \; | sort | uniq -d | wc -l)
+ result=$(find -type f -wholename "*/doc/*.png" -exec basename {} \; | sort | uniq -d | wc -l)
fi
return ${result}
cd ${BUILD_DIR}
if [[ -n $@ ]]; then
- $@
+ $@
else
- bash
+ bash
fi
cd ${BUILD_DIR}
if [[ -n $@ ]]; then
- $@
+ $@
else
- bash
+ bash
fi
cp -f coverage.info.noext covfile
# remove all reports of GUI and external parts (for all the next kinds of reports)
for MASK in '*wrap*' 'moc_*' 'XAO_*' 'SketcherPrs_*' 'GeomAlgoImpl_*' 'ModuleBase_*' '*Widget*' '*Splitter*'; do
-lcov -r covfile ${MASK} --output-file covfile_res -q
-mv -f covfile_res covfile
+ lcov -r covfile ${MASK} --output-file covfile_res -q
+ mv -f covfile_res covfile
done
ALL='BuildPlugin CollectionPlugin ConstructionPlugin ExchangePlugin FiltersPlugin FeaturesPlugin GDMLPlugin PrimitivesPlugin InitializationPlugin ParametersPlugin PartSetPlugin SketchPlugin'
# remove all plugins data except the needed
NEED='BuildAPI CollectionAPI ConnectorAPI ConstructionAPI ExchangeAPI FiltersAPI FeaturesAPI ModelHighAPI ParametersAPI PartSetAPI PrimitivesAPI SketchAPI'
for MASK in $ALL; do
- if ! [[ " $NEED " =~ " $MASK " ]]; then
- lcov -r covAPI *${MASK}* --output-file covAPI_res -q
- mv -f covAPI_res covAPI
- fi
+ if ! [[ " $NEED " =~ " $MASK " ]]; then
+ lcov -r covAPI *${MASK}* --output-file covAPI_res -q
+ mv -f covAPI_res covAPI
+ fi
done
rm -rf lcov_htmlAPI
genhtml covAPI --output-directory lcov_htmlAPI -q
-
# prepare Direct report
cp -f covfile covDirect
# remove all plugins data except the needed
NEED='GeomAlgoAPI GeomAPI'
for MASK in $ALL; do
- if ! [[ " $NEED " =~ " $MASK " ]]; then
- lcov -r covDirect *${MASK}* --output-file covDirect_res -q
- mv -f covDirect_res covDirect
- fi
+ if ! [[ " $NEED " =~ " $MASK " ]]; then
+ lcov -r covDirect *${MASK}* --output-file covDirect_res -q
+ mv -f covDirect_res covDirect
+ fi
done
# exclude GeomAPI_AISObject as GUI-related object
lcov -r covDirect GeomAPI_AISObject* --output-file covDirect_res -q
rm -rf lcov_htmlDirect
genhtml covDirect --output-directory lcov_htmlDirect -q
-
# prepare Else report
cp -f covfile covElse
# remove all plugins data except the needed
NEED='BuildPlugin CollectionPlugin Config ConstructionPlugin Events ExchangePlugin FiltersPlugin FeaturesPlugin GeomData GeomDataAPI GeomValidators InitializationPlugin Model_ ModelAPI ModelGeomAlgo ParametersPlugin PartSetPlugin PrimitivesPlugin Selector SketchPlugin SketchSolver'
for MASK in $ALL; do
- if ! [[ " $NEED " =~ " $MASK " ]]; then
- lcov -r covElse *${MASK}* --output-file covElse_res -q
- mv -f covElse_res covElse
- fi
+ if ! [[ " $NEED " =~ " $MASK " ]]; then
+ lcov -r covElse *${MASK}* --output-file covElse_res -q
+ mv -f covElse_res covElse
+ fi
done
rm -rf lcov_htmlElse
genhtml covElse --output-directory lcov_htmlElse -q
#!/bin/bash
while [[ $# > 0 ]]; do
- key="$1"
-
- case $key in
- debug|Debug)
- BUILD_TYPE=Debug
- shift
- ;;
- lcov|coverage)
- BUILD_TYPE=Debug
- USE_TEST_COVERAGE=ON
- shift
- ;;
- models|test-models)
- ADD_MODELS_TESTS=TRUE
- shift
- ;;
- compatibility|test-compatibility)
- ADD_COMPATIBILITY_TESTS=TRUE
- shift
- ;;
- hdf|test-hdf-models)
- ADD_HDF_TESTS=TRUE
- shift
- ;;
+ key="$1"
+
+ case $key in
+ debug | Debug)
+ BUILD_TYPE=Debug
+ shift
+ ;;
+ lcov | coverage)
+ BUILD_TYPE=Debug
+ USE_TEST_COVERAGE=ON
+ shift
+ ;;
+ models | test-models)
+ ADD_MODELS_TESTS=TRUE
+ shift
+ ;;
+ compatibility | test-compatibility)
+ ADD_COMPATIBILITY_TESTS=TRUE
+ shift
+ ;;
+ hdf | test-hdf-models)
+ ADD_HDF_TESTS=TRUE
+ shift
+ ;;
*)
- shift
- ;;
- esac
+ shift
+ ;;
+ esac
done
## Preserve PTHONPATH in order to avoid problems with Sphinx on Fedora26 because of Pigments in ParaView
export PYTHONPATH_OLD=$PYTHONPATH
source env.sh
-if [[ ${OS_NAME} = Fedora26-64 ]]
-then
- export PYTHONPATH=$PYTHONPATH_OLD
+if [[ ${OS_NAME} == Fedora26-64 ]]; then
+ export PYTHONPATH=$PYTHONPATH_OLD
fi
CMAKE_ARGS=""
# kill processes of previous SALOME run
if [ -f .salomeport ]; then
- SALOME_PORT=$(cat .salomeport)
- ${KERNEL_ROOT_DIR}/bin/salome/killSalomeWithPort.py ${SALOME_PORT}
- pkill -f "omniNames -start ${SALOME_PORT}"
- rm .salomeport
+ SALOME_PORT=$(cat .salomeport)
+ ${KERNEL_ROOT_DIR}/bin/salome/killSalomeWithPort.py ${SALOME_PORT}
+ pkill -f "omniNames -start ${SALOME_PORT}"
+ rm .salomeport
fi
SALOME_ARGS=""
-if [[ "${SALOME_SQUISH_PREFS:-FALSE}" == "TRUE" ]]; then
- SALOME_ARGS="${SALOME_ARGS} -r ${SOURCES_DIR}/test.squish/shared/testdata/SalomeApp.xml"
+if [[ ${SALOME_SQUISH_PREFS:-FALSE} == "TRUE" ]]; then
+ SALOME_ARGS="${SALOME_ARGS} -r ${SOURCES_DIR}/test.squish/shared/testdata/SalomeApp.xml"
fi
SALOME_ARGS="${SALOME_ARGS} --ns-port-log=$(pwd)/.salomeport"
export PLUGINS_PATH=${PLUGINS_PATH:-${SHAPER_ROOT_DIR}/share/salome/resources/shaper/plugins.xml}
while [[ $# > 0 ]]; do
- key="$1"
- case $key in
- solvespace|ss)
- export solver=SolveSpace
- shift
- ;;
- planegcs|gcs)
- export solver=PlaneGCS
- shift
- ;;
+ key="$1"
+ case $key in
+ solvespace | ss)
+ export solver=SolveSpace
+ shift
+ ;;
+ planegcs | gcs)
+ export solver=PlaneGCS
+ shift
+ ;;
-p)
- export PLUGINS_PATH="$2"
- shift
- shift
- ;;
+ export PLUGINS_PATH="$2"
+ shift
+ shift
+ ;;
*)
- shift
- ;;
- esac
+ shift
+ ;;
+ esac
done
if [[ -z ${solver:-} ]]; then exit 0; fi
case $solver in
- PlaneGCS)
+PlaneGCS)
export SWITCH_ON=PlaneGCSSolver
export SWITCH_OFF=SolveSpaceSolver
;;
- SolveSpace|*)
+SolveSpace | *)
export SWITCH_ON=SolveSpaceSolver
export SWITCH_OFF=PlaneGCSSolver
;;
echo "Switch $solver solver in ${PLUGINS_PATH}"
-cat ${PLUGINS_PATH} \
- | tr '\n' '\r' \
- | sed -e "s|\r <plugin library=\"[^\r]*Solver\"\/>\r<!--|\r <plugin library=\"${solver}Solver\"\/>\r<!--|" \
- | tr '\r' '\n' \
- > ${PLUGINS_PATH}_out
+cat ${PLUGINS_PATH} |
+ tr '\n' '\r' |
+ sed -e "s|\r <plugin library=\"[^\r]*Solver\"\/>\r<!--|\r <plugin library=\"${solver}Solver\"\/>\r<!--|" |
+ tr '\r' '\n' \
+ >${PLUGINS_PATH}_out
mv -f ${PLUGINS_PATH}_out ${PLUGINS_PATH}
cat ${PLUGINS_PATH}
source ${a_dir}/env_squish.sh
-export TEST_DATA_DIR=$(cd ${a_dir}; pwd)/test.squish/shared/testdata
+export TEST_DATA_DIR=$(
+ cd ${a_dir}
+ pwd
+)/test.squish/shared/testdata
squishide
TITLE=$1
# initialize
-if [[ $TITLE == "--reset" ]]
-then
+if [[ $TITLE == "--reset" ]]; then
lcov --base-directory . --directory . --zerocounters -q
echo "Reset counters"
exit 0
fi
-
-if [ -z $TITLE ]
-then
+if [ -z $TITLE ]; then
echo $TITLE "name is required"
exit 1
fi
INFO_FILE=${TITLE}.info
-if [ -f $INFO_FILE ]
-then
+if [ -f $INFO_FILE ]; then
rm -f $INFO_FILE
fi
# génération du rapport
genhtml --output-directory $REPORT_PATH --title $TITLE --num-spaces 4 $INFO_FILE
-if [ ! -z $BROWSER ]
-then
+if [ ! -z $BROWSER ]; then
$BROWSER $REPORT_PATH/index.html &
fi
# 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
+ touch ${SHAPER_PYTHON_SCRIPTS_DIR}/salome/__init__.py
fi
if [[ $# > 0 ]]; then
- ctest --no-compress-output -T Test "$@" -R $1
+ ctest --no-compress-output -T Test "$@" -R $1
else
- ctest --no-compress-output -T Test "$@"
+ ctest --no-compress-output -T Test "$@"
fi
# config squishserver
for aut in linux_run.sh salome_run.sh; do
- squishserver --config addAUT ${aut} ${AUT_DIR}
+ squishserver --config addAUT ${aut} ${AUT_DIR}
done
squishserver --config setAUTTimeout 120
# stop previous version
RETVAL=0
squishrunner-run() {
- local TESTSUITE=$1
- local TESTCASES="$2"
-
- local SQUISHRUNNER_ARGS=""
- SQUISHRUNNER_ARGS="${SQUISHRUNNER_ARGS} --testsuite ${SOURCES_DIR}/test.squish/${TESTSUITE}"
- SQUISHRUNNER_ARGS="${SQUISHRUNNER_ARGS} --resultdir ${SOURCES_DIR}/test.squish_results/${TESTSUITE}"
- SQUISHRUNNER_ARGS="${SQUISHRUNNER_ARGS} --reportgen xmljunit,${SOURCES_DIR}/test.squish_results/${TESTSUITE}_results.xml"
- SQUISHRUNNER_ARGS="${SQUISHRUNNER_ARGS} ${TESTCASES}"
- SQUISHRUNNER_ARGS="${SQUISHRUNNER_ARGS} --exitCodeOnFail 1"
- squishrunner ${SERVEROPTIONS_ARGS} ${SQUISHRUNNER_ARGS}
- EXIT_CODE=$?
- if [ ${EXIT_CODE} = '1' ]; then RETVAL=1; fi
+ local TESTSUITE=$1
+ local TESTCASES="$2"
+
+ local SQUISHRUNNER_ARGS=""
+ SQUISHRUNNER_ARGS="${SQUISHRUNNER_ARGS} --testsuite ${SOURCES_DIR}/test.squish/${TESTSUITE}"
+ SQUISHRUNNER_ARGS="${SQUISHRUNNER_ARGS} --resultdir ${SOURCES_DIR}/test.squish_results/${TESTSUITE}"
+ SQUISHRUNNER_ARGS="${SQUISHRUNNER_ARGS} --reportgen xmljunit,${SOURCES_DIR}/test.squish_results/${TESTSUITE}_results.xml"
+ SQUISHRUNNER_ARGS="${SQUISHRUNNER_ARGS} ${TESTCASES}"
+ SQUISHRUNNER_ARGS="${SQUISHRUNNER_ARGS} --exitCodeOnFail 1"
+ squishrunner ${SERVEROPTIONS_ARGS} ${SQUISHRUNNER_ARGS}
+ EXIT_CODE=$?
+ if [ ${EXIT_CODE} = '1' ]; then RETVAL=1; fi
}
TESTCASES=""
# stop squishserver
squishserver ${SERVEROPTIONS_ARGS} --verbose --stop
for aut in linux_run.sh salome_run.sh; do
- squishserver --config removeAUT ${aut} ${AUT_DIR}
+ squishserver --config removeAUT ${aut} ${AUT_DIR}
done
exit ${RETVAL}
fi
# Display a message, wrapping lines at the terminal width.
-message () {
+message() {
echo "$PROGNAME: $*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS}
}
# Display an error message.
-error () {
+error() {
message "error: $*" >&2
}
# Display a usage message.
-usage () {
+usage() {
if [ -n "$*" ]; then
message "usage error: $*"
fi
i=$SERVERNUM
while [ -f /tmp/.X$i-lock ]; do
- i=$(($i + 1))
+ i=$((i + 1))
done
echo $i
}
# Parse the command line.
ARGS=$(getopt --options +ae:f:hn:lp:s:w: \
- --long auto-servernum,error-file:auth-file:,help,server-num:,listen-tcp,xauth-protocol:,server-args:,wait: \
- --name "$PROGNAME" -- "$@")
+ --long auto-servernum,error-file:auth-file:,help,server-num:,listen-tcp,xauth-protocol:,server-args:,wait: \
+ --name "$PROGNAME" -- "$@")
GETOPT_STATUS=$?
if [ $GETOPT_STATUS -ne 0 ]; then
while :; do
case "$1" in
- -a|--auto-servernum) SERVERNUM=$(find_free_servernum) ;;
- -e|--error-file) ERRORFILE="$2"; shift ;;
- -f|--auth-file) AUTHFILE="$2"; shift ;;
- -h|--help) SHOWHELP="yes" ;;
- -n|--server-num) SERVERNUM="$2"; shift ;;
- -l|--listen-tcp) LISTENTCP="" ;;
- -p|--xauth-protocol) XAUTHPROTO="$2"; shift ;;
- -s|--server-args) VNCARGS="$2"; shift ;;
- -w|--wait) STARTWAIT="$2"; shift ;;
- --) shift; break ;;
- *) error "internal error; getopt permitted \"$1\" unexpectedly"
- exit 6
- ;;
+ -a | --auto-servernum) SERVERNUM=$(find_free_servernum) ;;
+ -e | --error-file)
+ ERRORFILE="$2"
+ shift
+ ;;
+ -f | --auth-file)
+ AUTHFILE="$2"
+ shift
+ ;;
+ -h | --help) SHOWHELP="yes" ;;
+ -n | --server-num)
+ SERVERNUM="$2"
+ shift
+ ;;
+ -l | --listen-tcp) LISTENTCP="" ;;
+ -p | --xauth-protocol)
+ XAUTHPROTO="$2"
+ shift
+ ;;
+ -s | --server-args)
+ VNCARGS="$2"
+ shift
+ ;;
+ -w | --wait)
+ STARTWAIT="$2"
+ shift
+ ;;
+ --)
+ shift
+ break
+ ;;
+ *)
+ error "internal error; getopt permitted \"$1\" unexpectedly"
+ exit 6
+ ;;
esac
shift
done
# Start VNC.
MCOOKIE=$(mcookie)
-XAUTHORITY=$AUTHFILE xauth source - << EOF >>"$ERRORFILE" 2>&1
+XAUTHORITY=$AUTHFILE xauth source - <<EOF >>"$ERRORFILE" 2>&1
add :$SERVERNUM $XAUTHPROTO $MCOOKIE
EOF
XAUTHORITY=$AUTHFILE vncserver ":$SERVERNUM" >>"$ERRORFILE" 2>&1 &
VNCPID=$!
sleep "$STARTWAIT"
if ! wait ${VNCPID}; then
- exit 5
+ exit 5
fi
# Start the command and save its exit status.