testing: Run tests that use DCOP in a temporary home

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit df203a23f4)
v3.5.13-sru
Slávek Banko 8 years ago
parent cb041edbef
commit da37928707

@ -2,10 +2,15 @@
clean_up() { clean_up() {
rm -f batch.stdout shell.stdout shell.returns batch.returns rm -f batch.stdout shell.stdout shell.returns batch.returns
rm -fr test-home
} }
clean_up clean_up
# create temporary home
export HOME=$PWD/test-home
mkdir $HOME
../dcopserver --nofork & ../dcopserver --nofork &
DCOP_SERVER_PID=$! DCOP_SERVER_PID=$!

@ -1,10 +1,10 @@
#!/bin/sh #!/bin/sh
# create profile for test # create temporary home
KDEHOME=@CMAKE_CURRENT_BINARY_DIR@/profile HOME=@CMAKE_CURRENT_BINARY_DIR@/test-home
mkdir $KDEHOME $KDEHOME/share mkdir $HOME $HOME/.trinity $HOME/.trinity/share
ln -s @CMAKE_SOURCE_DIR@/mimetypes $KDEHOME/share/mimelnk ln -s @CMAKE_SOURCE_DIR@/mimetypes $HOME/.trinity/share/mimelnk
export KDEHOME export HOME
# run dcop server # run dcop server
../../dcop/dcopserver --nofork & ../../dcop/dcopserver --nofork &
@ -19,5 +19,5 @@ STATE=$?
# cleanup # cleanup
kill $DCOP_SERVER_PID kill $DCOP_SERVER_PID
rm -fr $KDEHOME rm -fr test-home
exit $STATE exit $STATE

@ -26,7 +26,9 @@ link_directories(
) )
tde_add_check_executable( backendtest AUTOMOC tde_add_check_executable( backendtest AUTOMOC
LINK kwalletbackend-shared kwalletclient-shared TEST ) LINK kwalletbackend-shared kwalletclient-shared )
add_test( NAME "kwallet/backed/backendtest"
COMMAND sh -x "${CMAKE_CURRENT_SOURCE_DIR}/backendtest.sh" )
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 kwalletbackend-shared kwalletclient-shared TEST ) LINK kwalletbackend-shared kwalletclient-shared TEST )

@ -0,0 +1,18 @@
#!/bin/sh
# create temporary home
export HOME=$PWD/test-home
mkdir $HOME
# run dcop server
../../../dcop/dcopserver --nofork &
DCOP_SERVER_PID=$!
# perform test
./backendtest
STATE=$?
# cleanup
kill $DCOP_SERVER_PID
rm -fr test-home
exit $STATE
Loading…
Cancel
Save