Index: /trunk/include/iprt/mangling.h
===================================================================
--- /trunk/include/iprt/mangling.h	(revision 58302)
+++ /trunk/include/iprt/mangling.h	(revision 58303)
@@ -1659,4 +1659,5 @@
 # define RTTestChangeName                               RT_MANGLER(RTTestChangeName)
 # define RTTestCreate                                   RT_MANGLER(RTTestCreate)
+# define RTTestCreateChild                              RT_MANGLER(RTTestCreateChild)
 # define RTTestCreateEx                                 RT_MANGLER(RTTestCreateEx)
 # define RTTestDestroy                                  RT_MANGLER(RTTestDestroy)
Index: /trunk/include/iprt/test.h
===================================================================
--- /trunk/include/iprt/test.h	(revision 58302)
+++ /trunk/include/iprt/test.h	(revision 58303)
@@ -80,4 +80,16 @@
 RTR3DECL(int) RTTestCreate(const char *pszTest, PRTTEST phTest);
 
+/**
+ * Creates a test instance for a child process.
+ *
+ * This differs from RTTestCreate in that it disabled result reporting to file
+ * and pipe in order to avoid producing invalid XML.
+ *
+ * @returns IPRT status code.
+ * @param   pszTest     The test name.
+ * @param   phTest      Where to store the test instance handle.
+ */
+RTR3DECL(int) RTTestCreateChild(const char *pszTest, PRTTEST phTest);
+
 /** @name RTTEST_C_XXX - Flags for RTTestCreateEx.
  * @{ */
@@ -111,6 +123,14 @@
  * this flag is incompatible with using the RTTestIXxxx variant of the API. */
 #define RTTEST_C_NO_TLS                 RT_BIT(3)
+/** Don't report to the pipe (IPRT_TEST_PIPE or other).   */
+#define RTTEST_C_NO_XML_REPORTING_PIPE  RT_BIT(4)
+/** Don't report to the results file (IPRT_TEST_FILE or other).   */
+#define RTTEST_C_NO_XML_REPORTING_FILE  RT_BIT(4)
+/** No XML reporting to pipes, file or anything.
+ * Child processes may want to use this so they don't garble the output of
+ * the main test process. */
+#define RTTEST_C_NO_XML_REPORTING       (RTTEST_C_NO_XML_REPORTING_PIPE | RTTEST_C_NO_XML_REPORTING_FILE)
 /** Mask containing the valid bits. */
-#define RTTEST_C_VALID_MASK             UINT32_C(0x0000000f)
+#define RTTEST_C_VALID_MASK             UINT32_C(0x0000003f)
 /** @} */
 
Index: /trunk/src/VBox/Runtime/r3/test.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/test.cpp	(revision 58302)
+++ /trunk/src/VBox/Runtime/r3/test.cpp	(revision 58303)
@@ -315,34 +315,38 @@
                  * Any test driver we are connected or should connect to?
                  */
-                if ((fFlags & RTTEST_C_USE_ENV) && iNativeTestPipe == -1)
+                if (!(fFlags & RTTEST_C_NO_XML_REPORTING_PIPE))
                 {
-                    rc = RTEnvGetEx(RTENV_DEFAULT, "IPRT_TEST_PIPE", szEnvVal, sizeof(szEnvVal), NULL);
-                    if (RT_SUCCESS(rc))
+                    if (   (fFlags & RTTEST_C_USE_ENV)
+                        && iNativeTestPipe == -1)
                     {
+                        rc = RTEnvGetEx(RTENV_DEFAULT, "IPRT_TEST_PIPE", szEnvVal, sizeof(szEnvVal), NULL);
+                        if (RT_SUCCESS(rc))
+                        {
 #if ARCH_BITS == 64
-                        rc = RTStrToInt64Full(szEnvVal, 0, &iNativeTestPipe);
+                            rc = RTStrToInt64Full(szEnvVal, 0, &iNativeTestPipe);
 #else
-                        rc = RTStrToInt32Full(szEnvVal, 0, &iNativeTestPipe);
+                            rc = RTStrToInt32Full(szEnvVal, 0, &iNativeTestPipe);
 #endif
-                        if (RT_FAILURE(rc))
+                            if (RT_FAILURE(rc))
+                            {
+                                RTStrmPrintf(g_pStdErr, "%s: test pipe error: RTStrToInt32Full(\"%s\") -> %Rrc\n",
+                                             pszTest, szEnvVal, rc);
+                                iNativeTestPipe = -1;
+                            }
+                        }
+                        else if (rc != VERR_ENV_VAR_NOT_FOUND)
+                            RTStrmPrintf(g_pStdErr, "%s: test pipe error: RTEnvGetEx(IPRT_TEST_PIPE) -> %Rrc\n", pszTest, rc);
+                    }
+                    if (iNativeTestPipe != -1)
+                    {
+                        rc = RTPipeFromNative(&pTest->hXmlPipe, iNativeTestPipe, RTPIPE_N_WRITE);
+                        if (RT_SUCCESS(rc))
+                            pTest->fXmlEnabled = true;
+                        else
                         {
-                            RTStrmPrintf(g_pStdErr, "%s: test pipe error: RTStrToInt32Full(\"%s\") -> %Rrc\n",
-                                         pszTest, szEnvVal, rc);
-                            iNativeTestPipe = -1;
+                            RTStrmPrintf(g_pStdErr, "%s: test pipe error: RTPipeFromNative(,%p,WRITE) -> %Rrc\n",
+                                         pszTest, iNativeTestPipe, rc);
+                            pTest->hXmlPipe = NIL_RTPIPE;
                         }
-                    }
-                    else if (rc != VERR_ENV_VAR_NOT_FOUND)
-                        RTStrmPrintf(g_pStdErr, "%s: test pipe error: RTEnvGetEx(IPRT_TEST_PIPE) -> %Rrc\n", pszTest, rc);
-                }
-                if (iNativeTestPipe != -1)
-                {
-                    rc = RTPipeFromNative(&pTest->hXmlPipe, iNativeTestPipe, RTPIPE_N_WRITE);
-                    if (RT_SUCCESS(rc))
-                        pTest->fXmlEnabled = true;
-                    else
-                    {
-                        RTStrmPrintf(g_pStdErr, "%s: test pipe error: RTPipeFromNative(,%p,WRITE) -> %Rrc\n",
-                                     pszTest, iNativeTestPipe, rc);
-                        pTest->hXmlPipe = NIL_RTPIPE;
                     }
                 }
