Commit e3a416bf authored by Erik Verbruggen's avatar Erik Verbruggen Committed by hjk

Make QTC_ASSERT fatal depending on env. var.

When the environment variable QTC_FATAL_ASSERTS is not empty, make
QTC_ASSERT abort (or equivalent) when the condition is not met. The
purpose is to make certain debugging cases easier without having users
apply a change and recompile.

Change-Id: I8350ed27f78dca94db0c9848bd8af4b91cec2222
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent ca433d9b
......@@ -29,11 +29,17 @@
#include "qtcassert.h"
#include <QByteArray>
namespace Utils {
void writeAssertLocation(const char *msg)
{
qDebug("SOFT ASSERT: %s", msg);
static bool goBoom = !qgetenv("QTC_FATAL_ASSERTS").isEmpty();
if (goBoom)
qFatal("SOFT ASSERT made fatal: %s", msg);
else
qDebug("SOFT ASSERT: %s", msg);
}
} // namespace Utils
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment