Simplify generation of bus configuration files
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Fri, 16 Sep 2011 16:40:29 +0000 (17:40 +0100)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Wed, 28 Sep 2011 18:00:11 +0000 (19:00 +0100)
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41222

cmake/CMakeLists.txt
configure.ac
test/data/valid-config-files-system/debug-allow-all-fail.conf.cmake
test/data/valid-config-files-system/debug-allow-all-fail.conf.in
test/data/valid-config-files-system/debug-allow-all-pass.conf.cmake
test/data/valid-config-files-system/debug-allow-all-pass.conf.in
test/data/valid-config-files/debug-allow-all-sha1.conf.cmake
test/data/valid-config-files/debug-allow-all-sha1.conf.in
test/data/valid-config-files/debug-allow-all.conf.cmake
test/data/valid-config-files/debug-allow-all.conf.in

index 21728a7..cfba103 100644 (file)
@@ -478,9 +478,7 @@ add_definitions(${DBUS_BUS_CFLAGS})
 
 if (DBUS_BUILD_TESTS)
     # set variables used for the .in files (substituted by configure_file) in test/data:
-    set(TEST_VALID_SERVICE_DIR ${CMAKE_BINARY_DIR}/test/data/valid-service-files)
-    set(TEST_VALID_SERVICE_SYSTEM_DIR ${CMAKE_BINARY_DIR}/test/data/valid-service-files-system)
-    set(TEST_INVALID_SERVICE_SYSTEM_DIR ${CMAKE_BINARY_DIR}/test/data/invalid-service-files-system)
+    set(DBUS_TEST_DATA ${CMAKE_BINARY_DIR}/test/data)
     set(TEST_SOCKET_DIR ${DBUS_SESSION_SOCKET_DIR} )
     set(TEST_LAUNCH_HELPER_BINARY ${EXECUTABLE_OUTPUT_PATH}/dbus-daemon-launch-helper-test)
     set(TEST_PRIVSERVER_BINARY ${EXECUTABLE_OUTPUT_PATH}/test-privserver)
index 66bcf20..6c2e2b5 100644 (file)
@@ -1519,12 +1519,6 @@ DBUS_PWD=`pwd`
 # Useful in a cross-compilation environment, where the tests are run on the host system.
 AC_ARG_WITH(dbus-test-dir, AS_HELP_STRING([--with-dbus-test-dir=[dirname]],[path where the tests tools are available]),
                           DBUS_PWD=$withval)
