package ocgtk

  1. Overview
  2. Docs
OCaml bindings for GTK 4

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.1-preview2.tar.gz
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054

doc/ocgtk.gio/Ocgtk_gio/Gio/Wrappers/Test_d_bus/index.html

Module Wrappers.Test_d_bus

type t = [ `test_d_bus | `object_ ] Gobject.obj

Create a new TestDBus

val up : t -> unit

Start a dbus-daemon instance and set DBUS_SESSION_BUS_ADDRESS. After this call, it is safe for unit tests to start sending messages on the session bus.

If this function is called from setup callback of g_test_add(), g_test_dbus_down() must be called in its teardown callback.

If this function is called from unit test's main(), then g_test_dbus_down() must be called after g_test_run().

val stop : t -> unit

Stop the session bus started by g_test_dbus_up().

Unlike g_test_dbus_down(), this won't verify the #GDBusConnection singleton returned by g_bus_get() or g_bus_get_sync() is destroyed. Unit tests wanting to verify behaviour after the session bus has been stopped can use this function but should still call g_test_dbus_down() when done.

val get_flags : t -> Gio_enums.testdbusflags

Get the flags of the #GTestDBus object.

val get_bus_address : t -> string option

Get the address on which dbus-daemon is running. If g_test_dbus_up() has not been called yet, %NULL is returned. This can be used with g_dbus_connection_new_for_address().

val down : t -> unit

Stop the session bus started by g_test_dbus_up().

This will wait for the singleton returned by g_bus_get() or g_bus_get_sync() to be destroyed. This is done to ensure that the next unit test won't get a leaked singleton from this test.

val add_service_dir : t -> string -> unit

Add a path where dbus-daemon will look up .service files. This can't be called after g_test_dbus_up().