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
4 changed files with 32 additions and 7 deletions
  1. +5
    -0
      dcop/tests/run-tests.sh
  2. +6
    -6
      tdeio/tests/kmimetypetest.sh.cmake
  3. +3
    -1
      tdewallet/backend/tests/CMakeLists.txt
  4. +18
    -0
      tdewallet/backend/tests/backendtest.sh

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

@@ -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=$!


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

@@ -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

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

@@ -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 )

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

@@ -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