| 1 |
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ |
| 2 |
/* check-module.c: Check PKCS#11 implementation |
| 3 |
|
| 4 |
Copyright (C) 2009 Stefan Walter |
| 5 |
|
| 6 |
The Gnome Keyring Library is free software; you can redistribute it and/or |
| 7 |
modify it under the terms of the GNU Library General Public License as |
| 8 |
published by the Free Software Foundation; either version 2 of the |
| 9 |
License, or (at your option) any later version. |
| 10 |
|
| 11 |
The Gnome Keyring Library is distributed in the hope that it will be useful, |
| 12 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 |
Library General Public License for more details. |
| 15 |
|
| 16 |
You should have received a copy of the GNU Library General Public |
| 17 |
License along with the Gnome Library; see the file COPYING.LIB. If not, |
| 18 |
<http://www.gnu.org/licenses/>. |
| 19 |
|
| 20 |
Author: Stef Walter <[email protected]> |
| 21 |
*/ |
| 22 |
|
| 23 |
#include "config.h" |
| 24 |
|
| 25 |
#include "gnome2-store/gkm-gnome2-store.h" |
| 26 |
|
| 27 |
#include "egg/egg-secure-memory.h" |
| 28 |
|
| 29 |
#include <glib.h> |
| 30 |
#include <glib-object.h> |
| 31 |
|
| 32 |
#include <p11-tests.h> |
| 33 |
|
| 34 |
static int failures = 0; |
| 35 |
|
| 36 |
EGG_SECURE_DEFINE_GLIB_GLOBALS (); |
| 37 |
|
| 38 |
static void |
| 39 |
on_p11_tests_log (int level, const char *section, const char *message) |
| 40 |
{ |
| 41 |
if (level == P11_TESTS_NONE) { |
| 42 |
g_message ("%s", message); |
| 43 |
} else if (level != P11_TESTS_FAIL) { |
| 44 |
g_message ("%s: %s", section, message); |
| 45 |
} else { |
| 46 |
g_print (" /gnome2-store/%s: FAIL: %s\n", section, message); |
| 47 |
++failures; |
| 48 |
} |
| 49 |
} |
| 50 |
|
| 51 |
int |
| 52 |
main (int argc, const char *argv[]) |
| 53 |
{ |
| 54 |
#if !GLIB_CHECK_VERSION(2,35,0) |
| 55 |
g_type_init (); |
| 56 |
#endif |
| 57 |
|
| 58 |
p11_tests_set_log_func (on_p11_tests_log); |
| 59 |
p11_tests_set_unexpected (1); |
| 60 |
p11_tests_set_verbose (0); |
| 61 |
p11_tests_set_write_session (1); |
| 62 |
p11_tests_load_config (SRCDIR "/p11-tests.conf"); |
| 63 |
|
| 64 |
g_print ("CHECK: check-gnome2-module...\n"); |
| 65 |
p11_tests_perform (gkm_gnome2_store_get_functions ()); |
| 66 |
|
| 67 |
g_print ("%s: check-gnome2-module\n", failures ? "FAIL" : "PASS"); |
| 68 |
return failures; |
| 69 |
} |