mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 08:47:28 +01:00
Refactor testlib's funcname handling.
This commit is contained in:
1 parent
8d6694a752
commit
88e2d4cf59
3 files changed
+32
-31
No files matched your search
@@ -16,6 +16,7 @@ typedef void (*test)();
|
||||
test tests[];
|
||||
|
||||
const char* test_filename;
|
||||
const char* test_funcname = "";
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
// The order matters here. Clang also defines "__GNUC__".
|
||||
@@ -32,7 +33,8 @@ int main(int argc, char** argv) {
|
||||
for (test* t = tests; *t; t++) {
|
||||
(*t)();
|
||||
if (fail_msg[0]) {
|
||||
printf("%-16s%-8sFAIL %s\n", test_filename, cc, fail_msg);
|
||||
printf("%-16s%-8sFAIL %s: %s\n", test_filename, cc, test_funcname,
|
||||
fail_msg);
|
||||
return 1;
|
||||
}
|
||||
tests_run++;
|
||||
|
||||
Reference in new issue
Block a user