]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
test: Split slow parts of the former test-dbus into their own executables
authorSimon McVittie <smcv@collabora.com>
Thu, 15 Nov 2018 15:48:26 +0000 (15:48 +0000)
committerSimon McVittie <smcv@collabora.com>
Mon, 21 Jan 2019 15:20:04 +0000 (15:20 +0000)
This makes it easier for a developer to run just the fast parts while
debugging some issue reproduced by the faster tests.

Signed-off-by: Simon McVittie <smcv@collabora.com>
cmake/test/CMakeLists.txt
test/Makefile.am
test/internals/hash.c [new file with mode: 0644]
test/internals/marshal-recursive.c [new file with mode: 0644]
test/internals/message-internals.c [new file with mode: 0644]
test/internals/misc-internals.c

index d67fe1ecd976955d1809a34dbafaeffc31b907f8..ff70fc2c6b7e87bd0a3b7e9c4fddcc728960f773 100644 (file)
@@ -93,6 +93,15 @@ if(WIN32)
 endif()
 
 if(DBUS_ENABLE_EMBEDDED_TESTS)
+    add_test_executable(test-hash ${TEST_DIR}/internals/hash.c dbus-testutils)
+    set_target_properties(test-hash PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
+
+    add_test_executable(test-marshal-recursive ${TEST_DIR}/internals/marshal-recursive.c dbus-testutils)
+    set_target_properties(test-marshal-recursive PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
+
+    add_test_executable(test-message-internals ${TEST_DIR}/internals/message-internals.c dbus-testutils)
+    set_target_properties(test-message-internals PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
+
     add_test_executable(test-misc-internals ${TEST_DIR}/internals/misc-internals.c dbus-testutils)
     set_target_properties(test-misc-internals PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
 
index eecfec859cf1999c3aecea75206f6a52dfb55ec5..58e725598fb306a91760a53dc9bb8828ea56d776 100644 (file)
@@ -83,6 +83,9 @@ uninstallable_test_programs += \
        test-bus \
        test-bus-dispatch \
        test-bus-dispatch-sha1 \
+       test-hash \
+       test-marshal-recursive \
+       test-message-internals \
        test-misc-internals \
        $(NULL)
 
@@ -197,6 +200,15 @@ test_bus_dispatch_sha1_LDADD = \
        libdbus-testutils.la \
        $(NULL)
 
+test_hash_SOURCES = internals/hash.c
+test_hash_LDADD = libdbus-testutils.la
+
+test_marshal_recursive_SOURCES = internals/marshal-recursive.c
+test_marshal_recursive_LDADD = libdbus-testutils.la
+
+test_message_internals_SOURCES = internals/message-internals.c
+test_message_internals_LDADD = libdbus-testutils.la
+
 test_misc_internals_SOURCES = internals/misc-internals.c
 test_misc_internals_LDADD = libdbus-testutils.la
 
diff --git a/test/internals/hash.c b/test/internals/hash.c
new file mode 100644 (file)
index 0000000..f6faa73
--- /dev/null
@@ -0,0 +1,39 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/*
+ * Copyright 2002-2009 Red Hat, Inc.
+ * Copyright 2011-2018 Collabora Ltd.
+ *
+ * Licensed under the Academic Free License version 2.1
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#include <config.h>
+
+#include "dbus/dbus-internals.h"
+#include "dbus/dbus-test.h"
+#include "test/test-utils.h"
+
+static DBusTestCase test = { "hash", _dbus_hash_test };
+
+int
+main (int    argc,
+      char **argv)
+{
+  return _dbus_test_main (argc, argv, 1, &test,
+                          DBUS_TEST_FLAGS_CHECK_MEMORY_LEAKS,
+                          NULL, NULL);
+}
diff --git a/test/internals/marshal-recursive.c b/test/internals/marshal-recursive.c
new file mode 100644 (file)
index 0000000..bfa3f69
--- /dev/null
@@ -0,0 +1,39 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/*
+ * Copyright 2002-2009 Red Hat, Inc.
+ * Copyright 2011-2018 Collabora Ltd.
+ *
+ * Licensed under the Academic Free License version 2.1
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#include <config.h>
+
+#include "dbus/dbus-internals.h"
+#include "dbus/dbus-test.h"
+#include "test/test-utils.h"
+
+static DBusTestCase test = { "marshal-recursive", _dbus_marshal_recursive_test };
+
+int
+main (int    argc,
+      char **argv)
+{
+  return _dbus_test_main (argc, argv, 1, &test,
+                          DBUS_TEST_FLAGS_CHECK_MEMORY_LEAKS,
+                          NULL, NULL);
+}
diff --git a/test/internals/message-internals.c b/test/internals/message-internals.c
new file mode 100644 (file)
index 0000000..1a8e255
--- /dev/null
@@ -0,0 +1,39 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/*
+ * Copyright 2002-2009 Red Hat, Inc.
+ * Copyright 2011-2018 Collabora Ltd.
+ *
+ * Licensed under the Academic Free License version 2.1
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#include <config.h>
+
+#include "dbus/dbus-internals.h"
+#include "dbus/dbus-test.h"
+#include "test/test-utils.h"
+
+static DBusTestCase test = { "message", _dbus_message_test };
+
+int
+main (int    argc,
+      char **argv)
+{
+  return _dbus_test_main (argc, argv, 1, &test,
+                          DBUS_TEST_FLAGS_CHECK_MEMORY_LEAKS,
+                          NULL, NULL);
+}
index 084d2e2b3752ecb27271a11c204f3c15a8b9c977..54094abee33d3c6e6f7d9f48b8afa6186a301b9e 100644 (file)
@@ -38,14 +38,11 @@ static DBusTestCase tests[] =
   { "object-tree", _dbus_object_tree_test },
   { "signature", _dbus_signature_test },
   { "marshalling", _dbus_marshal_test },
-  { "marshal-recursive" , _dbus_marshal_recursive_test },
   { "byteswap", _dbus_marshal_byteswap_test },
   { "memory", _dbus_memory_test },
   { "mem-pool", _dbus_mem_pool_test },
   { "list", _dbus_list_test },
   { "marshal-validate", _dbus_marshal_validate_test },
-  { "message", _dbus_message_test },
-  { "hash", _dbus_hash_test },
   { "credentials", _dbus_credentials_test },
   { "keyring", _dbus_keyring_test },
   { "sha", _dbus_sha_test },