Browse Source

testing: Run tests that use DCOP in a temporary home

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/1/head
Slávek Banko 2 years ago
parent
commit
df203a23f4

+ 5
- 0
dcop/tests/run-tests.sh View File

@@ -2,10 +2,15 @@
2 2
 
3 3
 clean_up() {
4 4
 	rm -f batch.stdout shell.stdout shell.returns batch.returns
5
+	rm -fr test-home
5 6
 }
6 7
 
7 8
 clean_up
8 9
 
10
+# create temporary home
11
+export HOME=$PWD/test-home
12
+mkdir $HOME
13
+
9 14
 ../dcopserver --nofork &
10 15
 DCOP_SERVER_PID=$!
11 16
 

+ 6
- 6
tdeio/tests/kmimetypetest.sh.cmake View File

@@ -1,10 +1,10 @@
1 1
 #!/bin/sh
2 2
 
3
-# create profile for test
4
-TDEHOME=@CMAKE_CURRENT_BINARY_DIR@/profile
5
-mkdir $TDEHOME $TDEHOME/share
6
-ln -s @CMAKE_SOURCE_DIR@/mimetypes $TDEHOME/share/mimelnk
7
-export TDEHOME
3
+# create temporary home
4
+HOME=@CMAKE_CURRENT_BINARY_DIR@/test-home
5
+mkdir $HOME $HOME/.trinity $HOME/.trinity/share
6
+ln -s @CMAKE_SOURCE_DIR@/mimetypes $HOME/.trinity/share/mimelnk
7
+export HOME
8 8
 
9 9
 # run dcop server
10 10
 ../../dcop/dcopserver --nofork &
@@ -19,5 +19,5 @@ STATE=$?
19 19
 
20 20
 # cleanup
21 21
 kill $DCOP_SERVER_PID
22
-rm -fr $TDEHOME
22
+rm -fr test-home
23 23
 exit $STATE

+ 3
- 1
tdewallet/backend/tests/CMakeLists.txt View File

@@ -26,7 +26,9 @@ link_directories(
26 26
 )
27 27
 
28 28
 tde_add_check_executable( backendtest AUTOMOC
29
-    LINK tdewalletbackend-shared tdewalletclient-shared TEST )
29
+    LINK tdewalletbackend-shared tdewalletclient-shared )
30
+add_test( NAME "tdewallet/backed/backendtest"
31
+    COMMAND sh -x "${CMAKE_CURRENT_SOURCE_DIR}/backendtest.sh" )
30 32
 tde_add_check_executable( testbf AUTOMOC
31 33
     SOURCES testbf.cpp ../blockcipher.cc ../blowfish.cc
32 34
     LINK tdewalletbackend-shared tdewalletclient-shared TEST )

+ 18
- 0
tdewallet/backend/tests/backendtest.sh View File

@@ -0,0 +1,18 @@
1
+#!/bin/sh
2
+
3
+# create temporary home
4
+export HOME=$PWD/test-home
5
+mkdir $HOME
6
+
7
+# run dcop server
8
+../../../dcop/dcopserver --nofork &
9
+DCOP_SERVER_PID=$!
10
+
11
+# perform test
12
+./backendtest
13
+STATE=$?
14
+
15
+# cleanup
16
+kill $DCOP_SERVER_PID
17
+rm -fr test-home
18
+exit $STATE

Loading…
Cancel
Save