diff --git a/meson.build b/meson.build
index cd711c6d01..90f4e6da04 100644
--- a/meson.build
+++ b/meson.build
@@ -3388,6 +3388,12 @@ else
   runningcheck = false
 endif
 
+temp_config_env = run_command([
+  python,
+  '-c',
+  'import os; print(os.getenv("TEMP_CONFIG", ""))'
+], check: true).stdout().strip()
+
 testwrap = files('src/tools/testwrap')
 
 foreach test_dir : tests
@@ -3451,6 +3457,10 @@ foreach test_dir : tests
       env = test_env
       env.prepend('PATH', temp_install_bindir, test_dir['bd'])
 
+      if temp_config_env != ''
+        test_command_base += [ '--temp-config=' + temp_config_env ]
+      endif
+
       test_kwargs = {
         'protocol': 'tap',
         'priority': 10,
