Index: /trunk/include/iprt/test.h
===================================================================
--- /trunk/include/iprt/test.h	(revision 20108)
+++ /trunk/include/iprt/test.h	(revision 20109)
@@ -203,4 +203,26 @@
 
 /**
+ * Skips the test, destroys the test instance and return an exit code.
+ *
+ * @returns Test program exit code.
+ * @param   hTest           The test handle. If NIL_RTTEST we'll use the one
+ *                          associated with the calling thread.
+ * @param   pszReasonFmt    Text explaining why, optional (NULL).
+ * @param   va              Arguments for the reason format string.
+ */
+RTR3DECL(int) RTTestSkipAndDestroyV(RTTEST hTest, const char *pszReason, va_list va);
+
+/**
+ * Skips the test, destroys the test instance and return an exit code.
+ *
+ * @returns Test program exit code.
+ * @param   hTest           The test handle. If NIL_RTTEST we'll use the one
+ *                          associated with the calling thread.
+ * @param   pszReasonFmt    Text explaining why, optional (NULL).
+ * @param   va              Arguments for the reason format string.
+ */
+RTR3DECL(int) RTTestSkipAndDestroy(RTTEST hTest, const char *pszReason, ...);
+
+/**
  * Starts a sub-test.
  *
Index: /trunk/src/VBox/Runtime/r3/test.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/test.cpp	(revision 20108)
+++ /trunk/src/VBox/Runtime/r3/test.cpp	(revision 20109)
@@ -166,4 +166,5 @@
 *******************************************************************************/
 static void rtTestGuardedFreeOne(PRTTESTGUARDEDMEM pMem);
+static int rtTestPrintf(PRTTESTINT pTest, const char *pszFormat, ...);
 
 
@@ -304,4 +305,10 @@
 
     /*
+     * Make sure we end with a new line.
+     */
+    if (!pTest->fNewLine)
+        rtTestPrintf(pTest, "\n");
+
+    /*
      * Clean up.
      */
@@ -786,6 +793,43 @@
     }
 
-
     RTTestDestroy(pTest);
+    return rc;
+}
+
+
+RTR3DECL(int) RTTestSkipAndDestroyV(RTTEST hTest, const char *pszReason, va_list va)
+{
+    PRTTESTINT pTest = hTest;
+    RTTEST_GET_VALID_RETURN_RC(pTest, 2);
+
+    RTCritSectEnter(&pTest->Lock);
+    rtTestSubTestReport(pTest);
+    RTCritSectLeave(&pTest->Lock);
+
+    int rc;
+    if (!pTest->cErrors)
+    {
+        if (pszReason)
+            RTTestPrintfNlV(hTest, RTTESTLVL_FAILURE, pszReason, va);
+        RTTestPrintfNl(hTest, RTTESTLVL_ALWAYS, "SKIPPED\n", pTest->cErrors);
+        rc = 2;
+    }
+    else
+    {
+        RTTestPrintfNl(hTest, RTTESTLVL_ALWAYS, "FAILURE - %u errors\n", pTest->cErrors);
+        rc = 1;
+    }
+
+    RTTestDestroy(pTest);
+    return rc;
+}
+
+
+RTR3DECL(int) RTTestSkipAndDestroy(RTTEST hTest, const char *pszReason, ...)
+{
+    va_list va;
+    va_start(va, pszReason);
+    int rc = RTTestSkipAndDestroyV(hTest, pszReason, va);
+    va_end(va);
     return rc;
 }
