From c0e98d232c4a628e5e127407fc9c9eccc206c740 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 16 Sep 2011 17:40:29 +0100 Subject: [PATCH 1/5] Simplify generation of bus configuration files --- cmake/CMakeLists.txt | 4 +--- configure.ac | 13 +++---------- .../debug-allow-all-fail.conf.cmake | 2 +- .../debug-allow-all-fail.conf.in | 2 +- .../debug-allow-all-pass.conf.cmake | 2 +- .../debug-allow-all-pass.conf.in | 2 +- .../debug-allow-all-sha1.conf.cmake | 2 +- .../debug-allow-all-sha1.conf.in | 2 +- .../valid-config-files/debug-allow-all.conf.cmake | 2 +- .../valid-config-files/debug-allow-all.conf.in | 2 +- 10 files changed, 12 insertions(+), 21 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 750e3f1..02cc73e 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -479,9 +479,7 @@ add_definitions(${DBUS_BUS_CFLAGS} -DDBUS_API_SUBJECT_TO_CHANGE) 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) diff --git a/configure.ac b/configure.ac index 23e886f..b1f5bd7 100644 --- a/configure.ac +++ b/configure.ac @@ -1486,12 +1486,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", @@ -1499,10 +1493,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) diff --git a/test/data/valid-config-files-system/debug-allow-all-fail.conf.cmake b/test/data/valid-config-files-system/debug-allow-all-fail.conf.cmake index 0c73d8c..854bfe9 100644 --- a/test/data/valid-config-files-system/debug-allow-all-fail.conf.cmake +++ b/test/data/valid-config-files-system/debug-allow-all-fail.conf.cmake @@ -6,7 +6,7 @@ @TEST_LISTEN@ system @TEST_LAUNCH_HELPER_BINARY@ - @TEST_INVALID_SERVICE_SYSTEM_DIR@ + @DBUS_TEST_DATA@/invalid-service-files-system diff --git a/test/data/valid-config-files-system/debug-allow-all-fail.conf.in b/test/data/valid-config-files-system/debug-allow-all-fail.conf.in index 93a548c..a61244b 100644 --- a/test/data/valid-config-files-system/debug-allow-all-fail.conf.in +++ b/test/data/valid-config-files-system/debug-allow-all-fail.conf.in @@ -7,7 +7,7 @@ unix:tmpdir=@TEST_SOCKET_DIR@ system @TEST_LAUNCH_HELPER_BINARY@ - @TEST_INVALID_SERVICE_SYSTEM_DIR@ + @DBUS_TEST_DATA@/invalid-service-files-system diff --git a/test/data/valid-config-files-system/debug-allow-all-pass.conf.cmake b/test/data/valid-config-files-system/debug-allow-all-pass.conf.cmake index d46ec18..1ac5c20 100644 --- a/test/data/valid-config-files-system/debug-allow-all-pass.conf.cmake +++ b/test/data/valid-config-files-system/debug-allow-all-pass.conf.cmake @@ -6,7 +6,7 @@ @TEST_LISTEN@ system @TEST_LAUNCH_HELPER_BINARY@ - @TEST_VALID_SERVICE_SYSTEM_DIR@ + @DBUS_TEST_DATA@/valid-service-files-system diff --git a/test/data/valid-config-files-system/debug-allow-all-pass.conf.in b/test/data/valid-config-files-system/debug-allow-all-pass.conf.in index 5b7ffd1..6105d84 100644 --- a/test/data/valid-config-files-system/debug-allow-all-pass.conf.in +++ b/test/data/valid-config-files-system/debug-allow-all-pass.conf.in @@ -7,7 +7,7 @@ unix:tmpdir=@TEST_SOCKET_DIR@ system @TEST_LAUNCH_HELPER_BINARY@ - @TEST_VALID_SERVICE_SYSTEM_DIR@ + @DBUS_TEST_DATA@/valid-service-files-system diff --git a/test/data/valid-config-files/debug-allow-all-sha1.conf.cmake b/test/data/valid-config-files/debug-allow-all-sha1.conf.cmake index 416267c..0c66f2a 100644 --- a/test/data/valid-config-files/debug-allow-all-sha1.conf.cmake +++ b/test/data/valid-config-files/debug-allow-all-sha1.conf.cmake @@ -4,7 +4,7 @@ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> @TEST_LISTEN@ - @TEST_VALID_SERVICE_DIR@ + @DBUS_TEST_DATA@/valid-service-files DBUS_COOKIE_SHA1 diff --git a/test/data/valid-config-files/debug-allow-all-sha1.conf.in b/test/data/valid-config-files/debug-allow-all-sha1.conf.in index 34c5085..ba68f45 100644 --- a/test/data/valid-config-files/debug-allow-all-sha1.conf.in +++ b/test/data/valid-config-files/debug-allow-all-sha1.conf.in @@ -5,7 +5,7 @@ debug-pipe:name=test-server unix:tmpdir=@TEST_SOCKET_DIR@ - @TEST_VALID_SERVICE_DIR@ + @DBUS_TEST_DATA@/valid-service-files DBUS_COOKIE_SHA1 diff --git a/test/data/valid-config-files/debug-allow-all.conf.cmake b/test/data/valid-config-files/debug-allow-all.conf.cmake index 94bb21e..adc3aa5 100644 --- a/test/data/valid-config-files/debug-allow-all.conf.cmake +++ b/test/data/valid-config-files/debug-allow-all.conf.cmake @@ -4,7 +4,7 @@ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> @TEST_LISTEN@ - @TEST_VALID_SERVICE_DIR@ + @DBUS_TEST_DATA@/valid-service-files diff --git a/test/data/valid-config-files/debug-allow-all.conf.in b/test/data/valid-config-files/debug-allow-all.conf.in index 3514296..a086976 100644 --- a/test/data/valid-config-files/debug-allow-all.conf.in +++ b/test/data/valid-config-files/debug-allow-all.conf.in @@ -5,7 +5,7 @@ debug-pipe:name=test-server unix:tmpdir=@TEST_SOCKET_DIR@ - @TEST_VALID_SERVICE_DIR@ + @DBUS_TEST_DATA@/valid-service-files -- 1.7.6.3