summaryrefslogtreecommitdiffstats
path: root/tdewallet/backend
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-02-01 01:57:58 +0100
commit7502543922ab40b45c5bd47034995f15bc76c757 (patch)
treed49400a69669dcbaf25af04607c6316bb13a8464 /tdewallet/backend
parentb9d5e48086a0597e946bbae4c7dd6bfb5b8e60ea (diff)
downloadtdelibs-7502543922ab40b45c5bd47034995f15bc76c757.tar.gz
tdelibs-7502543922ab40b45c5bd47034995f15bc76c757.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)
Diffstat (limited to 'tdewallet/backend')
-rw-r--r--tdewallet/backend/tests/CMakeLists.txt4
-rw-r--r--tdewallet/backend/tests/backendtest.sh18
2 files changed, 21 insertions, 1 deletions
diff --git a/tdewallet/backend/tests/CMakeLists.txt b/tdewallet/backend/tests/CMakeLists.txt
index 7677f291d..275891ae7 100644
--- a/tdewallet/backend/tests/CMakeLists.txt
+++ b/tdewallet/backend/tests/CMakeLists.txt
@@ -26,7 +26,9 @@ link_directories(
)
tde_add_check_executable( backendtest AUTOMOC
- LINK tdewalletbackend-shared tdewalletclient-shared TEST )
+ LINK tdewalletbackend-shared tdewalletclient-shared )
+add_test( NAME "tdewallet/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 tdewalletbackend-shared tdewalletclient-shared TEST )
diff --git a/tdewallet/backend/tests/backendtest.sh b/tdewallet/backend/tests/backendtest.sh
new file mode 100644
index 000000000..d3a6ef0e1
--- /dev/null
+++ b/tdewallet/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