]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
test: Move libdbus embedded tests from dbus/ to test/
authorSimon McVittie <smcv@collabora.com>
Wed, 3 Oct 2018 18:15:38 +0000 (19:15 +0100)
committerSimon McVittie <smcv@collabora.com>
Mon, 21 Jan 2019 15:18:18 +0000 (15:18 +0000)
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 <smcv@collabora.com>
cmake/dbus/CMakeLists.txt
cmake/test/CMakeLists.txt
dbus/Makefile.am
test/Makefile.am
test/internals/misc-internals.c [moved from dbus/dbus-test-main.c with 92% similarity]

index d25cc96158c602ba2e5f64a5ff5a1abffbf22e03..e178cc0221f678bf7b5b40d5927ed39ceef4edde 100644 (file)
@@ -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)
index 021438981dd68d4e5f8f025c2d9dba7144a3b093..ccc783e757d94bdbf22c9fb85df65c7326e229ec 100644 (file)
@@ -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})
index aa0f5ed0b9e013f5e03ea5fc4af2287a0bd9e016..c8c6dffcf7dde18939f0a3dc03a5db265af8e097 100644 (file)
@@ -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@
 
index 475fb214a8cf9396582ff6ce73fe3fd9fcb3cf6e..63d748c0c63da0fadb8cbe7cc9c55c4b113e6a0f 100644 (file)
@@ -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
similarity index 92%
rename from dbus/dbus-test-main.c
rename to test/internals/misc-internals.c
index 76036d9c27b4e895ff918fe693d60aad96b38122..999cbaa7ca5a4d9a96efc2302955ab79a22b3606 100644 (file)
@@ -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 <config.h>
 
-#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[] =
 {