#include "p11-tests.h" #include "compat.h" #include #include #include #include int p11t_test_unexpected = 1; int p11t_test_write_session = 0; 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:svz")) != -1) { switch(ch) { case 'f': config = optarg; break; case 's': p11t_test_write_session = 1; 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); ERR_load_crypto_strings(); OpenSSL_add_all_digests(); /* Basic module tests */ p11t_module_load(argv[0]); p11t_module_initialize(); p11t_slot_tests(); p11t_session_tests(); p11t_object_tests(); p11t_key_tests(); p11t_certificate_tests(); p11t_rsa_tests(); p11t_dsa_tests(); /* Remaining module tests */ p11t_module_finalize(); p11t_module_unload(); p11t_slot_cleanup(); p11t_config_cleanup(); return 0; }