Skip to content
Snippets Groups Projects
Commit e3a416bf authored by Erik Verbruggen's avatar Erik Verbruggen Committed by hjk
Browse files

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
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment