diff options
author | Stef Walter <stefw@collabora.co.uk> | 2010-12-11 11:31:01 +0800 |
---|---|---|
committer | Stef Walter <stefw@collabora.co.uk> | 2010-12-24 21:40:02 +0800 |
commit | c9562e1613eac9ded3a3e211dbd2e5420a46602b (patch) | |
tree | 3ff29178daa37a0e72a3c9a06915434d61c42c16 | |
parent | e694852b60dd75c8fe25d167672ca647006a5e8d (diff) | |
download | gsoc2013-empathy-c9562e1613eac9ded3a3e211dbd2e5420a46602b.tar gsoc2013-empathy-c9562e1613eac9ded3a3e211dbd2e5420a46602b.tar.gz gsoc2013-empathy-c9562e1613eac9ded3a3e211dbd2e5420a46602b.tar.bz2 gsoc2013-empathy-c9562e1613eac9ded3a3e211dbd2e5420a46602b.tar.lz gsoc2013-empathy-c9562e1613eac9ded3a3e211dbd2e5420a46602b.tar.xz gsoc2013-empathy-c9562e1613eac9ded3a3e211dbd2e5420a46602b.tar.zst gsoc2013-empathy-c9562e1613eac9ded3a3e211dbd2e5420a46602b.zip |
tests: Lookup the pkcs11 standalone directory at run time.
Rather than cluttering up configure, lookup the relevant
directory at runtime.
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rw-r--r-- | tests/empathy-tls-test.c | 21 |
3 files changed, 20 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac index ab8c6f3cb..28040909b 100644 --- a/configure.ac +++ b/configure.ac @@ -168,12 +168,6 @@ PKG_CHECK_MODULES(EMPATHY, gcr-3 >= $GCR_REQUIRED ]) -# Pkg Config lookup for modules used in tests -AC_MSG_CHECKING([for pkcs11 standalone modules]) -pkcs11standalonedir=$(pkg-config --variable=pkcs11standalonedir gcr-3) -AC_MSG_RESULT([$pkcs11standalonedir]) -AC_SUBST(pkcs11standalonedir) - # ----------------------------------------------------------- # evolution-data-server (about-me) # ----------------------------------------------------------- diff --git a/tests/Makefile.am b/tests/Makefile.am index 23de8d278..a9fc0cb1e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -12,7 +12,6 @@ AM_CPPFLAGS = \ $(ERROR_CFLAGS) \ -I$(top_srcdir) \ -DPKGDATADIR=\""$(pkgdatadir)"\" \ - -DP11STANDALONEDIR=\""$(pkcs11standalonedir)"\" \ -DGCR_API_SUBJECT_TO_CHANGE \ $(EMPATHY_CFLAGS) \ $(WARN_CFLAGS) \ diff --git a/tests/empathy-tls-test.c b/tests/empathy-tls-test.c index 48833b36d..f508b368c 100644 --- a/tests/empathy-tls-test.c +++ b/tests/empathy-tls-test.c @@ -327,16 +327,35 @@ add_pkcs11_module_for_testing (Test *test, const gchar *filename, { GError *error = NULL; gchar *args, *path, *directory; + gchar *standalone, *error_output; + gint exit_status; directory = g_build_filename (g_getenv ("EMPATHY_SRCDIR"), "tests", "certificates", subdir, NULL); + /* + * Lookup the directory for standalone pkcs11 modules installed by + * gnome-keyring. We use these for testing our implementation. + */ + g_spawn_command_line_sync ("pkg-config --variable=pkcs11standalonedir gcr-3", + &standalone, &error_output, &exit_status, &error); + g_assert_no_error (error); + if (exit_status != 0) + { + g_warning ("couldn't determine standalone pkcs11 module directory: %d: %s", + exit_status, error_output); + g_assert_not_reached (); + } + + g_strstrip (standalone); args = g_strdup_printf ("directory=\"%s\"", directory); - path = g_build_filename (P11STANDALONEDIR, filename, NULL); + path = g_build_filename (standalone, filename, NULL); gcr_pkcs11_add_module_from_file (path, args, &error); g_assert_no_error (error); g_free (directory); + g_free (standalone); + g_free (error_output); g_free (args); g_free (path); } |