mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2025-12-30 16:30:19 +01:00
This is really three separate test-cases: one for traditional activation as a direct child process of the dbus-daemon, and two for traditional activation (successful and failing) via the setuid dbus-daemon-launch-helper on Unix. The ones where activation succeeds extremely slow, as a result of the instrumentation for simulating malloc() failures combined with a large number of memory operations, particularly when using AddressSanitizer. Splitting up "OOM" tests like these has a disproportionately good impact on the time they take, because the simulated malloc() failure instrumentation repeats the entire test making the first malloc() fail, then making the second malloc() fail, and so on. For allocation failures in the second half of the test, this means we repeat the first half of the test with no malloc() failures a very large number of times, which is not a good use of time, because we already tested it successfully. Even when not using the "OOM" instrumentation, splitting up these tests lets them run in parallel, which is also a major time saving. Needless to say, this speeds up testing considerably. On my modern but unexceptional x86 laptop, in a typical debug build with Meson, the old dispatch test took just over 21 minutes, which drops to about 40 seconds each for the new normal-activation and helper-activation tests (and for most of that time, they're running in parallel, so the wall-clock time taken for the whole test suite is somewhere around a minute). In a debug build with Meson, gcc and AddressSanitizer, the old dispatch test takes longer than my patience will allow, and the new separate tests take about 5-6 minutes each. Reduce their timeout accordingly, but not as far as the default for slow tests (5 minutes) to allow some headroom for AddressSanitizer or slower systems. The failed-helper-activation test is almost instantaneous, and no longer needs to be marked as slow. Signed-off-by: Simon McVittie <smcv@collabora.com>
62 lines
3 KiB
C
62 lines
3 KiB
C
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
/* test.h unit test routines
|
|
*
|
|
* Copyright 2003-2007 Red Hat, Inc.
|
|
* Copyright 2003-2004 Imendio
|
|
* Copyright 2009 Lennart Poettering
|
|
* Copyright 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 BUS_TEST_H
|
|
#define BUS_TEST_H
|
|
|
|
#ifdef DBUS_ENABLE_EMBEDDED_TESTS
|
|
|
|
#include <dbus/dbus.h>
|
|
#include <dbus/dbus-string.h>
|
|
#include "connection.h"
|
|
|
|
typedef dbus_bool_t (* BusConnectionForeachFunction) (DBusConnection *connection,
|
|
void *data);
|
|
|
|
dbus_bool_t bus_test_normal_activation (const char *test_data_dir_cstr);
|
|
dbus_bool_t bus_test_helper_activation (const char *test_data_dir_cstr);
|
|
dbus_bool_t bus_test_failed_helper_activation (const char *test_data_dir_cstr);
|
|
dbus_bool_t bus_dispatch_sha1_test (const char *test_data_dir_cstr);
|
|
dbus_bool_t bus_config_parser_test (const char *test_data_dir_cstr);
|
|
dbus_bool_t bus_config_parser_trivial_test (const char *test_data_dir_cstr);
|
|
dbus_bool_t bus_signals_test (const char *test_data_dir);
|
|
dbus_bool_t bus_expire_list_test (const char *test_data_dir);
|
|
dbus_bool_t bus_activation_service_reload_test (const char *test_data_dir_cstr);
|
|
dbus_bool_t bus_setup_debug_client (DBusConnection *connection);
|
|
void bus_test_clients_foreach (BusConnectionForeachFunction function,
|
|
void *data);
|
|
dbus_bool_t bus_test_client_listed (DBusConnection *connection);
|
|
void bus_test_run_bus_loop (BusContext *context,
|
|
dbus_bool_t block);
|
|
void bus_test_run_clients_loop (dbus_bool_t block);
|
|
void bus_test_run_everything (BusContext *context);
|
|
BusContext* bus_context_new_test (const DBusString *test_data_dir,
|
|
const char *filename);
|
|
dbus_bool_t bus_unix_fds_passing_test (const char *test_data_dir_cstr);
|
|
|
|
#endif
|
|
|
|
#endif /* BUS_TEST_H */
|