diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2018-08-16 12:36:01 +1000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-02-11 15:31:51 +0100 |
commit | a43ce58f5569a160272c492c680f2e42d38ec769 (patch) | |
tree | acfaac32bee9b8e5dd832fbb49f95709c3b9741e /test/bioprinttest.c | |
parent | 9d5560331d86c6463e965321f774e4eed582ce0b (diff) |
Updated test command line parsing to support commmon commands
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6975)
Diffstat (limited to 'test/bioprinttest.c')
-rw-r--r-- | test/bioprinttest.c | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/test/bioprinttest.c b/test/bioprinttest.c index aa06039e7b..97151cdf10 100644 --- a/test/bioprinttest.c +++ b/test/bioprinttest.c @@ -1,5 +1,5 @@ /* - * Copyright 2016-2017 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -252,10 +252,38 @@ static int test_big(void) return 1; } +typedef enum OPTION_choice { + OPT_ERR = -1, + OPT_EOF = 0, + OPT_PRINT, + OPT_TEST_ENUM +} OPTION_CHOICE; + +const OPTIONS *test_get_options(void) +{ + static const OPTIONS options[] = { + OPT_TEST_OPTIONS_DEFAULT_USAGE, + { "expected", OPT_PRINT, '-', "Output values" }, + { NULL } + }; + return options; +} int setup_tests(void) { - justprint = test_has_option("-expected"); + OPTION_CHOICE o; + + while ((o = opt_next()) != OPT_EOF) { + switch (o) { + case OPT_PRINT: + justprint = 1; + break; + case OPT_TEST_CASES: + break; + default: + return 0; + } + } ADD_TEST(test_big); ADD_ALL_TESTS(test_fp, nelem(pw_params)); @@ -300,3 +328,4 @@ int test_flush_stderr(void) { return fflush(stderr); } + |