summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2017-02-01 00:57:20 (GMT)
committer Slávek Banko <slavek.banko@axis.cz>2017-02-01 00:57:30 (GMT)
commitdf203a23f4d96fae5fbc61bb180c4db8f63e63ae (patch)
tree798af92473cec0f7366e5835cac77f99e28dbb59
parent7cc97cb18734939136579c086bf6758f3a4c18ad (diff)
downloadtdelibs-df203a23.zip
tdelibs-df203a23.tar.gz
testing: Run tests that use DCOP in a temporary home
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--dcop/tests/run-tests.sh5
-rw-r--r--tdeio/tests/kmimetypetest.sh.cmake12
-rw-r--r--tdewallet/backend/tests/CMakeLists.txt4
-rw-r--r--tdewallet/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 7ec7492..dc36405 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/tdeio/tests/kmimetypetest.sh.cmake b/tdeio/tests/kmimetypetest.sh.cmake
index a242b8d..3bcd986 100644
--- a/tdeio/tests/kmimetypetest.sh.cmake
+++ b/tdeio/tests/kmimetypetest.sh.cmake
@@ -1,10 +1,10 @@
#!/bin/sh
-# create profile for test
-TDEHOME=@CMAKE_CURRENT_BINARY_DIR@/profile
-mkdir $TDEHOME $TDEHOME/share
-ln -s @CMAKE_SOURCE_DIR@/mimetypes $TDEHOME/share/mimelnk
-export TDEHOME
+# 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 $TDEHOME
+rm -fr test-home
exit $STATE
diff --git a/tdewallet/backend/tests/CMakeLists.txt b/tdewallet/backend/tests/CMakeLists.txt
index 7677f29..275891a 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 0000000..d3a6ef0
--- a/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