-AC_DEFUN([TEST_PATH], [
-TEST_$1=${DBUS_PWD}/test/$2
-AC_DEFINE_UNQUOTED(TEST_$1, "$TEST_$1",
-                   [Full path to test file test/$2 in builddir])
-AC_SUBST(TEST_$1)
-])
 AC_DEFUN([TEST_PROG], [
 TEST_$1=${DBUS_PWD}/test/$2
 AC_DEFINE_UNQUOTED(TEST_$1, "$TEST_$1$EXEEXT",
@@ -1532,10 +1526,9 @@ AC_DEFINE_UNQUOTED(TEST_$1, "$TEST_$1$EXEEXT",
 AC_SUBST(TEST_$1)
 ])
 
-TEST_PATH(VALID_SERVICE_DIR, data/valid-service-files)
-TEST_PATH(INVALID_SERVICE_DIR, data/invalid-service-files)
-TEST_PATH(VALID_SERVICE_SYSTEM_DIR, data/valid-service-files-system)
-TEST_PATH(INVALID_SERVICE_SYSTEM_DIR, data/invalid-service-files-system)
+DBUS_TEST_DATA="$DBUS_PWD/test/data"
+AC_SUBST([DBUS_TEST_DATA])
+
 TEST_PROG(SERVICE_BINARY, test-service)
 TEST_PROG(SHELL_SERVICE_BINARY, test-shell-service)
 TEST_PROG(EXIT_BINARY, test-exit)
index 0c73d8c..854bfe9 100644 (file)
@@ -6,7 +6,7 @@
   <listen>@TEST_LISTEN@</listen>
   <type>system</type>
   <servicehelper>@TEST_LAUNCH_HELPER_BINARY@</servicehelper>
-  <servicedir>@TEST_INVALID_SERVICE_SYSTEM_DIR@</servicedir>
+  <servicedir>@DBUS_TEST_DATA@/invalid-service-files-system</servicedir>
   <policy context="default">
     <allow send_interface="*"/>
     <allow receive_interface="*"/>
index 93a548c..a61244b 100644 (file)
@@ -7,7 +7,7 @@
   <listen>unix:tmpdir=@TEST_SOCKET_DIR@</listen>
   <type>system</type>
   <servicehelper>@TEST_LAUNCH_HELPER_BINARY@</servicehelper>
-  <servicedir>@TEST_INVALID_SERVICE_SYSTEM_DIR@</servicedir>
+  <servicedir>@DBUS_TEST_DATA@/invalid-service-files-system</servicedir>
   <policy context="default">
     <allow send_interface="*"/>
     <allow receive_interface="*"/>
index d46ec18..1ac5c20 100644 (file)
@@ -6,7 +6,7 @@
   <listen>@TEST_LISTEN@</listen>
   <type>system</type>
   <servicehelper>@TEST_LAUNCH_HELPER_BINARY@</servicehelper>
-  <servicedir>@TEST_VALID_SERVICE_SYSTEM_DIR@</servicedir>
+  <servicedir>@DBUS_TEST_DATA@/valid-service-files-system</servicedir>
   <policy context="default">
     <allow send_interface="*"/>
     <allow receive_interface="*"/>
index 5b7ffd1..6105d84 100644 (file)
@@ -7,7 +7,7 @@
   <listen>unix:tmpdir=@TEST_SOCKET_DIR@</listen>
   <type>system</type>
   <servicehelper>@TEST_LAUNCH_HELPER_BINARY@</servicehelper>
-  <servicedir>@TEST_VALID_SERVICE_SYSTEM_DIR@</servicedir>
+  <servicedir>@DBUS_TEST_DATA@/valid-service-files-system</servicedir>
   <policy context="default">
     <allow send_interface="*"/>
     <allow receive_interface="*"/>
index 416267c..0c66f2a 100644 (file)
@@ -4,7 +4,7 @@
  "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
 <busconfig>
   <listen>@TEST_LISTEN@</listen>
-  <servicedir>@TEST_VALID_SERVICE_DIR@</servicedir>
+  <servicedir>@DBUS_TEST_DATA@/valid-service-files</servicedir>
   <auth>DBUS_COOKIE_SHA1</auth>
   <policy context="default">
     <allow send_interface="*"/>
index 34c5085..ba68f45 100644 (file)
@@ -5,7 +5,7 @@
 <busconfig>
   <listen>debug-pipe:name=test-server</listen>
   <listen>unix:tmpdir=@TEST_SOCKET_DIR@</listen>
-  <servicedir>@TEST_VALID_SERVICE_DIR@</servicedir>
+  <servicedir>@DBUS_TEST_DATA@/valid-service-files</servicedir>
   <auth>DBUS_COOKIE_SHA1</auth>
   <policy context="default">
     <allow send_interface="*"/>
index 94bb21e..adc3aa5 100644 (file)
@@ -4,7 +4,7 @@
  "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
 <busconfig>
   <listen>@TEST_LISTEN@</listen>
-  <servicedir>@TEST_VALID_SERVICE_DIR@</servicedir>
+  <servicedir>@DBUS_TEST_DATA@/valid-service-files</servicedir>
   <policy context="default">
     <allow send_interface="*"/>
     <allow receive_interface="*"/>
index 3514296..a086976 100644 (file)
@@ -5,7 +5,7 @@
 <busconfig>
   <listen>debug-pipe:name=test-server</listen>
   <listen>unix:tmpdir=@TEST_SOCKET_DIR@</listen>
-  <servicedir>@TEST_VALID_SERVICE_DIR@</servicedir>
+  <servicedir>@DBUS_TEST_DATA@/valid-service-files</servicedir>
   <policy context="default">
     <allow send_interface="*"/>
     <allow receive_interface="*"/>