Runtime: work around 1s delay added when using twisted reactor's callLater.
Since wxPython4, using wxReactor from non-main thread was producing
exceptions in wxWidget's C++ code. Then reactor.run() was called from
main thread, and runtime's worker was delegating calls to reactor
with callLater(0, callable).
While this worked perfectly with wxReactor, it did introduce an unexplained
1 second delay to each worker call when using nomal linux reactors
(i.e. without wxPython). As a workaround reactor runs in a thread when using
twisted without wxPython
#!/bin/bash
set -e
# source directory containing beremiz, matiec, etc..
SRCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd ../../../../.. && pwd )"
echo "SOURCE direcory : $SRCDIR"
# absolute path to test directory. ~/test if not given as only argument
TESTDIR=${1:-~/test}
mkdir -p $TESTDIR
echo "TEST direcory : $TESTDIR"
UNAME=testing
UHOME=/home/$UNAME
# define TESTDEBUG in env to enable dev-mode. This enables :
# - debug pasthrough for Xnest
# - VNC port passthrough
DEBUGARGS="-v /tmp/.X11-unix/X0:/tmp/.X11-unix/X0 -e DISPLAY=$DISPLAY -p 5900:5900"
echo "Creating docker container"
docker create \
--name beremiz_sikuli_current \
-v $SRCDIR:$UHOME/src \
-v $TESTDIR:$UHOME/test \
`if [ "$TESTDEBUG" == "YES" ]; then echo $DEBUGARGS; fi` \
-w $UHOME/test \
-i -t beremiz_sikuli /bin/bash