diff options
author | djm@openbsd.org <djm@openbsd.org> | 2018-10-17 23:28:05 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2018-11-22 16:14:31 +1100 |
commit | 35d0e5fefc419bddcbe09d7fc163d8cd3417125b (patch) | |
tree | c47dbf67447dddd82deb0539ce01b574f09a3819 /regress/unittests/test_helper | |
parent | c1941293d9422a14dda372b4c21895e72aa7a063 (diff) |
upstream: add some knobs:
UNITTEST_FAST?= no # Skip slow tests (e.g. less intensive fuzzing).
UNITTEST_SLOW?= no # Include slower tests (e.g. more intensive fuzzing).
UNITTEST_VERBOSE?= no # Verbose test output (inc. per-test names).
useful if you want to run the tests as a smoke test to exercise the
functionality without waiting for all the fuzzers to run.
OpenBSD-Regress-ID: e04d82ebec86068198cd903acf1c67563c57315e
Diffstat (limited to 'regress/unittests/test_helper')
-rw-r--r-- | regress/unittests/test_helper/test_helper.c | 28 | ||||
-rw-r--r-- | regress/unittests/test_helper/test_helper.h | 4 |
2 files changed, 27 insertions, 5 deletions
diff --git a/regress/unittests/test_helper/test_helper.c b/regress/unittests/test_helper/test_helper.c index 4cc70852c..6200ccd58 100644 --- a/regress/unittests/test_helper/test_helper.c +++ b/regress/unittests/test_helper/test_helper.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: test_helper.c,v 1.8 2018/02/08 08:46:20 djm Exp $ */ | 1 | /* $OpenBSD: test_helper.c,v 1.9 2018/10/17 23:28:05 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2011 Damien Miller <djm@mindrot.org> | 3 | * Copyright (c) 2011 Damien Miller <djm@mindrot.org> |
4 | * | 4 | * |
@@ -115,6 +115,8 @@ static test_onerror_func_t *test_onerror = NULL; | |||
115 | static void *onerror_ctx = NULL; | 115 | static void *onerror_ctx = NULL; |
116 | static const char *data_dir = NULL; | 116 | static const char *data_dir = NULL; |
117 | static char subtest_info[512]; | 117 | static char subtest_info[512]; |
118 | static int fast = 0; | ||
119 | static int slow = 0; | ||
118 | 120 | ||
119 | int | 121 | int |
120 | main(int argc, char **argv) | 122 | main(int argc, char **argv) |
@@ -134,8 +136,14 @@ main(int argc, char **argv) | |||
134 | } | 136 | } |
135 | } | 137 | } |
136 | 138 | ||
137 | while ((ch = getopt(argc, argv, "vqd:")) != -1) { | 139 | while ((ch = getopt(argc, argv, "Ffvqd:")) != -1) { |
138 | switch (ch) { | 140 | switch (ch) { |
141 | case 'F': | ||
142 | slow = 1; | ||
143 | break; | ||
144 | case 'f': | ||
145 | fast = 1; | ||
146 | break; | ||
139 | case 'd': | 147 | case 'd': |
140 | data_dir = optarg; | 148 | data_dir = optarg; |
141 | break; | 149 | break; |
@@ -167,17 +175,29 @@ main(int argc, char **argv) | |||
167 | } | 175 | } |
168 | 176 | ||
169 | int | 177 | int |
170 | test_is_verbose() | 178 | test_is_verbose(void) |
171 | { | 179 | { |
172 | return verbose_mode; | 180 | return verbose_mode; |
173 | } | 181 | } |
174 | 182 | ||
175 | int | 183 | int |
176 | test_is_quiet() | 184 | test_is_quiet(void) |
177 | { | 185 | { |
178 | return quiet_mode; | 186 | return quiet_mode; |
179 | } | 187 | } |
180 | 188 | ||
189 | int | ||
190 | test_is_fast(void) | ||
191 | { | ||
192 | return fast; | ||
193 | } | ||
194 | |||
195 | int | ||
196 | test_is_slow(void) | ||
197 | { | ||
198 | return slow; | ||
199 | } | ||
200 | |||
181 | const char * | 201 | const char * |
182 | test_data_file(const char *name) | 202 | test_data_file(const char *name) |
183 | { | 203 | { |
diff --git a/regress/unittests/test_helper/test_helper.h b/regress/unittests/test_helper/test_helper.h index 6da0066e9..1f893c8dd 100644 --- a/regress/unittests/test_helper/test_helper.h +++ b/regress/unittests/test_helper/test_helper.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: test_helper.h,v 1.8 2018/02/08 08:46:20 djm Exp $ */ | 1 | /* $OpenBSD: test_helper.h,v 1.9 2018/10/17 23:28:05 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2011 Damien Miller <djm@mindrot.org> | 3 | * Copyright (c) 2011 Damien Miller <djm@mindrot.org> |
4 | * | 4 | * |
@@ -45,6 +45,8 @@ void set_onerror_func(test_onerror_func_t *f, void *ctx); | |||
45 | void test_done(void); | 45 | void test_done(void); |
46 | int test_is_verbose(void); | 46 | int test_is_verbose(void); |
47 | int test_is_quiet(void); | 47 | int test_is_quiet(void); |
48 | int test_is_fast(void); | ||
49 | int test_is_slow(void); | ||
48 | void test_subtest_info(const char *fmt, ...) | 50 | void test_subtest_info(const char *fmt, ...) |
49 | __attribute__((format(printf, 1, 2))); | 51 | __attribute__((format(printf, 1, 2))); |
50 | void ssl_err_check(const char *file, int line); | 52 | void ssl_err_check(const char *file, int line); |