0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-23 02:01:55 +00:00

Birdtest: Add an another verbose level for tests

This commit is contained in:
Pavel Tvrdík 2015-08-04 14:40:40 +02:00
parent 3ed4f968c0
commit aad0af2fd7
2 changed files with 5 additions and 7 deletions

View File

@ -102,7 +102,7 @@ bt_init(int argc, char *argv[])
return;
usage:
printf("Usage: %s [-l] [-c] [-f] [-t] [-vv] [<test_id>]\n", argv[0]);
printf("Usage: %s [-l] [-c] [-f] [-t] [-vvv] [<test_id>]\n", argv[0]);
exit(3);
}
@ -204,7 +204,7 @@ get_num_terminal_cols(void)
void
bt_result(const char *to_right_align_msg, const char *to_left_align_msg, ...)
{
if (bt_verbose)
if (bt_verbose >= BT_VERBOSE_TEST_SUITE)
{
char msg_buf[BT_BUFFER_SIZE];

View File

@ -18,8 +18,9 @@ extern int bt_test_suite_success;
extern int bt_verbose;
#define BT_VERBOSE_NOTHING 0
#define BT_VERBOSE_TEST_CASE 1
#define BT_VERBOSE_DEBUG 2
#define BT_VERBOSE_TEST_SUITE 1
#define BT_VERBOSE_TEST_CASE 2
#define BT_VERBOSE_DEBUG 3
extern const char *bt_filename;
extern const char *bt_test_id;
@ -63,9 +64,6 @@ void bt_result(const char *result, const char *msg, ...);
fprintf(stderr, "%s: %s: " format "\n", bt_filename, bt_test_id, ##__VA_ARGS__); \
} while(0)
#define bt_log_test_case(format, ...) \
do { if (bt_verbose >= BT_VERBOSE_TEST_CASE) bt_log(format, ##__VA_ARGS__); } while (0)
#define bt_debug(format, ...) \
do { if (bt_verbose >= BT_VERBOSE_DEBUG) printf(format, ##__VA_ARGS__); } while (0)