]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
test: Move auth, credentials tests from libdbus-internal into test/
authorSimon McVittie <smcv@collabora.com>
Fri, 28 Sep 2018 15:27:42 +0000 (16:27 +0100)
committerSimon McVittie <smcv@collabora.com>
Mon, 21 Jan 2019 15:20:22 +0000 (15:20 +0000)
Signed-off-by: Simon McVittie <smcv@collabora.com>
cmake/dbus/CMakeLists.txt
cmake/test/CMakeLists.txt
dbus/Makefile.am
dbus/dbus-test.h
test/Makefile.am
test/internals/dbus-auth-script.c [moved from dbus/dbus-auth-script.c with 99% similarity]
test/internals/dbus-auth-script.h [moved from dbus/dbus-auth-script.h with 100% similarity]
test/internals/dbus-auth-util.c [moved from dbus/dbus-auth-util.c with 96% similarity]
test/internals/dbus-credentials-util.c [moved from dbus/dbus-credentials-util.c with 98% similarity]
test/internals/misc-internals.c
test/internals/misc-internals.h [new file with mode: 0644]

index 29b73b4379496386a3c1a1d9239d2b37cf5399f2..2931415e05cb5d52980b2757bdb0de735688385d 100644 (file)
@@ -152,9 +152,6 @@ set (DBUS_SHARED_HEADERS
 ### to be unless they move to DBUS_SHARED_SOURCES later)
 set (DBUS_UTIL_SOURCES
        ${DBUS_DIR}/dbus-asv-util.c
-       ${DBUS_DIR}/dbus-auth-script.c
-       ${DBUS_DIR}/dbus-auth-util.c
-       ${DBUS_DIR}/dbus-credentials-util.c
        ${DBUS_DIR}/dbus-mainloop.c
        ${DBUS_DIR}/dbus-marshal-byteswap-util.c
        ${DBUS_DIR}/dbus-marshal-recursive-util.c
@@ -170,7 +167,6 @@ set (DBUS_UTIL_SOURCES
 
 set (DBUS_UTIL_HEADERS
        ${DBUS_DIR}/dbus-asv-util.h
-       ${DBUS_DIR}/dbus-auth-script.h
        ${DBUS_DIR}/dbus-mainloop.h
        ${DBUS_DIR}/dbus-message-factory.h
        ${DBUS_DIR}/dbus-shell.h
index ff70fc2c6b7e87bd0a3b7e9c4fddcc728960f773..32efb2c7fbf9c9efef2459d25923108706f93c18 100644 (file)
@@ -102,7 +102,13 @@ if(DBUS_ENABLE_EMBEDDED_TESTS)
     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(SOURCES ${TEST_DIR}/internals/dbus-auth-script.c
+                ${TEST_DIR}/internals/dbus-auth-script.h
+                ${TEST_DIR}/internals/dbus-auth-util.c
+                ${TEST_DIR}/internals/dbus-credentials-util.c
+                ${TEST_DIR}/internals/misc-internals.c
+                ${TEST_DIR}/internals/misc-internals.h)
+    add_test_executable(test-misc-internals "${SOURCES}" dbus-testutils)
     set_target_properties(test-misc-internals PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
 
     set(SOURCES ${TEST_DIR}/bus/main.c)
index d92c5425cb11b133e765b53fafdf1c0a0f76c836..5818c8864582b5e5fde6e58830e9c4376f302312 100644 (file)
@@ -245,10 +245,6 @@ DBUS_SHARED_SOURCES=                               \
 DBUS_UTIL_SOURCES=                             \
        dbus-asv-util.c                         \
        dbus-asv-util.h                         \
-       dbus-auth-script.c                      \
-       dbus-auth-script.h                      \
-       dbus-auth-util.c                        \
-       dbus-credentials-util.c                 \
        dbus-mainloop.c                         \
        dbus-mainloop.h                         \
        dbus-marshal-byteswap-util.c            \
index 6be55f39680c3c4e1b8c883600045f3242bbe754..9d6e755c4f49ab61be1989e0a74c19f8fc35122a 100644 (file)
@@ -65,7 +65,6 @@ DBUS_PRIVATE_EXPORT
 dbus_bool_t _dbus_server_test            (const char *test_data_dir);
 
 dbus_bool_t _dbus_message_test           (const char *test_data_dir);
-dbus_bool_t _dbus_auth_test              (const char *test_data_dir);
 
 DBUS_PRIVATE_EXPORT
 dbus_bool_t _dbus_sha_test               (const char *test_data_dir);
@@ -90,8 +89,6 @@ dbus_bool_t _dbus_memory_test            (const char *test_data_dir);
 DBUS_PRIVATE_EXPORT
 dbus_bool_t _dbus_object_tree_test       (const char *test_data_dir);
 
-dbus_bool_t _dbus_credentials_test       (const char *test_data_dir);
-
 dbus_bool_t _dbus_test_generate_bodies   (int         sequence,
                                           int         byte_order,
                                           DBusString *signature,
index 58e725598fb306a91760a53dc9bb8828ea56d776..451655b39ee0f23901851b941660624c11565cf1 100644 (file)
@@ -209,7 +209,14 @@ 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_SOURCES = \
+       internals/dbus-auth-script.c \
+       internals/dbus-auth-script.h \
+       internals/dbus-auth-util.c \
+       internals/dbus-credentials-util.c \
+       internals/misc-internals.c \
+       internals/misc-internals.h \
+       $(NULL)
 test_misc_internals_LDADD = libdbus-testutils.la
 
 EXTRA_DIST += dbus-test-runner
similarity index 99%
rename from dbus/dbus-auth-script.c
rename to test/internals/dbus-auth-script.c
index e78440237d01f712675348d128f9401dcb2132cf..85103010992639f1c1e7a197de95c82b26920c0f 100644 (file)
 
 #ifdef DBUS_ENABLE_EMBEDDED_TESTS
 
+#include "misc-internals.h"
+
 #include "dbus-auth-script.h"
 
 #include <stdio.h>
 
-#include "dbus-auth.h"
-#include "dbus-string.h"
-#include "dbus-hash.h"
-#include "dbus-credentials.h"
-#include "dbus-internals.h"
-#include <dbus/dbus-test-tap.h>
+#include "dbus/dbus-auth.h"
+#include "dbus/dbus-credentials.h"
+#include "dbus/dbus-hash.h"
+#include "dbus/dbus-internals.h"
+#include "dbus/dbus-string.h"
+#include "dbus/dbus-test-tap.h"
 
 #ifdef DBUS_UNIX
 # include "dbus/dbus-userdb.h"
similarity index 96%
rename from dbus/dbus-auth-util.c
rename to test/internals/dbus-auth-util.c
index 5fb30a8e4e6cfe8dffda17960f71a250f88102f4..bd862b0eef39aea4ae13f4fbd673ac264b67963b 100644 (file)
  */
 
 #include <config.h>
-#include "dbus-internals.h"
-#include "dbus-test.h"
-#include "dbus-auth.h"
-#include <dbus/dbus-test-tap.h>
+
+#include "misc-internals.h"
+
+#include "dbus/dbus-auth.h"
+#include "dbus/dbus-internals.h"
+#include "dbus/dbus-test-tap.h"
+#include "dbus/dbus-test.h"
 
 /**
  * @addtogroup DBusAuth
similarity index 98%
rename from dbus/dbus-credentials-util.c
rename to test/internals/dbus-credentials-util.c
index 7855b79743c9ea5d7c1d62557889fadb94b2eff7..8c497b2287f3785802f20961332565064939cfd1 100644 (file)
  */
 
 #include <config.h>
-#include "dbus-internals.h"
-#include "dbus-test.h"
-#include "dbus-credentials.h"
-#include <dbus/dbus-test-tap.h>
+
+#include "misc-internals.h"
+
+#include "dbus/dbus-credentials.h"
+#include "dbus/dbus-internals.h"
+#include "dbus/dbus-test-tap.h"
+#include "dbus/dbus-test.h"
 
 /**
  * @addtogroup DBusCredentials
index 54094abee33d3c6e6f7d9f48b8afa6186a301b9e..579b00e7e2f5295467e16620e9ec9fcad8f267ea 100644 (file)
@@ -27,6 +27,8 @@
 #include "dbus/dbus-test.h"
 #include "test/test-utils.h"
 
+#include "misc-internals.h"
+
 static DBusTestCase tests[] =
 {
   { "string", _dbus_string_test },
diff --git a/test/internals/misc-internals.h b/test/internals/misc-internals.h
new file mode 100644 (file)
index 0000000..3b14d42
--- /dev/null
@@ -0,0 +1,32 @@
+/* -*- 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
+ *
+ */
+
+#ifndef TEST_INTERNALS_MISC_INTERNALS_H
+#define TEST_INTERNALS_MISC_INTERNALS_H
+
+#include <dbus/dbus-types.h>
+
+dbus_bool_t _dbus_auth_test              (const char *test_data_dir);
+dbus_bool_t _dbus_credentials_test       (const char *test_data_dir);
+
+#endif