Browse Source

testing: run tdeio/kmimetypetest with temporary profile

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/1/head
Slávek Banko 2 years ago
parent
commit
4d3d8d8653
2 changed files with 33 additions and 1 deletions
  1. 10
    1
      tdeio/tests/CMakeLists.txt
  2. 23
    0
      tdeio/tests/kmimetypetest.sh.cmake

+ 10
- 1
tdeio/tests/CMakeLists.txt View File

@@ -53,6 +53,7 @@ set( CHECKS
53 53
   kmimemagictest kpropsdlgtest kprotocolinfotest kruntest kscantest kshredtest
54 54
   ktartest kurifiltertest kurlcompletiontest kziptest metatest netaccesstest
55 55
   previewtest speed tdeioslavetest tdesycocatest tdesycocaupdatetest
56
+  kmimetypetest
56 57
 )
57 58
 
58 59
 foreach( _check ${CHECKS} )
@@ -67,10 +68,18 @@ endforeach( )
67 68
 #  - kurifiltertest requires network access and GUI
68 69
 #  - tdesycocatest requires installed tdebase and GUI
69 70
 
70
-set( TESTS dataprotocoltest kacltest kmimetypetest )
71
+set( TESTS dataprotocoltest kacltest )
71 72
 
72 73
 foreach( _check ${TESTS} )
73 74
     tde_add_check_executable( ${_check} AUTOMOC LINK tdeio-shared TEST)
74 75
 endforeach( )
75 76
 
77
+
78
+configure_file( kmimetypetest.sh.cmake kmimetypetest.sh @ONLY )
79
+
80
+add_test( NAME "tdeio/kmimetypetest"
81
+    COMMAND sh -x "${CMAKE_CURRENT_BINARY_DIR}/kmimetypetest.sh"
82
+    WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" )
83
+
84
+
76 85
 # TODO add kdirwatchunittest

+ 23
- 0
tdeio/tests/kmimetypetest.sh.cmake View File

@@ -0,0 +1,23 @@
1
+#!/bin/sh
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
8
+
9
+# run dcop server
10
+../../dcop/dcopserver --nofork &
11
+DCOP_SERVER_PID=$!
12
+
13
+# update tdesycoca using mime types from source
14
+../../kded/tdebuildsycoca --noincremental --nosignal
15
+
16
+# perform test
17
+./kmimetypetest
18
+STATE=$?
19
+
20
+# cleanup
21
+kill $DCOP_SERVER_PID
22
+rm -fr $TDEHOME
23
+exit $STATE

Loading…
Cancel
Save