gs-test: GNOME Software Reference Manual

## gs-test gs-test |

## Functions

void | gs_test_init ()
void | gs_test_flush_main_context ()
gchar * | gs_test_get_filename ()
void | gs_test_expose_icon_theme_paths ()
void | gs_test_reinitialise_plugin_loader ()

## Description

## Functions

### gs_test_init ()

    void
    gs_test_init (gint *pargc,
                  gchar ***pargv);

Initializes the environment with the common settings for the test, as a replacement for the `g_test_init()`, which is called as well.

Since: 42

### gs_test_flush_main_context ()

    void
    gs_test_flush_main_context (void);

### gs_test_get_filename ()

    gchar *
    gs_test_get_filename (const gchar *testdatadir,
                          const gchar *filename);

### gs_test_expose_icon_theme_paths ()

    void
    gs_test_expose_icon_theme_paths (void);

Calculate and set the `GS_TEST_ICON_THEME_PATH` environment variable to include the current system icon theme paths. This is designed to be called before calling ``gs_test_init()``, which will clear the system icon theme paths.

As this function calls ``g_setenv()``, it must not be called after threads have been spawned.

Calling this function is an explicit acknowledgement that the code under test should be accessing the icon theme.

Since: 3.38

### gs_test_reinitialise_plugin_loader ()

    void
    gs_test_reinitialise_plugin_loader (GsPluginLoader *plugin_loader,
                                        const gchar * const *allowlist,
                                        const gchar * const *blocklist);

Calls setup on each plugin. This should only be used from the tests and in a controlled way.

#### Parameters

plugin_loader | a GsPluginLoader |

Since: 42