summaryrefslogtreecommitdiffstats
path: root/tdeio/tests/kmimetypetest.sh.cmake
blob: 55a0ffbc6f79b696766e35f4199f140523a38ba6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

# 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
export ICEAUTHORITY=$HOME/.ICEauthority

# run dcop server
../../dcop/dcopserver --nofork &
DCOP_SERVER_PID=$!

while ! ../../dcop/dcopserver --serverid 2>/dev/null; do
  sleep 2
done

# update tdesycoca using mime types from source
../../kded/tdebuildsycoca --noincremental --nosignal

# perform test
./kmimetypetest
STATE=$?

# cleanup
kill $DCOP_SERVER_PID
rm -fr test-home
exit $STATE