summaryrefslogtreecommitdiffstats
path: root/test/ssl_test.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2020-01-30 16:30:17 +0100
committerMatt Caswell <matt@openssl.org>2020-02-03 12:41:56 +0100
commit8d242823ed2270e2907914fb09004ae30263fb00 (patch)
treebbcfc0f2c0b01536b3dd2018ff4244c6e5331ccb /test/ssl_test.c
parentFix no-ec (diff)
downloadopenssl-8d242823ed2270e2907914fb09004ae30263fb00.tar.xz
openssl-8d242823ed2270e2907914fb09004ae30263fb00.zip
Fix common test framework options
PR#6975 added the ability to our test framework to have common options to all tests. For example providing the option "-test 5" to one of our test programs will just run test number 5. This can be useful when debugging tests. Unforuntately this does not work well for a number of tests. In particular those tests that call test_get_argument() without first skipping over these common test options will not get the expected value. Some tests did this correctly but a large number did not. A helper function is introduced, test_skip_common_options(), to make this easier for those tests which do not have their own specialised test option handling, but yet still need to call test_get_argument(). This function call is then added to all those tests that need it. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/10975)
Diffstat (limited to 'test/ssl_test.c')
-rw-r--r--test/ssl_test.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ssl_test.c b/test/ssl_test.c
index e54e841827..e6ce9a6741 100644
--- a/test/ssl_test.c
+++ b/test/ssl_test.c
@@ -506,6 +506,11 @@ int setup_tests(void)
{
long num_tests;
+ if (!test_skip_common_options()) {
+ TEST_error("Error parsing test options\n");
+ return 0;
+ }
+
if (!TEST_ptr(conf = NCONF_new(NULL))
/* argv[1] should point to the test conf file */
|| !TEST_int_gt(NCONF_load(conf, test_get_argument(0), NULL), 0)