@@ -351,26 +355,28 @@
                  * Any test file we should write the test report to?
                  */
-                if ((fFlags & RTTEST_C_USE_ENV) && pszXmlFile == NULL)
+                if (!(fFlags & RTTEST_C_NO_XML_REPORTING_FILE))
                 {
-                    rc = RTEnvGetEx(RTENV_DEFAULT, "IPRT_TEST_FILE", szEnvVal, sizeof(szEnvVal), NULL);
-                    if (RT_SUCCESS(rc))
-                        pszXmlFile = szEnvVal;
-                    else if (rc != VERR_ENV_VAR_NOT_FOUND)
-                        RTStrmPrintf(g_pStdErr, "%s: test pipe error: RTEnvGetEx(IPRT_TEST_MAX_LEVEL) -> %Rrc\n", pszTest, rc);
-                }
-                if (pszXmlFile && *pszXmlFile)
-                {
-                    rc = RTFileOpen(&pTest->hXmlFile, pszXmlFile,
-                                    RTFILE_O_WRITE | RTFILE_O_DENY_WRITE | RTFILE_O_OPEN_CREATE | RTFILE_O_TRUNCATE);
-                    if (RT_SUCCESS(rc))
-                        pTest->fXmlEnabled = true;
-                    else
+                    if ((fFlags & RTTEST_C_USE_ENV) && pszXmlFile == NULL)
                     {
-                        RTStrmPrintf(g_pStdErr, "%s: test file error: RTFileOpen(,\"%s\",) -> %Rrc\n", pszTest, pszXmlFile, rc);
-                        pTest->hXmlFile = NIL_RTFILE;
+                        rc = RTEnvGetEx(RTENV_DEFAULT, "IPRT_TEST_FILE", szEnvVal, sizeof(szEnvVal), NULL);
+                        if (RT_SUCCESS(rc))
+                            pszXmlFile = szEnvVal;
+                        else if (rc != VERR_ENV_VAR_NOT_FOUND)
+                            RTStrmPrintf(g_pStdErr, "%s: test file error: RTEnvGetEx(IPRT_TEST_MAX_LEVEL) -> %Rrc\n", pszTest, rc);
+                    }
+                    if (pszXmlFile && *pszXmlFile)
+                    {
+                        rc = RTFileOpen(&pTest->hXmlFile, pszXmlFile,
+                                        RTFILE_O_WRITE | RTFILE_O_DENY_WRITE | RTFILE_O_OPEN_CREATE | RTFILE_O_TRUNCATE);
+                        if (RT_SUCCESS(rc))
+                            pTest->fXmlEnabled = true;
+                        else
+                        {
+                            RTStrmPrintf(g_pStdErr, "%s: test file error: RTFileOpen(,\"%s\",) -> %Rrc\n",
+                                         pszTest, pszXmlFile, rc);
+                            pTest->hXmlFile = NIL_RTFILE;
+                        }
                     }
                 }
-                else if (rc != VERR_ENV_VAR_NOT_FOUND)
-                    RTStrmPrintf(g_pStdErr, "%s: test file error: RTEnvGetEx(IPRT_TEST_FILE) -> %Rrc\n", pszTest, rc);
 
                 /*
@@ -405,4 +411,11 @@
 {
     return RTTestCreateEx(pszTest, RTTEST_C_USE_ENV, RTTESTLVL_INVALID, -1 /*iNativeTestPipe*/, NULL /*pszXmlFile*/, phTest);
+}
+
+
+RTR3DECL(int) RTTestCreateChild(const char *pszTest, PRTTEST phTest)
+{
+    return RTTestCreateEx(pszTest, RTTEST_C_USE_ENV | RTTEST_C_NO_XML_REPORTING,
+                          RTTESTLVL_INVALID, -1 /*iNativeTestPipe*/, NULL /*pszXmlFile*/, phTest);
 }
 
