1#include <stdarg.h> 2#include <stdio.h> 3 4#define DEFINE_TEST_FUNC(name) \ 5 static \ 6 inline \ 7 void \ 8 name(const char *format, ...) \ 9 { \ 10 va_list args; \ 11 va_start(args, format); \ 12 common(stdout, #name, format, args); \ 13 va_end(args); \ 14 return; \ 15 } 16 17static 18inline 19void 20common(FILE *file, const char *prefix, const char *format, va_list args) 21{ 22 fprintf(file, "%s \"", prefix); 23 vfprintf(file, format, args); 24 fprintf(file, "\"\n"); // should check for trailing newline 25 return; 26} 27 28DEFINE_TEST_FUNC(PASS); 29DEFINE_TEST_FUNC(XPASS); 30DEFINE_TEST_FUNC(FAIL); 31DEFINE_TEST_FUNC(XFAIL); 32 33DEFINE_TEST_FUNC(UNTESTED); 34DEFINE_TEST_FUNC(UNSUPPORTED); 35DEFINE_TEST_FUNC(UNRESOLVED); 36