Index: /trunk/include/iprt/test.h
===================================================================
--- /trunk/include/iprt/test.h	(revision 19943)
+++ /trunk/include/iprt/test.h	(revision 19944)
@@ -211,7 +211,33 @@
  * @param   hTest       The test handle. If NIL_RTTEST we'll use the one
  *                      associated with the calling thread.
- * @param   pszSubTest  The sub-test name
+ * @param   pszSubTest  The sub-test name.
  */
 RTR3DECL(int) RTTestSub(RTTEST hTest, const char *pszSubTest);
+
+/**
+ * Format string version of RTTestSub.
+ *
+ * See RTTestSub for details.
+ *
+ * @returns Number of chars printed.
+ * @param   hTest           The test handle. If NIL_RTTEST we'll use the one
+ *                          associated with the calling thread.
+ * @param   pszSubTestFmt   The sub-test name format string.
+ * @param   ...             Arguments.
+ */
+RTR3DECL(int) RTTestSubF(RTTEST hTest, const char *pszSubTestFmt, ...);
+
+/**
+ * Format string version of RTTestSub.
+ *
+ * See RTTestSub for details.
+ *
+ * @returns Number of chars printed.
+ * @param   hTest           The test handle. If NIL_RTTEST we'll use the one
+ *                          associated with the calling thread.
+ * @param   pszSubTestFmt   The sub-test name format string.
+ * @param   ...             Arguments.
+ */
+RTR3DECL(int) RTTestSubV(RTTEST hTest, const char *pszSubTestFmt, va_list va);
 
 /**
@@ -473,4 +499,44 @@
 
 /**
+ * Starts a sub-test.
+ *
+ * This will perform an implicit RTTestSubDone() call if that has not been done
+ * since the last RTTestSub call.
+ *
+ * @returns Number of chars printed.
+ * @param   pszSubTest  The sub-test name.
+ */
+RTR3DECL(int) RTTestISub(const char *pszSubTest);
+
+/**
+ * Format string version of RTTestSub.
+ *
+ * See RTTestSub for details.
+ *
+ * @returns Number of chars printed.
+ * @param   pszSubTestFmt   The sub-test name format string.
+ * @param   ...             Arguments.
+ */
+RTR3DECL(int) RTTestISubF(const char *pszSubTestFmt, ...);
+
+/**
+ * Format string version of RTTestSub.
+ *
+ * See RTTestSub for details.
+ *
+ * @returns Number of chars printed.
+ * @param   pszSubTestFmt   The sub-test name format string.
+ * @param   ...             Arguments.
+ */
+RTR3DECL(int) RTTestISubV(const char *pszSubTestFmt, va_list va);
+
+/**
+ * Completes a sub-test.
+ *
+ * @returns Number of chars printed.
+ */
+RTR3DECL(int) RTTestISubDone(void);
+
+/**
  * Prints an extended PASSED message, optional.
  *
Index: /trunk/src/VBox/Runtime/r3/test.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/test.cpp	(revision 19943)
+++ /trunk/src/VBox/Runtime/r3/test.cpp	(revision 19944)
@@ -34,12 +34,14 @@
 *******************************************************************************/
 #include <iprt/test.h>
+
+#include <iprt/asm.h>
+#include <iprt/critsect.h>
+#include <iprt/env.h>
+#include <iprt/err.h>
 #include <iprt/mem.h>
+#include <iprt/once.h>
 #include <iprt/param.h>
 #include <iprt/string.h>
 #include <iprt/stream.h>
-#include <iprt/critsect.h>
-#include <iprt/once.h>
-#include <iprt/err.h>
-#include <iprt/asm.h>
 
 #include "internal/magics.h"
