Add new macro fail_msg

Signed-off-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
diff --git a/include/cmocka.h b/include/cmocka.h
index 372e134..02757ef 100644
--- a/include/cmocka.h
+++ b/include/cmocka.h
@@ -1246,6 +1246,18 @@
 
 #ifdef DOXYGEN
 /**
+ * @brief Forces the test to fail immediately and quit, printing the reason.
+ */
+void fail_msg(const char *msg, ...);
+#else
+#define fail_msg(msg, ...) do { \
+    print_error("ERROR: " msg "\n", ##__VA_ARGS__); \
+    fail(); \
+} while (0)
+#endif
+
+#ifdef DOXYGEN
+/**
  * @brief Generic method to run a single test.
  *
  * @param[in]  #function The function to test.