diff --git a/src/tests/clutter/conform/meson.build b/src/tests/clutter/conform/meson.build index a3654d665..488db0563 100644 --- a/src/tests/clutter/conform/meson.build +++ b/src/tests/clutter/conform/meson.build @@ -61,8 +61,8 @@ clutter_conform_tests += clutter_conform_tests_classes_tests clutter_conform_tests += clutter_conform_tests_general_tests test_env = environment() -test_env.set('G_TEST_SRCDIR', meson.current_source_dir()) -test_env.set('G_TEST_BUILDDIR', meson.current_build_dir()) +test_env.set('G_TEST_SRCDIR', mutter_srcdir / 'src' / 'tests') +test_env.set('G_TEST_BUILDDIR', mutter_builddir / 'src' / 'tests') test_env.set('G_ENABLE_DIAGNOSTIC', '0') test_env.set('CLUTTER_ENABLE_DIAGNOSTIC', '0') test_env.set('GSETTINGS_SCHEMA_DIR', locally_compiled_schemas_dir) diff --git a/src/tests/cogl/conform/meson.build b/src/tests/cogl/conform/meson.build index c03e18086..e98eb311c 100644 --- a/src/tests/cogl/conform/meson.build +++ b/src/tests/cogl/conform/meson.build @@ -61,8 +61,8 @@ cogl_test_c_args = [ ] test_env = environment() -test_env.set('G_TEST_SRCDIR', meson.current_source_dir()) -test_env.set('G_TEST_BUILDDIR', meson.current_build_dir()) +test_env.set('G_TEST_SRCDIR', mutter_srcdir / 'src' / 'tests') +test_env.set('G_TEST_BUILDDIR', mutter_builddir / 'src' / 'tests') test_env.set('G_ENABLE_DIAGNOSTIC', '0') test_env.set('GSETTINGS_SCHEMA_DIR', locally_compiled_schemas_dir) diff --git a/src/tests/cogl/unit/meson.build b/src/tests/cogl/unit/meson.build index 7e224e817..737a3bce9 100644 --- a/src/tests/cogl/unit/meson.build +++ b/src/tests/cogl/unit/meson.build @@ -11,8 +11,8 @@ cogl_unit_tests = [ ] test_env = environment() -test_env.set('G_TEST_SRCDIR', meson.current_source_dir()) -test_env.set('G_TEST_BUILDDIR', meson.current_build_dir()) +test_env.set('G_TEST_SRCDIR', mutter_srcdir / 'src' / 'tests') +test_env.set('G_TEST_BUILDDIR', mutter_builddir / 'src' / 'tests') test_env.set('G_ENABLE_DIAGNOSTIC', '0') test_env.set('GSETTINGS_SCHEMA_DIR', locally_compiled_schemas_dir) diff --git a/src/tests/color-management-profile-conflict-test.c b/src/tests/color-management-profile-conflict-test.c index b15494b91..5217b28cb 100644 --- a/src/tests/color-management-profile-conflict-test.c +++ b/src/tests/color-management-profile-conflict-test.c @@ -122,7 +122,6 @@ main (int argc, char **argv) g_assert_true (meta_context_configure (context, &argc, &argv, NULL)); system_profile_path = g_test_build_filename (G_TEST_DIST, - "tests", "icc-profiles", "vx239-calibrated.icc", NULL); diff --git a/src/tests/color-management-tests.c b/src/tests/color-management-tests.c index 18a4f16b2..2c5edfc7b 100644 --- a/src/tests/color-management-tests.c +++ b/src/tests/color-management-tests.c @@ -722,7 +722,7 @@ meta_test_color_management_profile_system (void) g_assert_null (meta_color_device_get_assigned_profile (color_device)); - path = g_test_get_filename (G_TEST_DIST, "tests", "icc-profiles", "sRGB.icc", + path = g_test_get_filename (G_TEST_DIST, "icc-profiles", "sRGB.icc", NULL); add_colord_system_profile (srgb_profile_id, path); color_profiles[0] = srgb_profile_id; @@ -1107,7 +1107,7 @@ meta_test_color_management_night_light_calibrated (void) set_night_light_temperature (6500); set_night_light_active (FALSE); path = g_test_get_filename (G_TEST_DIST, - "tests", "icc-profiles", "vx239-calibrated.icc", + "icc-profiles", "vx239-calibrated.icc", NULL); add_colord_system_profile (profile_id, path); color_profiles[0] = profile_id; @@ -1358,7 +1358,7 @@ meta_test_color_management_night_light_uncalibrated (void) set_night_light_temperature (6500); set_night_light_active (FALSE); - path = g_test_get_filename (G_TEST_DIST, "tests", "icc-profiles", "sRGB.icc", + path = g_test_get_filename (G_TEST_DIST, "icc-profiles", "sRGB.icc", NULL); add_colord_system_profile (srgb_profile_id, path); color_profiles[0] = srgb_profile_id; diff --git a/src/tests/generic.test.in b/src/tests/generic.test.in index d9b8ed3c8..5205f3744 100644 --- a/src/tests/generic.test.in +++ b/src/tests/generic.test.in @@ -1,5 +1,5 @@ [Test] Description=Mutter test: @testname@ -Exec=sh -ec 'env G_TEST_SRCDIR=@pkgdatadir@ G_TEST_BUILDDIR=@libexecdir@/installed-tests/mutter-@apiversion@ MUTTER_REF_TEST_RESULT_DIR=@reftestresultdir@ MUTTER_GDCTL_TEST_RESULT_DIR=@gdctltestresultdir@ @libexecdir@/installed-tests/mutter-@apiversion@/mutter-installed-dbus-session.py @runnerargs@ -- @libexecdir@/installed-tests/mutter-@apiversion@/@testexecutable@ @testargs@' +Exec=sh -ec 'env G_TEST_SRCDIR=@pkgdatadir@/tests G_TEST_BUILDDIR=@libexecdir@/installed-tests/mutter-@apiversion@ MUTTER_REF_TEST_RESULT_DIR=@reftestresultdir@ MUTTER_GDCTL_TEST_RESULT_DIR=@gdctltestresultdir@ @libexecdir@/installed-tests/mutter-@apiversion@/mutter-installed-dbus-session.py @runnerargs@ -- @libexecdir@/installed-tests/mutter-@apiversion@/@testexecutable@ @testargs@' Type=session Output=TAP diff --git a/src/tests/meson.build b/src/tests/meson.build index fdb65496a..078993d36 100644 --- a/src/tests/meson.build +++ b/src/tests/meson.build @@ -143,7 +143,7 @@ subdir('wayland-test-clients') test_env = environment() test_env_variables = { - 'G_TEST_SRCDIR': mutter_srcdir / 'src', + 'G_TEST_SRCDIR': mutter_srcdir / 'src' / 'tests', 'G_TEST_BUILDDIR': mutter_builddir / 'src' / 'tests', 'XDG_CONFIG_HOME': mutter_builddir / '.config', 'MUTTER_TEST_PLUGIN_PATH': '@0@'.format(default_plugin.full_path()), @@ -1080,6 +1080,7 @@ if have_installed_tests stacking_installed_tests_cdata = configuration_data() stacking_installed_tests_cdata.set('apiversion', libmutter_api_version) stacking_installed_tests_cdata.set('libexecdir', libexecdir) + stacking_installed_tests_cdata.set('pkgdatadir', pkgdatadir) stacking_installed_tests_cdata.set('tests_datadir', tests_datadir) stacking_installed_tests_cdata.set('stacking_test', stacking_test) diff --git a/src/tests/meta-ref-test-utils.c b/src/tests/meta-ref-test-utils.c index ed9beb913..daf543bcb 100644 --- a/src/tests/meta-ref-test-utils.c +++ b/src/tests/meta-ref-test-utils.c @@ -323,7 +323,7 @@ meta_ref_test_verify (MetaRefTestAdaptor adaptor, depathify (test_name); dist_dir = g_test_get_dir (G_TEST_DIST); - ref_image_path = g_strdup_printf ("%s/tests/ref-tests/%s_%d.ref.png", + ref_image_path = g_strdup_printf ("%s/ref-tests/%s_%d.ref.png", dist_dir, test_name, test_seq_no); diff --git a/src/tests/meta-test-utils.c b/src/tests/meta-test-utils.c index ec787f02b..f81dcd781 100644 --- a/src/tests/meta-test-utils.c +++ b/src/tests/meta-test-utils.c @@ -96,8 +96,6 @@ meta_ensure_test_client_path (int argc, char **argv) { test_runner_client_path = g_test_build_filename (G_TEST_BUILT, - "src", - "tests", "mutter-test-client", NULL); if (!g_file_test (test_runner_client_path, @@ -785,7 +783,7 @@ meta_set_custom_monitor_config_full (MetaBackend *backend, config_store = meta_monitor_config_manager_get_store (config_manager); - path = g_test_build_filename (G_TEST_DIST, "tests", "monitor-configs", + path = g_test_build_filename (G_TEST_DIST, "monitor-configs", filename, NULL); if (!meta_monitor_config_store_set_custom (config_store, path, NULL, configs_flags, diff --git a/src/tests/monitor-dbus-tests.c b/src/tests/monitor-dbus-tests.c index d6d938a78..768fe45c5 100644 --- a/src/tests/monitor-dbus-tests.c +++ b/src/tests/monitor-dbus-tests.c @@ -406,7 +406,6 @@ check_gdctl_output (const char *expected_output_file, g_assert_no_error (wait_data.error); expected_output_path = g_test_build_filename (G_TEST_DIST, - "tests", "gdctl", expected_output_file, NULL); diff --git a/src/tests/monitor-unit-tests.c b/src/tests/monitor-unit-tests.c index ed2e1c994..461eda8f8 100644 --- a/src/tests/monitor-unit-tests.c +++ b/src/tests/monitor-unit-tests.c @@ -8975,7 +8975,7 @@ meta_test_monitor_migrated_rotated (void) MONITOR_TEST_FLAG_NONE); old_config_path = g_test_build_filename (G_TEST_DIST, - "tests", "migration", + "migration", "rotated.xml", NULL); @@ -8998,7 +8998,7 @@ meta_test_monitor_migrated_rotated (void) check_monitor_test_clients_state (); expected_path = g_test_get_filename (G_TEST_DIST, - "tests", "migration", + "migration", "rotated-finished.xml", NULL); expected_data = meta_read_file (expected_path); @@ -9253,7 +9253,7 @@ meta_test_monitor_migrated_horizontal_strip (void) MONITOR_TEST_FLAG_NONE); old_config_path = g_test_build_filename (G_TEST_DIST, - "tests", "migration", + "migration", "horizontal-strip.xml", NULL); @@ -9276,7 +9276,7 @@ meta_test_monitor_migrated_horizontal_strip (void) check_monitor_test_clients_state (); expected_path = g_test_get_filename (G_TEST_DIST, - "tests", "migration", + "migration", "horizontal-strip-finished.xml", NULL); expected_data = meta_read_file (expected_path); @@ -9304,7 +9304,7 @@ meta_test_monitor_custom_detached_groups (void) g_autofree char *path = NULL; g_autoptr (GError) error = NULL; - path = g_test_build_filename (G_TEST_DIST, "tests", "monitor-configs", + path = g_test_build_filename (G_TEST_DIST, "monitor-configs", "detached-groups.xml", NULL); meta_monitor_config_store_set_custom (config_store, path, NULL, META_MONITORS_CONFIG_FLAG_NONE, @@ -11028,14 +11028,12 @@ main (int argc, g_assert_true (meta_context_configure (context, &argc, &argv, NULL)); path = g_test_build_filename (G_TEST_DIST, - "tests", "monitor-configs", "system", NULL); g_setenv ("XDG_CONFIG_DIRS", path, TRUE); g_free (path); path = g_test_build_filename (G_TEST_DIST, - "tests", "monitor-configs", "user", NULL); diff --git a/src/tests/stacking.test.in b/src/tests/stacking.test.in index 5e412ead2..974872107 100644 --- a/src/tests/stacking.test.in +++ b/src/tests/stacking.test.in @@ -1,5 +1,5 @@ [Test] Description=Mutter stacking test: @stacking_test@ -Exec=sh -ec '@libexecdir@/installed-tests/mutter-@apiversion@/mutter-installed-dbus-session.py -- @libexecdir@/installed-tests/mutter-@apiversion@/mutter-test-runner @tests_datadir@/stacking/@stacking_test@.metatest' +Exec=sh -ec 'env G_TEST_SRCDIR=@pkgdatadir@/tests G_TEST_BUILDDIR=@libexecdir@/installed-tests/mutter-@apiversion@ @libexecdir@/installed-tests/mutter-@apiversion@/mutter-installed-dbus-session.py -- @libexecdir@/installed-tests/mutter-@apiversion@/mutter-test-runner @tests_datadir@/stacking/@stacking_test@.metatest' Type=session Output=TAP