summaryrefslogtreecommitdiff
path: root/test/birdtest.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2019-07-24 15:38:32 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2019-07-24 15:38:32 +0200
commitcec40a74679821513e627f93b924067a404f6475 (patch)
tree793bbe5b326e7008e4657cf11b2937cafbe3d922 /test/birdtest.c
parent18f70a6229f586d5e4f387075be42d7a1ef5d269 (diff)
parent8263690e754a83b8f3c58bd0080a1628d6cba556 (diff)
Merge remote-tracking branch 'origin/mq-filter-stack'
Diffstat (limited to 'test/birdtest.c')
-rw-r--r--test/birdtest.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/birdtest.c b/test/birdtest.c
index 7b6fb0b5..c0d4bd05 100644
--- a/test/birdtest.c
+++ b/test/birdtest.c
@@ -31,6 +31,7 @@
static const char *request;
static int list_tests;
static int do_core;
+static int do_die;
static int no_fork;
static int no_timeout;
static int is_terminal; /* Whether stdout is a live terminal or pipe redirect */
@@ -61,7 +62,7 @@ bt_init(int argc, char *argv[])
bt_test_id = NULL;
is_terminal = isatty(fileno(stdout));
- while ((c = getopt(argc, argv, "lcftv")) >= 0)
+ while ((c = getopt(argc, argv, "lcdftv")) >= 0)
switch (c)
{
case 'l':
@@ -72,6 +73,10 @@ bt_init(int argc, char *argv[])
do_core = 1;
break;
+ case 'd':
+ do_die = 1;
+ break;
+
case 'f':
no_fork = 1;
break;
@@ -105,10 +110,11 @@ bt_init(int argc, char *argv[])
return;
usage:
- printf("Usage: %s [-l] [-c] [-f] [-t] [-vvv] [<test_suit_name>]\n", argv[0]);
+ printf("Usage: %s [-l] [-c] [-d] [-f] [-t] [-vvv] [<test_suit_name>]\n", argv[0]);
printf("Options: \n");
printf(" -l List all test suite names and descriptions \n");
printf(" -c Force unlimit core dumps (needs root privileges) \n");
+ printf(" -d Die on first failed test case \n");
printf(" -f No forking \n");
printf(" -t No timeout limit \n");
printf(" -v More verbosity, maximum is 3 -vvv \n");
@@ -217,6 +223,9 @@ bt_log_result(int result, const char *fmt, va_list argptr)
result_str = is_terminal ? BT_PROMPT_FAIL : BT_PROMPT_FAIL_NO_COLOR;
printf("%s\n", result_str);
+
+ if (do_die && !result)
+ abort();
}
/**