1diff --git a/data/installed-tests/meson.build b/data/installed-tests/meson.build
2index be3d5c6d9..14d45dcaf 100644
3--- a/data/installed-tests/meson.build
4+++ b/data/installed-tests/meson.build
5@@ -83,5 +83,5 @@ configure_file(
6 output: 'fwupd-tests.conf',
7 configuration: con2,
8 install: true,
9- install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
10+ install_dir: join_paths(get_option('installed_test_prefix'), 'etc', 'fwupd', 'remotes.d'),
11 )
12diff --git a/meson.build b/meson.build
13index 30011f548..7ac8c937a 100644
14--- a/meson.build
15+++ b/meson.build
16@@ -186,8 +186,8 @@ else
17 datadir = join_paths(prefix, get_option('datadir'))
18 sysconfdir = join_paths(prefix, get_option('sysconfdir'))
19 localstatedir = join_paths(prefix, get_option('localstatedir'))
20- installed_test_bindir = join_paths(libexecdir, 'installed-tests', meson.project_name())
21- installed_test_datadir = join_paths(datadir, 'installed-tests', meson.project_name())
22+ installed_test_bindir = join_paths(get_option('installed_test_prefix'), 'libexec', 'installed-tests', meson.project_name())
23+ installed_test_datadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests', meson.project_name())
24 daemon_dir = join_paths(libexecdir, 'fwupd')
25 endif
26 mandir = join_paths(prefix, get_option('mandir'))
27@@ -498,6 +498,7 @@ gnome = import('gnome')
28 i18n = import('i18n')
29
30 conf.set_quoted('FWUPD_PREFIX', prefix)
31+conf.set_quoted('FWUPD_INSTALLED_TEST_PREFIX', get_option('installed_test_prefix'))
32 conf.set_quoted('FWUPD_BINDIR', bindir)
33 conf.set_quoted('FWUPD_LIBDIR', libdir)
34 conf.set_quoted('FWUPD_LIBEXECDIR', libexecdir)
35diff --git a/meson_options.txt b/meson_options.txt
36index 6fc7e8437..29832fd08 100644
37--- a/meson_options.txt
38+++ b/meson_options.txt
39@@ -57,6 +57,7 @@ option('systemd', type : 'feature', description : 'systemd support', deprecated:
40 option('systemd_unit_user', type : 'string', description : 'User account to use for fwupd-refresh.service (empty for DynamicUser)')
41 option('systemd_root_prefix', type: 'string', value: '', description: 'Directory to base systemd’s installation directories on')
42 option('elogind', type : 'feature', description : 'elogind support', deprecated: {'true': 'enabled', 'false': 'disabled'})
43+option('installed_test_prefix', type: 'string', description: 'Prefix for installed tests')
44 option('tests', type : 'boolean', value : true, description : 'enable tests')
45 option('soup_session_compat', type : 'boolean', value : true, description : 'enable SoupSession runtime compatibility support')
46 option('curl', type : 'feature', description : 'libcurl support', deprecated: {'true': 'enabled', 'false': 'disabled'})