summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2020-12-06 10:50:13 +0100
committerSlávek Banko <slavek.banko@axis.cz>2020-12-06 10:50:47 +0100
commit8bc0bc7fc67437fbf757283604104e998ad2fda7 (patch)
tree49f743699c44a1613ba92435087cb4ab2ee4d80c
parent3a4e7a0733ee08ca552a4941c45eaaf68fad13b1 (diff)
downloadtdelibs-8bc0bc7fc67437fbf757283604104e998ad2fda7.tar.gz
tdelibs-8bc0bc7fc67437fbf757283604104e998ad2fda7.zip
tests: Wait for the dcop server to be ready.
Use a separate ICEAUTHORITY for tests. Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 19f44e5ff3756172540e768fc0d08d761f0c374e)
-rw-r--r--dcop/tests/run-tests.sh6
-rw-r--r--tdeio/tests/CMakeLists.txt1
-rw-r--r--tdeio/tests/kmimetypetest.sh.cmake5
-rw-r--r--tdewallet/backend/tests/CMakeLists.txt1
-rw-r--r--tdewallet/backend/tests/backendtest.sh5
5 files changed, 18 insertions, 0 deletions
diff --git a/dcop/tests/run-tests.sh b/dcop/tests/run-tests.sh
index dc3640511..0d0b02aad 100644
--- a/dcop/tests/run-tests.sh
+++ b/dcop/tests/run-tests.sh
@@ -10,7 +10,9 @@ clean_up
# create temporary home
export HOME=$PWD/test-home
mkdir $HOME
+export ICEAUTHORITY=$HOME/.ICEauthority
+echo '* Starting dcop server'
../dcopserver --nofork &
DCOP_SERVER_PID=$!
@@ -22,6 +24,10 @@ die() {
}
trap 'die "The script interrupted by user"' 2 15
+while ! ../dcopserver --serverid 2>/dev/null; do
+ echo '* Wait for the dcop server'
+ sleep 2
+done
echo '* Running batch mode'
./dcop_test --batch >batch.stdout || die "Failed to run dcop_test"
diff --git a/tdeio/tests/CMakeLists.txt b/tdeio/tests/CMakeLists.txt
index 323a7d86e..e9f5ea5ff 100644
--- a/tdeio/tests/CMakeLists.txt
+++ b/tdeio/tests/CMakeLists.txt
@@ -80,6 +80,7 @@ configure_file( kmimetypetest.sh.cmake kmimetypetest.sh @ONLY )
add_test( NAME "tdeio/kmimetypetest"
COMMAND sh -x "${CMAKE_CURRENT_BINARY_DIR}/kmimetypetest.sh"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" )
+set_tests_properties( "tdeio/kmimetypetest" PROPERTIES TIMEOUT 30)
# TODO add kdirwatchunittest
diff --git a/tdeio/tests/kmimetypetest.sh.cmake b/tdeio/tests/kmimetypetest.sh.cmake
index 3bcd98669..55a0ffbc6 100644
--- a/tdeio/tests/kmimetypetest.sh.cmake
+++ b/tdeio/tests/kmimetypetest.sh.cmake
@@ -5,11 +5,16 @@ HOME=@CMAKE_CURRENT_BINARY_DIR@/test-home
mkdir $HOME $HOME/.trinity $HOME/.trinity/share
ln -s @CMAKE_SOURCE_DIR@/mimetypes $HOME/.trinity/share/mimelnk
export HOME
+export ICEAUTHORITY=$HOME/.ICEauthority
# run dcop server
../../dcop/dcopserver --nofork &
DCOP_SERVER_PID=$!
+while ! ../../dcop/dcopserver --serverid 2>/dev/null; do
+ sleep 2
+done
+
# update tdesycoca using mime types from source
../../kded/tdebuildsycoca --noincremental --nosignal
diff --git a/tdewallet/backend/tests/CMakeLists.txt b/tdewallet/backend/tests/CMakeLists.txt
index 275891ae7..abc703a7c 100644
--- a/tdewallet/backend/tests/CMakeLists.txt
+++ b/tdewallet/backend/tests/CMakeLists.txt
@@ -29,6 +29,7 @@ tde_add_check_executable( backendtest AUTOMOC
LINK tdewalletbackend-shared tdewalletclient-shared )
add_test( NAME "tdewallet/backed/backendtest"
COMMAND sh -x "${CMAKE_CURRENT_SOURCE_DIR}/backendtest.sh" )
+set_tests_properties( "tdewallet/backed/backendtest" PROPERTIES TIMEOUT 30)
tde_add_check_executable( testbf AUTOMOC
SOURCES testbf.cpp ../blockcipher.cc ../blowfish.cc
LINK tdewalletbackend-shared tdewalletclient-shared TEST )
diff --git a/tdewallet/backend/tests/backendtest.sh b/tdewallet/backend/tests/backendtest.sh
index d3a6ef0e1..d4f1ba686 100644
--- a/tdewallet/backend/tests/backendtest.sh
+++ b/tdewallet/backend/tests/backendtest.sh
@@ -3,11 +3,16 @@
# create temporary home
export HOME=$PWD/test-home
mkdir $HOME
+export ICEAUTHORITY=$HOME/.ICEauthority
# run dcop server
../../../dcop/dcopserver --nofork &
DCOP_SERVER_PID=$!
+while ! ../../../dcop/dcopserver --serverid 2>/dev/null; do
+ sleep 2
+done
+
# perform test
./backendtest
STATE=$?