Commit 9ac2dfdd authored by Emmanuel Promayon's avatar Emmanuel Promayon

FIXED config bash test for Windows

parent c43e5612
......@@ -128,12 +128,12 @@ else
CMAKE_OPTIONS="$CMAKE_OPTIONS -DCMAKE_MODULE_PATH:PATH=$3/sdk/cmake/modules;$3/sdk/cmake/modules/macros"
fi
# determine OS
echo "===== Check OS ====="
unameOS=$(uname)
if [[ "$unameOS" =~ ^MINGW64.* || "$unameOS" =~ ^MSYS_NT.* ]]; then
osName="Windows"
osName="Windows"
else
osName="Linux"
osName="Linux"
fi
echo "===== Uname is $unameOS ===== OS is $osName ====="
......
......@@ -24,8 +24,10 @@ set -e
cleanup() {
# backup the current exit status
currentExitValue=$?
# kill the xfvb
kill $xvfbPid
if [[ "$osName" != "Windows" ]]; then
# kill the xfvb
kill $xvfbPid
fi
# cleanup current dir (but not build dir!)
if [ "$inBuild" == "0" ] ; then
rm -rf $workingDir
......@@ -59,20 +61,44 @@ else
cd $workingDir
fi
echo "===== Configuring xvfb ====="
# Starts the server first (to avoid a distracting warning output due to OpenGL context)
Xvfb :5 -screen 0 1600x1200x24 -ac +extension GLX +render -noreset -v -fbdir $workingDir/ &
xvfbPid=$!
echo "PID of Xvfb: $xvfbPid"
export DISPLAY=:5
export XAUTHORITY=/dev/null
echo "===== Check OS ====="
unameOS=$(uname)
if [[ "$unameOS" =~ ^MINGW64.* || "$unameOS" =~ ^MSYS_NT.* ]]; then
osName="Windows"
else
osName="Linux"
fi
echo "===== Uname is $unameOS ===== OS is $osName ====="
echo "===== Get CamiTK configuration ====="
if [[ "$osName" != "Windows" ]]; then
echo "===== Configuring xvfb ====="
# Starts the server first (to avoid a distracting warning output due to OpenGL context)
Xvfb :5 -screen 0 1600x1200x24 -ac +extension GLX +render -noreset -v -fbdir $workingDir/ &
xvfbPid=$!
echo "PID of Xvfb: $xvfbPid"
export DISPLAY=:5
export XAUTHORITY=/dev/null
fi
# Check config executable
if [ "$inBuild" == "0" ] ; then
camitk-config --config > ./config-output 2>&1
camitkConfig="camitk-config"
else
bin/camitk-config --config > ./config-output 2>&1
camitkConfig="bin/camitk-config"
fi
echo "===== Checking $camitkConfig ====="
# check if current build is on windows debug version
if ! hash -lt ${camitkConfig} 2>/dev/null; then
echo "===== Not found: $camitkConfig on $osName ====="
if [[ "$osName" == "Windows" ]]; then
echo "===== camitk-config binary not found, using Debug version on Windows ====="
# try with debug postfix
camitkConfig=$camitkConfig-debug
fi
fi
echo "===== Get CamiTK configuration ====="
$camitkConfig --config > ./config-output 2>&1
camitkConfig=$(cat config-output | sed "s/QStandardPaths.*'.*'//")
echo "===== config-output ====="
......@@ -102,8 +128,8 @@ getExpectedValue() {
echo "/usr"
;;
"Current Working Directory")
# this is an upstream test, it should be ran in build dir
echo $(pwd)
# this is an upstream test, it should be ran in build dir (for windows, remplace ^/c by C:
echo $(pwd) | sed -e "s+^/c+C:+"
;;
"Number of Component Extensions")
case "$version" in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment