summaryrefslogtreecommitdiff
path: root/src/p11-tests.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/p11-tests.c')
-rw-r--r--src/p11-tests.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/p11-tests.c b/src/p11-tests.c
index e69de29..80185cf 100644
--- a/src/p11-tests.c
+++ b/src/p11-tests.c
@@ -0,0 +1,43 @@
+
+
+#include "p11-tests.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+static void
+usage()
+{
+ fprintf(stderr, "usage: p11-tests module [init_string]\n");
+ exit(2);
+}
+
+int
+main(int argc, char* argv[])
+{
+ int ch;
+
+ while((ch = getopt(argc, argv, "")) != -1)
+ {
+ switch(ch)
+ {
+ case '?':
+ default:
+ usage();
+ break;
+ }
+ }
+
+ argc -= optind;
+ argv += optind;
+
+ if(argc < 1 || argc > 2)
+ usage();
+
+ p11t_module_load(argv[0]);
+
+ p11t_module_unload();
+
+ return 0;
+}