#include "p11-tests.h" #include "compat.h" #include #include int p11t_test_unexpected = 1; static void usage() { fprintf(stderr, "usage: p11-tests [-f config] module\n"); exit(2); } int main(int argc, char* argv[]) { const char *config = NULL; int ch; 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; case '?': default: usage(); break; } } argc -= optind; argv += optind; if(argc != 1) usage(); if(config) p11t_config_parse(config); /* Basic module tests */ p11t_module_load(argv[0]); p11t_module_initialize(); p11t_slot_tests(); p11t_session_tests(); p11t_object_tests(); p11t_rsa_tests(); /* Remaining module tests */ p11t_module_finalize(); p11t_module_unload(); p11t_config_cleanup(); return 0; }