#include "p11-tests.h" #include #include #include 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(); /* Basic module tests */ p11t_module_load(argv[0]); p11t_module_initialize(argc == 2 ? argv[1] : NULL); p11t_info_tests(); /* Remaining module tests */ p11t_module_finalize(); p11t_module_unload(); return 0; }