#include "fail.h"
#include "../str.h"
#include "../log.h"
#include "backtrace.h"
#include <stdarg.h>
void test_fail_va (const char *func, const char *file, int line, int skip, const char *fmt, va_list vargs)
{
// log it
log_output_tag(LOG_ERROR, "FAIL", func, fmt, vargs, " @@ %s@%s:%d - backtrace follows:", func, file, line);
// print out a stack dump, not including this function or the backtrace func
test_backtrace(skip + 2);
// then exit with a failure code
abort();
}
void test_fail (const char *func, const char *file, int line, int skip, const char *fmt, ...)
{
va_list vargs;
va_start(vargs, fmt);
test_fail_va(func, file, line, skip, fmt, vargs);
va_end(vargs);
}