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>
pull/114/head
Slávek Banko 4 years ago
parent 1f1bd93ca8
commit 19f44e5ff3
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -10,7 +10,9 @@ clean_up
# create temporary home # create temporary home
export HOME=$PWD/test-home export HOME=$PWD/test-home
mkdir $HOME mkdir $HOME
export ICEAUTHORITY=$HOME/.ICEauthority
echo '* Starting dcop server'
../dcopserver --nofork & ../dcopserver --nofork &
DCOP_SERVER_PID=$! DCOP_SERVER_PID=$!
@ -22,6 +24,10 @@ die() {
} }
trap 'die "The script interrupted by user"' 2 15 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' echo '* Running batch mode'
./dcop_test --batch >batch.stdout || die "Failed to run dcop_test" ./dcop_test --batch >batch.stdout || die "Failed to run dcop_test"

@ -80,6 +80,7 @@ configure_file( kmimetypetest.sh.cmake kmimetypetest.sh @ONLY )
add_test( NAME "tdeio/kmimetypetest" add_test( NAME "tdeio/kmimetypetest"
COMMAND sh -x "${CMAKE_CURRENT_BINARY_DIR}/kmimetypetest.sh" COMMAND sh -x "${CMAKE_CURRENT_BINARY_DIR}/kmimetypetest.sh"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" ) WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" )
set_tests_properties( "tdeio/kmimetypetest" PROPERTIES TIMEOUT 30)
# TODO add kdirwatchunittest # TODO add kdirwatchunittest

@ -5,11 +5,16 @@ HOME=@CMAKE_CURRENT_BINARY_DIR@/test-home
mkdir $HOME $HOME/.trinity $HOME/.trinity/share mkdir $HOME $HOME/.trinity $HOME/.trinity/share
ln -s @CMAKE_SOURCE_DIR@/mimetypes $HOME/.trinity/share/mimelnk ln -s @CMAKE_SOURCE_DIR@/mimetypes $HOME/.trinity/share/mimelnk
export HOME export HOME
export ICEAUTHORITY=$HOME/.ICEauthority
# run dcop server # run dcop server
../../dcop/dcopserver --nofork & ../../dcop/dcopserver --nofork &
DCOP_SERVER_PID=$! DCOP_SERVER_PID=$!
while ! ../../dcop/dcopserver --serverid 2>/dev/null; do
sleep 2
done
# update tdesycoca using mime types from source # update tdesycoca using mime types from source
../../kded/tdebuildsycoca --noincremental --nosignal ../../kded/tdebuildsycoca --noincremental --nosignal

@ -29,6 +29,7 @@ tde_add_check_executable( backendtest AUTOMOC
LINK tdewalletbackend-shared tdewalletclient-shared ) LINK tdewalletbackend-shared tdewalletclient-shared )
add_test( NAME "tdewallet/backed/backendtest" add_test( NAME "tdewallet/backed/backendtest"
COMMAND sh -x "${CMAKE_CURRENT_SOURCE_DIR}/backendtest.sh" ) COMMAND sh -x "${CMAKE_CURRENT_SOURCE_DIR}/backendtest.sh" )
set_tests_properties( "tdewallet/backed/backendtest" PROPERTIES TIMEOUT 30)
tde_add_check_executable( testbf AUTOMOC tde_add_check_executable( testbf AUTOMOC
SOURCES testbf.cpp ../blockcipher.cc ../blowfish.cc SOURCES testbf.cpp ../blockcipher.cc ../blowfish.cc
LINK tdewalletbackend-shared tdewalletclient-shared TEST ) LINK tdewalletbackend-shared tdewalletclient-shared TEST )

@ -3,11 +3,16 @@
# create temporary home # create temporary home
export HOME=$PWD/test-home export HOME=$PWD/test-home
mkdir $HOME mkdir $HOME
export ICEAUTHORITY=$HOME/.ICEauthority
# run dcop server # run dcop server
../../../dcop/dcopserver --nofork & ../../../dcop/dcopserver --nofork &
DCOP_SERVER_PID=$! DCOP_SERVER_PID=$!
while ! ../../../dcop/dcopserver --serverid 2>/dev/null; do
sleep 2
done
# perform test # perform test
./backendtest ./backendtest
STATE=$? STATE=$?

Loading…
Cancel
Save