diff --git a/pressure-vessel/wrap-setup.c b/pressure-vessel/wrap-setup.c
index ce51d6cc638fd36fdddcabe1139e1b9ab1094d14..fdcaef856f75687745f849e77daacee1819f35b7 100644
--- a/pressure-vessel/wrap-setup.c
+++ b/pressure-vessel/wrap-setup.c
@@ -520,6 +520,38 @@ append_preload_per_architecture (GPtrArray *argv,
                                      &details);
       path = srt_library_get_absolute_path (details);
 
+      if (flags & PV_APPEND_PRELOAD_FLAGS_IN_UNIT_TESTS)
+        {
+          /* Use mock results to get predictable behaviour in the unit
+           * tests, replacing the real result (above). This avoids needing
+           * to have real libraries in place when we do unit testing.
+           *
+           * tests/pressure-vessel/wrap-setup.c is the other side of this. */
+          g_autofree gchar *lib = NULL;
+          const char *platform = NULL;
+
+          /* As a mock ${LIB}, behave like Debian or the fdo SDK. */
+          lib = g_strdup_printf ("lib/%s", pv_multiarch_details[i].tuple);
+
+          /* As a mock ${PLATFORM}, use the first one listed. */
+          platform = pv_multiarch_details[i].platforms[0];
+
+          mock_path = g_string_new (preload);
+          g_string_replace (mock_path, "$LIB", lib, 0);
+          g_string_replace (mock_path, "${LIB}", lib, 0);
+          g_string_replace (mock_path, "$PLATFORM", platform, 0);
+          g_string_replace (mock_path, "${PLATFORM}", platform, 0);
+          path = mock_path->str;
+
+          /* As a special case, pretend one 64-bit library failed to load,
+           * so we can exercise what happens when there's only a 32-bit
+           * library available. */
+          if (strstr (path, "only-32-bit") != NULL
+              && strcmp (pv_multiarch_details[i].tuple,
+                         SRT_ABI_I386) != 0)
+            path = NULL;
+        }
+
       if (path != NULL)
         {
           g_debug ("Found %s version of %s at %s",
diff --git a/pressure-vessel/wrap-setup.h b/pressure-vessel/wrap-setup.h
index 0c13cecee25785004cc5e01e6530370be013b8a5..12dac2cd63dc206be3201d75003debdef768227e 100644
--- a/pressure-vessel/wrap-setup.h
+++ b/pressure-vessel/wrap-setup.h
@@ -55,6 +55,7 @@ typedef enum
 {
   PV_APPEND_PRELOAD_FLAGS_FLATPAK_SUBSANDBOX = (1 << 0),
   PV_APPEND_PRELOAD_FLAGS_REMOVE_GAME_OVERLAY = (1 << 1),
+  PV_APPEND_PRELOAD_FLAGS_IN_UNIT_TESTS = (1 << 2),
   PV_APPEND_PRELOAD_FLAGS_NONE = 0
 } PvAppendPreloadFlags;
 
diff --git a/tests/pressure-vessel/wrap-setup.c b/tests/pressure-vessel/wrap-setup.c
index c7b75de322e4e79d088b86e3c5e91238b5f2940d..ea708c14f25af266436dba5f9bf6c93a45fe30cc 100644
--- a/tests/pressure-vessel/wrap-setup.c
+++ b/tests/pressure-vessel/wrap-setup.c
@@ -259,7 +259,7 @@ populate_ld_preload (Fixture *f,
                               "--ld-preload",
                               preloads[i].string,
                               f->env,
-                              flags,
+                              flags | PV_APPEND_PRELOAD_FLAGS_IN_UNIT_TESTS,
                               runtime,
                               exports);
 
@@ -297,27 +297,37 @@ test_remap_ld_preload (Fixture *f,
   g_assert_cmpstr (g_ptr_array_index (argv, i++),
                    ==, "--ld-preload=/app/lib/libpreloadA.so");
 
-  /* TODO: We should split up /platform/plat-$PLATFORM/libpreloadP.so into
-   * its per-platform resolutions */
-  while (argv->len > i)
-    {
-      if (g_str_has_prefix (g_ptr_array_index (argv, i),
-                            "--ld-preload=/platform/plat-"))
-        i++;
-      else
-        break;
-    }
+  g_assert_cmpuint (argv->len, >, i);
+  g_assert_cmpstr (g_ptr_array_index (argv, i++),
+                   ==,
+                   ("--ld-preload=/platform/plat-"
+                    MOCK_PLATFORM_64
+                    "/libpreloadP.so:abi="
+                    SRT_ABI_X86_64));
 
-  /* TODO: We should split up /opt/${LIB}/libpreloadL.so into
-   * its per-platform resolutions */
-  while (argv->len > i)
-    {
-      if (g_str_has_prefix (g_ptr_array_index (argv, i),
-                            "--ld-preload=/opt/"))
-        i++;
-      else
-        break;
-    }
+  g_assert_cmpuint (argv->len, >, i);
+  g_assert_cmpstr (g_ptr_array_index (argv, i++),
+                   ==,
+                   ("--ld-preload=/platform/plat-"
+                    MOCK_PLATFORM_32
+                    "/libpreloadP.so:abi="
+                    SRT_ABI_I386));
+
+  g_assert_cmpuint (argv->len, >, i);
+  g_assert_cmpstr (g_ptr_array_index (argv, i++),
+                   ==,
+                   ("--ld-preload=/opt/"
+                    MOCK_LIB_64
+                    "/libpreloadL.so:abi="
+                    SRT_ABI_X86_64));
+
+  g_assert_cmpuint (argv->len, >, i);
+  g_assert_cmpstr (g_ptr_array_index (argv, i++),
+                   ==,
+                   ("--ld-preload=/opt/"
+                    MOCK_LIB_32
+                    "/libpreloadL.so:abi="
+                    SRT_ABI_I386));
 
   g_assert_cmpuint (argv->len, >, i);
   g_assert_cmpstr (g_ptr_array_index (argv, i++),
@@ -343,17 +353,13 @@ test_remap_ld_preload (Fixture *f,
   g_assert_cmpstr (g_ptr_array_index (argv, i++),
                    ==, "--ld-preload=/future/libs-$FUTURE/libpreloadF.so");
 
-  /* TODO: We should split this up into its per-platform resolutions,
-   * then discard the 64-bit resolution because it doesn't exist, and
-   * only keep the 32-bit resolution */
-  while (argv->len > i)
-    {
-      if (g_str_has_prefix (g_ptr_array_index (argv, i),
-                            "--ld-preload=/in-root-plat-"))
-        i++;
-      else
-        break;
-    }
+  g_assert_cmpuint (argv->len, >, i);
+  g_assert_cmpstr (g_ptr_array_index (argv, i++),
+                   ==,
+                   ("--ld-preload=/in-root-plat-"
+                    MOCK_PLATFORM_32
+                    "-only-32-bit.so:abi="
+                    SRT_ABI_I386));
 
   g_assert_cmpuint (argv->len, >, i);
   g_assert_cmpstr (g_ptr_array_index (argv, i++),
@@ -384,22 +390,14 @@ test_remap_ld_preload (Fixture *f,
    * these. */
   g_assert_false (flatpak_exports_path_is_visible (exports, "/opt"));
   g_assert_false (flatpak_exports_path_is_visible (exports, "/opt/lib"));
-
-  if (!flatpak_exports_path_is_visible (exports, "/opt/" MOCK_LIB_32 "/libpreloadL.so"))
-    g_test_message ("TODO: Export filenames in /opt/$LIB");
-
-  if (!flatpak_exports_path_is_visible (exports, "/opt/" MOCK_LIB_64 "/libpreloadL.so"))
-    g_test_message ("TODO: Export filenames in /opt/$LIB");
+  g_assert_true (flatpak_exports_path_is_visible (exports, "/opt/" MOCK_LIB_32 "/libpreloadL.so"));
+  g_assert_true (flatpak_exports_path_is_visible (exports, "/opt/" MOCK_LIB_64 "/libpreloadL.so"));
 
   /* We don't always export /platform, so we have to explicitly export
    * these. */
   g_assert_false (flatpak_exports_path_is_visible (exports, "/platform"));
-
-  if (!flatpak_exports_path_is_visible (exports, "/platform/plat-" MOCK_PLATFORM_32 "/libpreloadP.so"))
-    g_test_message ("TODO: Export filenames in /platform");
-
-  if (!flatpak_exports_path_is_visible (exports, "/platform/plat-" MOCK_PLATFORM_64 "/libpreloadP.so"))
-    g_test_message ("TODO: Export filenames in /platform");
+  g_assert_true (flatpak_exports_path_is_visible (exports, "/platform/plat-" MOCK_PLATFORM_32 "/libpreloadP.so"));
+  g_assert_true (flatpak_exports_path_is_visible (exports, "/platform/plat-" MOCK_PLATFORM_64 "/libpreloadP.so"));
 
   /* FlatpakExports never exports /lib as /lib */
   g_assert_false (flatpak_exports_path_is_visible (exports, "/lib"));
@@ -446,27 +444,37 @@ test_remap_ld_preload_flatpak (Fixture *f,
   g_assert_cmpstr (g_ptr_array_index (argv, i++),
                    ==, "--ld-preload=/run/parent/app/lib/libpreloadA.so");
 
-  /* TODO: We should split up /platform/plat-$PLATFORM/libpreloadP.so into
-   * its per-platform resolutions */
-  while (argv->len > i)
-    {
-      if (g_str_has_prefix (g_ptr_array_index (argv, i),
-                            "--ld-preload=/platform/plat-"))
-        i++;
-      else
-        break;
-    }
+  g_assert_cmpuint (argv->len, >, i);
+  g_assert_cmpstr (g_ptr_array_index (argv, i++),
+                   ==,
+                   ("--ld-preload=/platform/plat-"
+                    MOCK_PLATFORM_64
+                    "/libpreloadP.so:abi="
+                    SRT_ABI_X86_64));
 
-  /* TODO: We should split up /opt/${LIB}/libpreloadL.so into
-   * its per-platform resolutions */
-  while (argv->len > i)
-    {
-      if (g_str_has_prefix (g_ptr_array_index (argv, i),
-                            "--ld-preload=/opt/"))
-        i++;
-      else
-        break;
-    }
+  g_assert_cmpuint (argv->len, >, i);
+  g_assert_cmpstr (g_ptr_array_index (argv, i++),
+                   ==,
+                   ("--ld-preload=/platform/plat-"
+                    MOCK_PLATFORM_32
+                    "/libpreloadP.so:abi="
+                    SRT_ABI_I386));
+
+  g_assert_cmpuint (argv->len, >, i);
+  g_assert_cmpstr (g_ptr_array_index (argv, i++),
+                   ==,
+                   ("--ld-preload=/opt/"
+                    MOCK_LIB_64
+                    "/libpreloadL.so:abi="
+                    SRT_ABI_X86_64));
+
+  g_assert_cmpuint (argv->len, >, i);
+  g_assert_cmpstr (g_ptr_array_index (argv, i++),
+                   ==,
+                   ("--ld-preload=/opt/"
+                    MOCK_LIB_32
+                    "/libpreloadL.so:abi="
+                    SRT_ABI_I386));
 
   g_assert_cmpuint (argv->len, >, i);
   g_assert_cmpstr (g_ptr_array_index (argv, i++),
@@ -492,17 +500,13 @@ test_remap_ld_preload_flatpak (Fixture *f,
   g_assert_cmpstr (g_ptr_array_index (argv, i++),
                    ==, "--ld-preload=/future/libs-$FUTURE/libpreloadF.so");
 
-  /* TODO: We should split this up into its per-platform resolutions,
-   * then discard the 64-bit resolution because it doesn't exist, and
-   * only keep the 32-bit resolution */
-  while (argv->len > i)
-    {
-      if (g_str_has_prefix (g_ptr_array_index (argv, i),
-                            "--ld-preload=/in-root-plat-"))
-        i++;
-      else
-        break;
-    }
+  g_assert_cmpuint (argv->len, >, i);
+  g_assert_cmpstr (g_ptr_array_index (argv, i++),
+                   ==,
+                   ("--ld-preload=/in-root-plat-"
+                    MOCK_PLATFORM_32
+                    "-only-32-bit.so:abi="
+                    SRT_ABI_I386));
 
   g_assert_cmpuint (argv->len, >, i);
   g_assert_cmpstr (g_ptr_array_index (argv, i++),
@@ -541,27 +545,37 @@ test_remap_ld_preload_no_runtime (Fixture *f,
   g_assert_cmpstr (g_ptr_array_index (argv, i++),
                    ==, "--ld-preload=/app/lib/libpreloadA.so");
 
-  /* TODO: We should split up /platform/plat-$PLATFORM/libpreloadP.so into
-   * its per-platform resolutions */
-  while (argv->len > i)
-    {
-      if (g_str_has_prefix (g_ptr_array_index (argv, i),
-                            "--ld-preload=/platform/plat-"))
-        i++;
-      else
-        break;
-    }
+  g_assert_cmpuint (argv->len, >, i);
+  g_assert_cmpstr (g_ptr_array_index (argv, i++),
+                   ==,
+                   ("--ld-preload=/platform/plat-"
+                    MOCK_PLATFORM_64
+                    "/libpreloadP.so:abi="
+                    SRT_ABI_X86_64));
 
-  /* TODO: We should split up /opt/${LIB}/libpreloadL.so into
-   * its per-platform resolutions */
-  while (argv->len > i)
-    {
-      if (g_str_has_prefix (g_ptr_array_index (argv, i),
-                            "--ld-preload=/opt/"))
-        i++;
-      else
-        break;
-    }
+  g_assert_cmpuint (argv->len, >, i);
+  g_assert_cmpstr (g_ptr_array_index (argv, i++),
+                   ==,
+                   ("--ld-preload=/platform/plat-"
+                    MOCK_PLATFORM_32
+                    "/libpreloadP.so:abi="
+                    SRT_ABI_I386));
+
+  g_assert_cmpuint (argv->len, >, i);
+  g_assert_cmpstr (g_ptr_array_index (argv, i++),
+                   ==,
+                   ("--ld-preload=/opt/"
+                    MOCK_LIB_64
+                    "/libpreloadL.so:abi="
+                    SRT_ABI_X86_64));
+
+  g_assert_cmpuint (argv->len, >, i);
+  g_assert_cmpstr (g_ptr_array_index (argv, i++),
+                   ==,
+                   ("--ld-preload=/opt/"
+                    MOCK_LIB_32
+                    "/libpreloadL.so:abi="
+                    SRT_ABI_I386));
 
   g_assert_cmpuint (argv->len, >, i);
   g_assert_cmpstr (g_ptr_array_index (argv, i++),
@@ -586,17 +600,13 @@ test_remap_ld_preload_no_runtime (Fixture *f,
   g_assert_cmpstr (g_ptr_array_index (argv, i++),
                    ==, "--ld-preload=/future/libs-$FUTURE/libpreloadF.so");
 
-  /* TODO: We should split this up into its per-platform resolutions,
-   * then discard the 64-bit resolution because it doesn't exist, and
-   * only keep the 32-bit resolution */
-  while (argv->len > i)
-    {
-      if (g_str_has_prefix (g_ptr_array_index (argv, i),
-                            "--ld-preload=/in-root-plat-"))
-        i++;
-      else
-        break;
-    }
+  g_assert_cmpuint (argv->len, >, i);
+  g_assert_cmpstr (g_ptr_array_index (argv, i++),
+                   ==,
+                   ("--ld-preload=/in-root-plat-"
+                    MOCK_PLATFORM_32
+                    "-only-32-bit.so:abi="
+                    SRT_ABI_I386));
 
   g_assert_cmpuint (argv->len, >, i);
   g_assert_cmpstr (g_ptr_array_index (argv, i++),
@@ -627,22 +637,14 @@ test_remap_ld_preload_no_runtime (Fixture *f,
    * these. */
   g_assert_false (flatpak_exports_path_is_visible (exports, "/opt"));
   g_assert_false (flatpak_exports_path_is_visible (exports, "/opt/lib"));
-
-  if (!flatpak_exports_path_is_visible (exports, "/opt/" MOCK_LIB_32 "/libpreloadL.so"))
-    g_test_message ("TODO: Export filenames in /opt/$LIB");
-
-  if (!flatpak_exports_path_is_visible (exports, "/opt/" MOCK_LIB_64 "/libpreloadL.so"))
-    g_test_message ("TODO: Export filenames in /opt/$LIB");
+  g_assert_true (flatpak_exports_path_is_visible (exports, "/opt/" MOCK_LIB_32 "/libpreloadL.so"));
+  g_assert_true (flatpak_exports_path_is_visible (exports, "/opt/" MOCK_LIB_64 "/libpreloadL.so"));
 
   /* We don't always export /platform, so we have to explicitly export
    * these. */
   g_assert_false (flatpak_exports_path_is_visible (exports, "/platform"));
-
-  if (!flatpak_exports_path_is_visible (exports, "/platform/plat-" MOCK_PLATFORM_32 "/libpreloadP.so"))
-    g_test_message ("TODO: Export filenames in /platform");
-
-  if (!flatpak_exports_path_is_visible (exports, "/platform/plat-" MOCK_PLATFORM_64 "/libpreloadP.so"))
-    g_test_message ("TODO: Export filenames in /platform");
+  g_assert_true (flatpak_exports_path_is_visible (exports, "/platform/plat-" MOCK_PLATFORM_32 "/libpreloadP.so"));
+  g_assert_true (flatpak_exports_path_is_visible (exports, "/platform/plat-" MOCK_PLATFORM_64 "/libpreloadP.so"));
 
   /* FlatpakExports never exports /lib as /lib */
   g_assert_false (flatpak_exports_path_is_visible (exports, "/lib"));
@@ -683,27 +685,37 @@ test_remap_ld_preload_flatpak_no_runtime (Fixture *f,
   g_assert_cmpstr (g_ptr_array_index (argv, i++),
                    ==, "--ld-preload=/app/lib/libpreloadA.so");
 
-  /* TODO: We should split up /platform/plat-$PLATFORM/libpreloadP.so into
-   * its per-platform resolutions */
-  while (argv->len > i)
-    {
-      if (g_str_has_prefix (g_ptr_array_index (argv, i),
-                            "--ld-preload=/platform/plat-"))
-        i++;
-      else
-        break;
-    }
+  g_assert_cmpuint (argv->len, >, i);
+  g_assert_cmpstr (g_ptr_array_index (argv, i++),
+                   ==,
+                   ("--ld-preload=/platform/plat-"
+                    MOCK_PLATFORM_64
+                    "/libpreloadP.so:abi="
+                    SRT_ABI_X86_64));
 
-  /* TODO: We should split up /opt/${LIB}/libpreloadL.so into
-   * its per-platform resolutions */
-  while (argv->len > i)
-    {
-      if (g_str_has_prefix (g_ptr_array_index (argv, i),
-                            "--ld-preload=/opt/"))
-        i++;
-      else
-        break;
-    }
+  g_assert_cmpuint (argv->len, >, i);
+  g_assert_cmpstr (g_ptr_array_index (argv, i++),
+                   ==,
+                   ("--ld-preload=/platform/plat-"
+                    MOCK_PLATFORM_32
+                    "/libpreloadP.so:abi="
+                    SRT_ABI_I386));
+
+  g_assert_cmpuint (argv->len, >, i);
+  g_assert_cmpstr (g_ptr_array_index (argv, i++),
+                   ==,
+                   ("--ld-preload=/opt/"
+                    MOCK_LIB_64
+                    "/libpreloadL.so:abi="
+                    SRT_ABI_X86_64));
+
+  g_assert_cmpuint (argv->len, >, i);
+  g_assert_cmpstr (g_ptr_array_index (argv, i++),
+                   ==,
+                   ("--ld-preload=/opt/"
+                    MOCK_LIB_32
+                    "/libpreloadL.so:abi="
+                    SRT_ABI_I386));
 
   g_assert_cmpuint (argv->len, >, i);
   g_assert_cmpstr (g_ptr_array_index (argv, i++),
@@ -729,17 +741,13 @@ test_remap_ld_preload_flatpak_no_runtime (Fixture *f,
   g_assert_cmpstr (g_ptr_array_index (argv, i++),
                    ==, "--ld-preload=/future/libs-$FUTURE/libpreloadF.so");
 
-  /* TODO: We should split this up into its per-platform resolutions,
-   * then discard the 64-bit resolution because it doesn't exist, and
-   * only keep the 32-bit resolution */
-  while (argv->len > i)
-    {
-      if (g_str_has_prefix (g_ptr_array_index (argv, i),
-                            "--ld-preload=/in-root-plat-"))
-        i++;
-      else
-        break;
-    }
+  g_assert_cmpuint (argv->len, >, i);
+  g_assert_cmpstr (g_ptr_array_index (argv, i++),
+                   ==,
+                   ("--ld-preload=/in-root-plat-"
+                    MOCK_PLATFORM_32
+                    "-only-32-bit.so:abi="
+                    SRT_ABI_I386));
 
   g_assert_cmpuint (argv->len, >, i);
   g_assert_cmpstr (g_ptr_array_index (argv, i++),