diff options
| author | Khalid Abu Shawarib <khalid.shawarib@gmail.com> | 2025-07-18 00:51:48 +0300 |
|---|---|---|
| committer | Khalid Abu Shawarib <khalid.shawarib@gmail.com> | 2026-02-09 01:07:34 +0300 |
| commit | d730b861df4263513ec1c43a9193bffa47ac2c37 (patch) | |
| tree | d500cfb8e5bf3fc32d004782370759486b3803ba | |
| parent | cc2d25a38a4ad8bba4e7ea447473ecdeb841a94c (diff) | |
test/utilities: Add display check functioncherry-pick-1818f51c
| -rw-r--r-- | test/automated/display/test-files-view.c | 2 | ||||
| -rw-r--r-- | test/automated/displayless/test-nautilus-search-engine-localsearch.c | 2 | ||||
| -rw-r--r-- | test/automated/test-utilities.h | 9 |
3 files changed, 12 insertions, 1 deletions
diff --git a/test/automated/display/test-files-view.c b/test/automated/display/test-files-view.c index 574d8df24..b145faf26 100644 --- a/test/automated/display/test-files-view.c +++ b/test/automated/display/test-files-view.c @@ -865,6 +865,8 @@ main (int argc, { g_autoptr (NautilusTagManager) tag_manager = NULL; + test_skip_if_no_display (); + gtk_test_init (&argc, &argv, NULL); nautilus_register_resource (); diff --git a/test/automated/displayless/test-nautilus-search-engine-localsearch.c b/test/automated/displayless/test-nautilus-search-engine-localsearch.c index 9b2e46df5..f1f10f078 100644 --- a/test/automated/displayless/test-nautilus-search-engine-localsearch.c +++ b/test/automated/displayless/test-nautilus-search-engine-localsearch.c @@ -150,7 +150,7 @@ main (int argc, "to ensure a private Localsearch indexer daemon is used."); } - connection = nautilus_tracker_get_miner_fs_connection (&error); + connection = nautilus_localsearch_get_miner_fs_connection (&error); g_assert_no_error (error); diff --git a/test/automated/test-utilities.h b/test/automated/test-utilities.h index eac637f05..3855cc2b1 100644 --- a/test/automated/test-utilities.h +++ b/test/automated/test-utilities.h @@ -20,6 +20,15 @@ void test_clear_tmp_dir (void); void test_init_config_dir (void); +#define test_skip_if_no_display() \ + if (g_getenv ("DISPLAY") == NULL || \ + g_getenv ("WAYLAND_DISPLAY") == NULL) \ + { \ + g_message ("This test requires being run within a display server like " \ + "Wayland or X11. Skipping."); \ + return 77; \ + } + void empty_directory_by_prefix (GFile *parent, gchar *prefix); |
