1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
#! /bin/bash
# Shell script to ease the launch of a Sight unit test on linux.
#
# This exports the proper LD_LIBRARY_PATH to launch the test
# Don't modify this file, it is automatically generated by CMake.
# Setup the directories
bindir=$(cd "$(dirname "$0")"; pwd)
rootdir=$(cd "$bindir/.." ; pwd)
libdir="$rootdir/lib/sight"
sdkdir="@Sight_LIBRARY_DIR@"
extdir="@Sight_EXTRA_LIBRARY_DIR@:@FW_SIGHT_EXTERNAL_LIBRARIES_DIR@"
moduleopt="@SIGHT_EXTRA_MODULES_OPT@"
# compute LD_LIBRARY_PATH
if [ ! -z "${libdir}" -a "${libdir}" != " " ]; then
LD_LIBRARY_PATH=${libdir}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
fi
if [ ! -z "${sdkdir}" -a "${sdkdir}" != " " ]; then
LD_LIBRARY_PATH=${sdkdir}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
fi
if [ ! -z "${extdir}" -a "${extdir}" != " " ]; then
LD_LIBRARY_PATH=${extdir}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
fi
export LD_LIBRARY_PATH
require_x="@FWCPPUNITTEST_REQUIRE_X@"
if [ "$require_x" = "ON" ]; then
if xprop -root &> /dev/null ; then
xvfb_run=""
elif xvfb-run --help &>/dev/null ; then
xvfb_run="$bindir/safe-xvfb-run"
else
echo "Warning: This test requires some kind of graphical environment to run, but none was found or could be created. The test will probably fail." >&2
xvfb_run=""
fi
else
xvfb_run=""
export QT_QPA_PLATFORM="offscreen"
fi
gdb="@GDB@"
if [ -n "$xvfb_run" ]; then
if [ -n "$gdb" ]; then
exec $xvfb_run $gdb --return-child-result -ex="set confirm off" -ex="set use-coredump-filter off" -ex="dump-excluded-mappings on" -ex="set print thread-events off" -ex run -ex bt -ex="generate-core-file $bindir/@PROJECT_EXECUTABLE@.core" -ex quit --batch --args "$bindir/@PROJECT_EXECUTABLE@" $moduleopt $@
else
exec $xvfb_run "$bindir/@PROJECT_EXECUTABLE@" $moduleopt $@
fi
else
if [ -n "$gdb" ]; then
exec $gdb --return-child-result -ex="set confirm off" -ex="set use-coredump-filter off" -ex="dump-excluded-mappings on" -ex="set print thread-events off" -ex run -ex bt -ex="generate-core-file $bindir/@PROJECT_EXECUTABLE@.core" -ex quit --batch --args "$bindir/@PROJECT_EXECUTABLE@" $moduleopt $@
else
exec "$bindir/@PROJECT_EXECUTABLE@" $moduleopt $@
fi
fi
|