[mutter] tests: Turn anonymous file test into real test



commit 2ffa9ff3f2e5cc788780b8dc5aa6b08aff3504f1
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Tue Nov 10 22:02:51 2020 +0100

    tests: Turn anonymous file test into real test
    
    It was a test case in the Wayland test client directory, but it wasn't a
    Wayland test client but a standalone test linking to libmutter. Since it
    uses rlimit to implement certain aspects of the test, it can't be made
    part of the regular unit tests, as that means any test running after
    being stuck with the rlimit set, thus keep it standalone, but at least
    run it as part of the test suite.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1557>

 .../meta-anonymous-file.c => anonymous-file.c}         |  2 --
 src/tests/meson.build                                  | 18 ++++++++++++++++++
 src/tests/wayland-test-clients/meson.build             | 16 ----------------
 3 files changed, 18 insertions(+), 18 deletions(-)
---
diff --git a/src/tests/wayland-test-clients/meta-anonymous-file.c b/src/tests/anonymous-file.c
similarity index 99%
rename from src/tests/wayland-test-clients/meta-anonymous-file.c
rename to src/tests/anonymous-file.c
index a998cc4065..79aa343644 100644
--- a/src/tests/wayland-test-clients/meta-anonymous-file.c
+++ b/src/tests/anonymous-file.c
@@ -25,8 +25,6 @@
 
 #include <core/meta-anonymous-file.h>
 
-#include "wayland-test-client-utils.h"
-
 #if defined(HAVE_MEMFD_CREATE)
 #define READONLY_SEALS (F_SEAL_SHRINK | F_SEAL_GROW | F_SEAL_WRITE)
 #endif
diff --git a/src/tests/meson.build b/src/tests/meson.build
index 77ab3b5d6d..351d8c2459 100644
--- a/src/tests/meson.build
+++ b/src/tests/meson.build
@@ -144,6 +144,17 @@ stage_view_tests = executable('mutter-stage-view-tests',
   install_dir: mutter_installed_tests_libexecdir,
 )
 
+anonymous_file_test = executable('anonymous-file-tests',
+  sources: [
+    'anonymous-file.c',
+  ],
+  include_directories: tests_includepath,
+  c_args: tests_c_args,
+  dependencies: [tests_deps],
+  install: have_installed_tests,
+  install_dir: mutter_installed_tests_libexecdir,
+)
+
 stacking_tests = [
   'basic-x11',
   'basic-wayland',
@@ -202,3 +213,10 @@ test('stage-view', stage_view_tests,
   is_parallel: false,
   timeout: 60,
 )
+
+test('anonymous-file', anonymous_file_test,
+  suite: ['core', 'mutter/unit'],
+  env: test_env,
+  is_parallel: false,
+  timeout: 60,
+)
diff --git a/src/tests/wayland-test-clients/meson.build b/src/tests/wayland-test-clients/meson.build
index 8633dde14b..4459a282e7 100644
--- a/src/tests/wayland-test-clients/meson.build
+++ b/src/tests/wayland-test-clients/meson.build
@@ -74,19 +74,3 @@ executable('invalid-subsurfaces',
   install: have_installed_tests,
   install_dir: wayland_test_client_installed_tests_libexecdir,
 )
-
-executable('meta-anonymous-file',
-  sources: [
-    'meta-anonymous-file.c',
-    common_sources,
-  ],
-  include_directories: tests_includepath,
-  c_args: tests_c_args,
-  dependencies: [
-    glib_dep,
-    wayland_client_dep,
-    libmutter_dep,
-  ],
-  install: have_installed_tests,
-  install_dir: wayland_test_client_installed_tests_libexecdir,
-)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]