From: Simon McVittie Date: Wed, 3 Oct 2018 18:15:38 +0000 (+0100) Subject: test: Move libdbus embedded tests from dbus/ to test/ X-Git-Tag: dbus-1.13.10~25^2~21 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b28e0886ed58570b769d1ea7a8c6518e0fc0237f;p=thirdparty%2Fdbus.git test: Move libdbus embedded tests from dbus/ to test/ This groups them with the rest of the tests, and enables parts of the test code to be unembedded from libdbus and moved to test/ too. Rename the executable to test-misc-internals, not test-dbus. The name test-dbus made some sense as "the executable that contains the code in dbus/", but makes a lot less sense in test/: dbus is the name of the entire project, so this test has no particular special claim to that name. test-libdbus doesn't seem right either, because all the tests exercise libdbus one way or another. Signed-off-by: Simon McVittie --- diff --git a/cmake/dbus/CMakeLists.txt b/cmake/dbus/CMakeLists.txt index d25cc9615..e178cc022 100644 --- a/cmake/dbus/CMakeLists.txt +++ b/cmake/dbus/CMakeLists.txt @@ -341,11 +341,6 @@ else(WIN32) endif() endif(WIN32) -if (DBUS_ENABLE_EMBEDDED_TESTS) - add_test_executable(test-dbus ${CMAKE_SOURCE_DIR}/../dbus/dbus-test-main.c ${DBUS_INTERNAL_LIBRARIES}) - set_target_properties(test-dbus PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS}) -ENDIF (DBUS_ENABLE_EMBEDDED_TESTS) - if (UNIX) # set version info ENDIF (UNIX) diff --git a/cmake/test/CMakeLists.txt b/cmake/test/CMakeLists.txt index 021438981..ccc783e75 100644 --- a/cmake/test/CMakeLists.txt +++ b/cmake/test/CMakeLists.txt @@ -93,6 +93,9 @@ if(WIN32) endif() if(DBUS_ENABLE_EMBEDDED_TESTS) + add_test_executable(test-misc-internals ${TEST_DIR}/internals/misc-internals.c ${DBUS_INTERNAL_LIBRARIES}) + set_target_properties(test-misc-internals PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS}) + set(SOURCES ${TEST_DIR}/bus/main.c) add_test_executable(test-bus "${SOURCES}" dbus-daemon-internal ${DBUS_INTERNAL_LIBRARIES} ${EXPAT_LIBRARIES}) set_target_properties(test-bus PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS}) diff --git a/dbus/Makefile.am b/dbus/Makefile.am index aa0f5ed0b..c8c6dffcf 100644 --- a/dbus/Makefile.am +++ b/dbus/Makefile.am @@ -324,16 +324,6 @@ endif noinst_PROGRAMS = -if DBUS_ENABLE_EMBEDDED_TESTS -# We can't actually run this til we've reached test/ -noinst_PROGRAMS += test-dbus -endif - -test_dbus_SOURCES= \ - dbus-test-main.c - -test_dbus_LDADD = libdbus-internal.la - # Add rules for code-coverage testing, as defined by AX_CODE_COVERAGE @CODE_COVERAGE_RULES@ diff --git a/test/Makefile.am b/test/Makefile.am index 475fb214a..63d748c0c 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -83,6 +83,7 @@ uninstallable_test_programs += \ test-bus \ test-bus-dispatch \ test-bus-dispatch-sha1 \ + test-misc-internals \ $(NULL) if DBUS_UNIX @@ -90,8 +91,6 @@ uninstallable_test_programs += test-bus-launch-helper-oom uninstallable_test_programs += test-bus-system endif -TESTS += ../dbus/test-dbus$(EXEEXT) - noinst_PROGRAMS += $(uninstallable_test_programs) TESTS += $(uninstallable_test_programs) @@ -178,6 +177,9 @@ test_bus_dispatch_LDADD = $(top_builddir)/bus/libdbus-daemon-internal.la test_bus_dispatch_sha1_SOURCES = bus/dispatch-sha1.c test_bus_dispatch_sha1_LDADD = $(top_builddir)/bus/libdbus-daemon-internal.la +test_misc_internals_SOURCES = internals/misc-internals.c +test_misc_internals_LDADD = $(top_builddir)/dbus/libdbus-internal.la + EXTRA_DIST += dbus-test-runner testexecdir = $(libexecdir)/installed-tests/dbus diff --git a/dbus/dbus-test-main.c b/test/internals/misc-internals.c similarity index 92% rename from dbus/dbus-test-main.c rename to test/internals/misc-internals.c index 76036d9c2..999cbaa7c 100644 --- a/dbus/dbus-test-main.c +++ b/test/internals/misc-internals.c @@ -1,7 +1,7 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ -/* dbus-test.c Program to run all tests - * - * Copyright (C) 2002 Red Hat Inc. +/* + * Copyright 2002-2009 Red Hat, Inc. + * Copyright 2011-2018 Collabora Ltd. * * Licensed under the Academic Free License version 2.1 * @@ -23,9 +23,9 @@ #include -#include "dbus-internals.h" -#include "dbus-test.h" -#include "dbus-test-wrappers.h" +#include "dbus/dbus-internals.h" +#include "dbus/dbus-test.h" +#include "dbus/dbus-test-wrappers.h" static DBusTestCase tests[] = {