0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2025-01-10 19:11:54 +00:00

Birdtest: add bt_debug() for tests debug outputs

Debug outputs will show with launch test with param -vv
This commit is contained in:
Pavel Tvrdík 2015-03-13 18:27:33 +01:00
parent 56fe8bc26c
commit e4c4c7667a
2 changed files with 6 additions and 2 deletions

View File

@ -35,6 +35,7 @@ bt_init(int argc, char *argv[])
{ {
int c; int c;
bt_verbose = 0;
bt_filename = argv[0]; bt_filename = argv[0];
while ((c = getopt(argc, argv, "lcftv")) >= 0) while ((c = getopt(argc, argv, "lcftv")) >= 0)
@ -58,7 +59,7 @@ bt_init(int argc, char *argv[])
break; break;
case 'v': case 'v':
bt_verbose = 1; bt_verbose++;
break; break;
default: default:
@ -83,7 +84,7 @@ bt_init(int argc, char *argv[])
return; return;
usage: usage:
printf("Usage: %s [-l] [-c] [-f] [-t] [-v] [<test_id>]\n", argv[0]); printf("Usage: %s [-l] [-c] [-f] [-t] [-vv] [<test_id>]\n", argv[0]);
exit(3); exit(3);
} }

View File

@ -30,6 +30,9 @@ void bt_test_case2(int (*fn)(void), const char *id, const char *dsc, int forked,
#define bt_note(format, ...) \ #define bt_note(format, ...) \
do { if (bt_verbose) bt_log(format, ##__VA_ARGS__); } while (0) do { if (bt_verbose) bt_log(format, ##__VA_ARGS__); } while (0)
#define bt_debug(format, ...) \
do { if (bt_verbose > 1) printf(format, ##__VA_ARGS__); } while (0)
#define bt_abort() \ #define bt_abort() \
bt_abort_msg("Aborted at %s:%d", __FILE__, __LINE__) bt_abort_msg("Aborted at %s:%d", __FILE__, __LINE__)