summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2008-12-08 18:32:33 +0000
committerStef Walter <stef@memberwebs.com>2008-12-08 18:32:33 +0000
commit41cc7ecf94d5dda9bed3dbd15695aae266b4a3e4 (patch)
tree393fcbee1859423089c8ace314498a1c7cb6ac05
parent356d3460f2fad27e9f7a9d2cabca2d58eacf356f (diff)
Add verbose -v flag to P11 test.
-rw-r--r--src/check.c4
-rw-r--r--src/p11-tests.c5
-rw-r--r--src/p11-tests.h3
3 files changed, 10 insertions, 2 deletions
diff --git a/src/check.c b/src/check.c
index d51457c..4c71edd 100644
--- a/src/check.c
+++ b/src/check.c
@@ -4,6 +4,8 @@
#include <ctype.h>
#include <stdarg.h>
+int p11t_check_verbose = 0;
+
int
p11t_check_fail(const char *message, ...)
{
@@ -18,6 +20,8 @@ int
p11t_check_info(const char *message, ...)
{
va_list va;
+ if(!p11t_check_verbose)
+ return CONTINUE;
va_start(va, message);
p11t_msg_code("INFO", message, va);
va_end(va);
diff --git a/src/p11-tests.c b/src/p11-tests.c
index 58f0413..0e7975c 100644
--- a/src/p11-tests.c
+++ b/src/p11-tests.c
@@ -21,13 +21,16 @@ main(int argc, char* argv[])
const char *config = NULL;
int ch;
- while((ch = getopt(argc, argv, "f:z")) != -1)
+ while((ch = getopt(argc, argv, "f:vz")) != -1)
{
switch(ch)
{
case 'f':
config = optarg;
break;
+ case 'v':
+ p11t_check_verbose = 1;
+ break;
case 'z':
p11t_test_unexpected = 0;
break;
diff --git a/src/p11-tests.h b/src/p11-tests.h
index 525e964..82bc691 100644
--- a/src/p11-tests.h
+++ b/src/p11-tests.h
@@ -46,10 +46,11 @@ enum
CONTINUE = 1
};
+extern int p11t_check_verbose;
+
#define P11T_SECTION(check) \
p11t_msg_prefix(check)
-
#define _P11T_BEGIN do {
#define _P11T_END } while(0)