summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2017-02-01 01:57:20 +0100
committerSlávek Banko <slavek.banko@axis.cz>2017-07-22 15:56:53 +0200
commitda3792870721d0f375a26609ad7fb4bdb329098c (patch)
tree1d42e5720c9a23661cb7dc26316ea348409c0839
parentcb041edbef5ae4894559ed9307968b7b1f4a8b07 (diff)
downloadtdelibs-da3792870721d0f375a26609ad7fb4bdb329098c.tar.gz
tdelibs-da3792870721d0f375a26609ad7fb4bdb329098c.zip
testing: Run tests that use DCOP in a temporary home
Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit df203a23f4d96fae5fbc61bb180c4db8f63e63ae)
-rw-r--r--dcop/tests/run-tests.sh5
-rw-r--r--kio/tests/kmimetypetest.sh.cmake12
-rw-r--r--kwallet/backend/tests/CMakeLists.txt4
-rw-r--r--kwallet/backend/tests/backendtest.sh18
4 files changed, 32 insertions, 7 deletions
diff --git a/dcop/tests/run-tests.sh b/dcop/tests/run-tests.sh
index 7ec749217..dc3640511 100644
--- a/dcop/tests/run-tests.sh
+++ b/dcop/tests/run-tests.sh
@@ -2,10 +2,15 @@
clean_up() {
rm -f batch.stdout shell.stdout shell.returns batch.returns
+ rm -fr test-home
}
clean_up
+# create temporary home
+export HOME=$PWD/test-home
+mkdir $HOME
+
../dcopserver --nofork &
DCOP_SERVER_PID=$!
diff --git a/kio/tests/kmimetypetest.sh.cmake b/kio/tests/kmimetypetest.sh.cmake
index d4030c57d..e86d85665 100644
--- a/kio/tests/kmimetypetest.sh.cmake
+++ b/kio/tests/kmimetypetest.sh.cmake
@@ -1,10 +1,10 @@
#!/bin/sh
-# create profile for test
-KDEHOME=@CMAKE_CURRENT_BINARY_DIR@/profile
-mkdir $KDEHOME $KDEHOME/share
-ln -s @CMAKE_SOURCE_DIR@/mimetypes $KDEHOME/share/mimelnk
-export KDEHOME
+# create temporary home
+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
# run dcop server
../../dcop/dcopserver --nofork &
@@ -19,5 +19,5 @@ STATE=$?
# cleanup
kill $DCOP_SERVER_PID
-rm -fr $KDEHOME
+rm -fr test-home
exit $STATE
diff --git a/kwallet/backend/tests/CMakeLists.txt b/kwallet/backend/tests/CMakeLists.txt
index efbd2c5ee..52e2868f0 100644
--- a/kwallet/backend/tests/CMakeLists.txt
+++ b/kwallet/backend/tests/CMakeLists.txt
@@ -26,7 +26,9 @@ link_directories(
)
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
SOURCES testbf.cpp ../blockcipher.cc ../blowfish.cc
LINK kwalletbackend-shared kwalletclient-shared TEST )
diff --git a/kwallet/backend/tests/backendtest.sh b/kwallet/backend/tests/backendtest.sh
new file mode 100644
index 000000000..d3a6ef0e1
--- /dev/null
+++ b/kwallet/backend/tests/backendtest.sh
@@ -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