diff options
Diffstat (limited to 'regress/unittests/test_helper')
-rw-r--r-- | regress/unittests/test_helper/test_helper.c | 33 | ||||
-rw-r--r-- | regress/unittests/test_helper/test_helper.h | 4 |
2 files changed, 32 insertions, 5 deletions
diff --git a/regress/unittests/test_helper/test_helper.c b/regress/unittests/test_helper/test_helper.c index 4cc70852c..e7a47b265 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.11 2018/11/23 02:53:57 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2011 Damien Miller <djm@mindrot.org> | 3 | * Copyright (c) 2011 Damien Miller <djm@mindrot.org> |
4 | * | 4 | * |
@@ -35,11 +35,13 @@ | |||
35 | #include <signal.h> | 35 | #include <signal.h> |
36 | 36 | ||
37 | #include <openssl/bn.h> | 37 | #include <openssl/bn.h> |
38 | #include <openssl/err.h> | ||
38 | 39 | ||
39 | #if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) && !defined(BROKEN_STRNVIS) | 40 | #if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) && !defined(BROKEN_STRNVIS) |
40 | # include <vis.h> | 41 | # include <vis.h> |
41 | #endif | 42 | #endif |
42 | 43 | ||
44 | #include "entropy.h" | ||
43 | #include "test_helper.h" | 45 | #include "test_helper.h" |
44 | #include "atomicio.h" | 46 | #include "atomicio.h" |
45 | 47 | ||
@@ -115,12 +117,17 @@ static test_onerror_func_t *test_onerror = NULL; | |||
115 | static void *onerror_ctx = NULL; | 117 | static void *onerror_ctx = NULL; |
116 | static const char *data_dir = NULL; | 118 | static const char *data_dir = NULL; |
117 | static char subtest_info[512]; | 119 | static char subtest_info[512]; |
120 | static int fast = 0; | ||
121 | static int slow = 0; | ||
118 | 122 | ||
119 | int | 123 | int |
120 | main(int argc, char **argv) | 124 | main(int argc, char **argv) |
121 | { | 125 | { |
122 | int ch; | 126 | int ch; |
123 | 127 | ||
128 | seed_rng(); | ||
129 | ERR_load_CRYPTO_strings(); | ||
130 | |||
124 | /* Handle systems without __progname */ | 131 | /* Handle systems without __progname */ |
125 | if (__progname == NULL) { | 132 | if (__progname == NULL) { |
126 | __progname = strrchr(argv[0], '/'); | 133 | __progname = strrchr(argv[0], '/'); |
@@ -134,8 +141,14 @@ main(int argc, char **argv) | |||
134 | } | 141 | } |
135 | } | 142 | } |
136 | 143 | ||
137 | while ((ch = getopt(argc, argv, "vqd:")) != -1) { | 144 | while ((ch = getopt(argc, argv, "Ffvqd:")) != -1) { |
138 | switch (ch) { | 145 | switch (ch) { |
146 | case 'F': | ||
147 | slow = 1; | ||
148 | break; | ||
149 | case 'f': | ||
150 | fast = 1; | ||
151 | break; | ||
139 | case 'd': | 152 | case 'd': |
140 | data_dir = optarg; | 153 | data_dir = optarg; |
141 | break; | 154 | break; |
@@ -167,17 +180,29 @@ main(int argc, char **argv) | |||
167 | } | 180 | } |
168 | 181 | ||
169 | int | 182 | int |
170 | test_is_verbose() | 183 | test_is_verbose(void) |
171 | { | 184 | { |
172 | return verbose_mode; | 185 | return verbose_mode; |
173 | } | 186 | } |
174 | 187 | ||
175 | int | 188 | int |
176 | test_is_quiet() | 189 | test_is_quiet(void) |
177 | { | 190 | { |
178 | return quiet_mode; | 191 | return quiet_mode; |
179 | } | 192 | } |
180 | 193 | ||
194 | int | ||
195 | test_is_fast(void) | ||
196 | { | ||
197 | return fast; | ||
198 | } | ||
199 | |||
200 | int | ||
201 | test_is_slow(void) | ||
202 | { | ||
203 | return slow; | ||
204 | } | ||
205 | |||
181 | const char * | 206 | const char * |
182 | test_data_file(const char *name) | 207 | test_data_file(const char *name) |
183 | { | 208 | { |
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); |