mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-01-09 18:41:55 +00:00
Birdtest: Add an another verbose level for tests
This commit is contained in:
parent
3ed4f968c0
commit
aad0af2fd7
@ -102,7 +102,7 @@ bt_init(int argc, char *argv[])
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
usage:
|
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);
|
exit(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,7 +204,7 @@ get_num_terminal_cols(void)
|
|||||||
void
|
void
|
||||||
bt_result(const char *to_right_align_msg, const char *to_left_align_msg, ...)
|
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];
|
char msg_buf[BT_BUFFER_SIZE];
|
||||||
|
|
||||||
|
@ -18,8 +18,9 @@ extern int bt_test_suite_success;
|
|||||||
|
|
||||||
extern int bt_verbose;
|
extern int bt_verbose;
|
||||||
#define BT_VERBOSE_NOTHING 0
|
#define BT_VERBOSE_NOTHING 0
|
||||||
#define BT_VERBOSE_TEST_CASE 1
|
#define BT_VERBOSE_TEST_SUITE 1
|
||||||
#define BT_VERBOSE_DEBUG 2
|
#define BT_VERBOSE_TEST_CASE 2
|
||||||
|
#define BT_VERBOSE_DEBUG 3
|
||||||
|
|
||||||
extern const char *bt_filename;
|
extern const char *bt_filename;
|
||||||
extern const char *bt_test_id;
|
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__); \
|
fprintf(stderr, "%s: %s: " format "\n", bt_filename, bt_test_id, ##__VA_ARGS__); \
|
||||||
} while(0)
|
} 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, ...) \
|
#define bt_debug(format, ...) \
|
||||||
do { if (bt_verbose >= BT_VERBOSE_DEBUG) printf(format, ##__VA_ARGS__); } while (0)
|
do { if (bt_verbose >= BT_VERBOSE_DEBUG) printf(format, ##__VA_ARGS__); } while (0)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user