diff options
author | Werner Koch <wk@gnupg.org> | 2017-01-03 15:34:33 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2017-01-03 15:34:33 +0100 |
commit | 3582641469f1c74078f0d758c4d5458cc0ee5649 (patch) | |
tree | d4ba2ca949981488a85fb7299b524fa24792fd56 /tests/version.c | |
parent | 0996d5f1c34a3d3012facd098a139d8abbde085f (diff) | |
download | libgcrypt-3582641469f1c74078f0d758c4d5458cc0ee5649.tar.gz |
tests: Add option --disable-hwf to the version utility.
* src/hwfeatures.c (_gcry_disable_hw_feature): Rewrite to allow
passing a colon delimited feature set.
(parse_hwf_deny_file): Remove unused var I.
* tests/version.c (main): Add options --verbose and --disable-hwf.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'tests/version.c')
-rw-r--r-- | tests/version.c | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/tests/version.c b/tests/version.c index f22c305b..baf984ec 100644 --- a/tests/version.c +++ b/tests/version.c @@ -42,8 +42,47 @@ int main (int argc, char **argv) { - (void)argc; - (void)argv; + int last_argc = -1; + + if (argc) + { argc--; argv++; } + + while (argc && last_argc != argc ) + { + last_argc = argc; + if (!strcmp (*argv, "--")) + { + argc--; argv++; + break; + } + else if (!strcmp (*argv, "--verbose")) + { + verbose++; + argc--; argv++; + } + else if (!strcmp (*argv, "--debug")) + { + /* Dummy option */ + argc--; argv++; + } + else if (!strcmp (*argv, "--disable-hwf")) + { + argc--; + argv++; + if (argc) + { + if (gcry_control (GCRYCTL_DISABLE_HWF, *argv, NULL)) + fprintf (stderr, + PGM + ": unknown hardware feature '%s' - option ignored\n", + *argv); + argc--; + argv++; + } + } + } + + xgcry_control (GCRYCTL_SET_VERBOSITY, (int)verbose); xgcry_control (GCRYCTL_DISABLE_SECMEM, 0); if (strcmp (GCRYPT_VERSION, gcry_check_version (NULL))) |