mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-23 02:01:55 +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:
parent
56fe8bc26c
commit
e4c4c7667a
@ -35,6 +35,7 @@ bt_init(int argc, char *argv[])
|
||||
{
|
||||
int c;
|
||||
|
||||
bt_verbose = 0;
|
||||
bt_filename = argv[0];
|
||||
|
||||
while ((c = getopt(argc, argv, "lcftv")) >= 0)
|
||||
@ -58,7 +59,7 @@ bt_init(int argc, char *argv[])
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
bt_verbose = 1;
|
||||
bt_verbose++;
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -83,7 +84,7 @@ bt_init(int argc, char *argv[])
|
||||
return;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -30,6 +30,9 @@ void bt_test_case2(int (*fn)(void), const char *id, const char *dsc, int forked,
|
||||
#define bt_note(format, ...) \
|
||||
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() \
|
||||
bt_abort_msg("Aborted at %s:%d", __FILE__, __LINE__)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user