@@ -247,4 +249,26 @@
             if (RT_SUCCESS(rc))
             {
+                /*
+                 * Finally, pick up overrides from the environment.
+                 */
+                char szMaxLevel[80];
+                rc = RTEnvGetEx(RTENV_DEFAULT, "IPRT_TEST_MAX_LEVEL", szMaxLevel, sizeof(szMaxLevel), NULL);
+                if (RT_SUCCESS(rc))
+                {
+                    char *pszMaxLevel = RTStrStrip(szMaxLevel);
+                    if (!strcmp(pszMaxLevel, "all"))
+                        pTest->enmMaxLevel = RTTESTLVL_DEBUG;
+                    if (!strcmp(pszMaxLevel, "quiet"))
+                        pTest->enmMaxLevel = RTTESTLVL_FAILURE;
+                    else if (!strcmp(pszMaxLevel, "debug"))
+                        pTest->enmMaxLevel = RTTESTLVL_DEBUG;
+                    else if (!strcmp(pszMaxLevel, "info"))
+                        pTest->enmMaxLevel = RTTESTLVL_INFO;
+                    else if (!strcmp(pszMaxLevel, "sub_test"))
+                        pTest->enmMaxLevel = RTTESTLVL_SUB_TEST;
+                    else if (!strcmp(pszMaxLevel, "failure"))
+                        pTest->enmMaxLevel = RTTESTLVL_FAILURE;
+                }
+
                 *phTest = pTest;
                 return VINF_SUCCESS;
@@ -807,4 +831,50 @@
 
 /**
+ * Format string version of RTTestSub.
+ *
+ * See RTTestSub for details.
+ *
+ * @returns Number of chars printed.
+ * @param   hTest           The test handle. If NIL_RTTEST we'll use the one
+ *                          associated with the calling thread.
+ * @param   pszSubTestFmt   The sub-test name format string.
+ * @param   ...             Arguments.
+ */
+RTR3DECL(int) RTTestSubF(RTTEST hTest, const char *pszSubTestFmt, ...)
+{
+    va_list va;
+    va_start(va, pszSubTestFmt);
+    int cch = RTTestSubV(hTest, pszSubTestFmt, va);
+    va_end(va);
+    return cch;
+}
+
+
+/**
+ * Format string version of RTTestSub.
+ *
+ * See RTTestSub for details.
+ *
+ * @returns Number of chars printed.
+ * @param   hTest           The test handle. If NIL_RTTEST we'll use the one
+ *                          associated with the calling thread.
+ * @param   pszSubTestFmt   The sub-test name format string.
+ * @param   ...             Arguments.
+ */
+RTR3DECL(int) RTTestSubV(RTTEST hTest, const char *pszSubTestFmt, va_list va)
+{
+    char *pszSubTest;
+    RTStrAPrintfV(&pszSubTest, pszSubTestFmt, va);
+    if (pszSubTest)
+    {
+        int cch = RTTestSub(hTest, pszSubTest);
+        RTStrFree(pszSubTest);
+        return cch;
+    }
+    return 0;
+}
+
+
+/**
  * Completes a sub-test.
  *
Index: /trunk/src/VBox/Runtime/r3/testi.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/testi.cpp	(revision 19943)
+++ /trunk/src/VBox/Runtime/r3/testi.cpp	(revision 19944)
@@ -50,4 +50,32 @@
     va_end(va);
     return cch;
+}
+
+
+RTR3DECL(int) RTTestISub(const char *pszSubTest)
+{
+    return RTTestSub(NIL_RTTEST, pszSubTest);
+}
+
+
+RTR3DECL(int) RTTestISubF(const char *pszSubTestFmt, ...)
+{
+    va_list va;
+    va_start(va, pszSubTestFmt);
+    int cch = RTTestSubV(NIL_RTTEST, pszSubTestFmt, va);
+    va_end(va);
+    return cch;
+}
+
+
+RTR3DECL(int) RTTestISubV(const char *pszSubTestFmt, va_list va)
+{
+    return RTTestSubV(NIL_RTTEST, pszSubTestFmt, va);
+}
+
+
+RTR3DECL(int) RTTestISubDone(void)
+{
+    return RTTestSubDone(NIL_RTTEST);
 }
 
