summaryrefslogtreecommitdiff
path: root/regress/unittests/test_helper
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2018-10-17 23:28:05 +0000
committerDarren Tucker <dtucker@dtucker.net>2018-11-22 16:14:31 +1100
commit35d0e5fefc419bddcbe09d7fc163d8cd3417125b (patch)
treec47dbf67447dddd82deb0539ce01b574f09a3819 /regress/unittests/test_helper
parentc1941293d9422a14dda372b4c21895e72aa7a063 (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.c28
-rw-r--r--regress/unittests/test_helper/test_helper.h4
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;
115static void *onerror_ctx = NULL; 115static void *onerror_ctx = NULL;
116static const char *data_dir = NULL; 116static const char *data_dir = NULL;
117static char subtest_info[512]; 117static char subtest_info[512];
118static int fast = 0;
119static int slow = 0;
118 120
119int 121int
120main(int argc, char **argv) 122main(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
169int 177int
170test_is_verbose() 178test_is_verbose(void)
171{ 179{
172 return verbose_mode; 180 return verbose_mode;
173} 181}
174 182
175int 183int
176test_is_quiet() 184test_is_quiet(void)
177{ 185{
178 return quiet_mode; 186 return quiet_mode;
179} 187}
180 188
189int
190test_is_fast(void)
191{
192 return fast;
193}
194
195int
196test_is_slow(void)
197{
198 return slow;
199}
200
181const char * 201const char *
182test_data_file(const char *name) 202test_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);
45void test_done(void); 45void test_done(void);
46int test_is_verbose(void); 46int test_is_verbose(void);
47int test_is_quiet(void); 47int test_is_quiet(void);
48int test_is_fast(void);
49int test_is_slow(void);
48void test_subtest_info(const char *fmt, ...) 50void test_subtest_info(const char *fmt, ...)
49 __attribute__((format(printf, 1, 2))); 51 __attribute__((format(printf, 1, 2)));
50void ssl_err_check(const char *file, int line); 52void ssl_err_check(const char *file, int line);