diff options
author | Stef Walter <stefw@gnome.org> | 2014-03-04 16:12:16 +0100 |
---|---|---|
committer | Stef Walter <stefw@gnome.org> | 2014-03-05 13:02:15 +0100 |
commit | 50e0feec5d80263ba2c65d005290a3e9837905f4 (patch) | |
tree | b014be9d7a182affbd4440a5c7ac59fb79f0bbde /pkcs11/xdg-store | |
parent | beea17679b71bdcb5363bc5844f1ed826d4424be (diff) | |
download | gnome-keyring-50e0feec5d80263ba2c65d005290a3e9837905f4.tar.gz |
Makefile.am: Move tests into same directories as tested code
This allows for a cleaner build tree, and will provide benefits
when moving to a single Makefile.
Diffstat (limited to 'pkcs11/xdg-store')
-rw-r--r-- | pkcs11/xdg-store/Makefile.am | 53 | ||||
-rw-r--r-- | pkcs11/xdg-store/check-xdg-module.c (renamed from pkcs11/xdg-store/tests/check-xdg-module.c) | 0 | ||||
-rw-r--r-- | pkcs11/xdg-store/dump-trust-file.c (renamed from pkcs11/xdg-store/tests/dump-trust-file.c) | 0 | ||||
-rw-r--r-- | pkcs11/xdg-store/fixtures/test-certificate-1.cer (renamed from pkcs11/xdg-store/tests/files/test-certificate-1.cer) | bin | 813 -> 813 bytes | |||
-rw-r--r-- | pkcs11/xdg-store/fixtures/test-certificate-2.cer (renamed from pkcs11/xdg-store/tests/files/test-certificate-2.cer) | bin | 813 -> 813 bytes | |||
-rw-r--r-- | pkcs11/xdg-store/fixtures/test-refer-1.trust (renamed from pkcs11/xdg-store/tests/files/test-refer-1.trust) | bin | 241 -> 241 bytes | |||
-rw-r--r-- | pkcs11/xdg-store/frob-trust-file.c (renamed from pkcs11/xdg-store/tests/frob-trust-file.c) | 0 | ||||
-rw-r--r-- | pkcs11/xdg-store/mock-xdg-module.c (renamed from pkcs11/xdg-store/tests/mock-xdg-module.c) | 6 | ||||
-rw-r--r-- | pkcs11/xdg-store/mock-xdg-module.h (renamed from pkcs11/xdg-store/tests/mock-xdg-module.h) | 0 | ||||
-rw-r--r-- | pkcs11/xdg-store/p11-tests.conf (renamed from pkcs11/xdg-store/tests/p11-tests.conf) | 0 | ||||
-rw-r--r-- | pkcs11/xdg-store/test-xdg-module.c (renamed from pkcs11/xdg-store/tests/test-xdg-module.c) | 2 | ||||
-rw-r--r-- | pkcs11/xdg-store/test-xdg-trust.c (renamed from pkcs11/xdg-store/tests/test-xdg-trust.c) | 2 | ||||
-rw-r--r-- | pkcs11/xdg-store/tests/Makefile.am | 54 |
13 files changed, 54 insertions, 63 deletions
diff --git a/pkcs11/xdg-store/Makefile.am b/pkcs11/xdg-store/Makefile.am index e34b8635..680f662a 100644 --- a/pkcs11/xdg-store/Makefile.am +++ b/pkcs11/xdg-store/Makefile.am @@ -4,6 +4,7 @@ INCLUDES = \ -I$(top_builddir) \ -I$(top_srcdir) \ -I$(top_srcdir)/pkcs11 \ + -DSRCDIR="\"@abs_srcdir@\"" \ $(GOBJECT_CFLAGS) \ $(LIBGCRYPT_CFLAGS) \ $(GLIB_CFLAGS) \ @@ -52,11 +53,55 @@ gkm_xdg_store_standalone_la_LIBADD = \ $(GMODULE_LIBS) \ $(LIBGCRYPT_LIBS) +asn: + asn1Parser -o xdg.asn.h xdg.asn + sed -i 's|#include.*|/* \0 */|' xdg.asn.h # ------------------------------------------------------------------------------- +# TESTS -SUBDIRS = . tests +LDADD = \ + libgkm-mock-xdg-module.a \ + $(top_builddir)/pkcs11/xdg-store/libgkm-xdg-store.la \ + $(top_builddir)/pkcs11/gkm/libgkm.la \ + $(top_builddir)/egg/libegg.la \ + $(GLIB_LIBS) \ + $(GTHREAD_LIBS) \ + $(LIBGCRYPT_LIBS) -asn: - asn1Parser -o xdg.asn.h xdg.asn - sed -i 's|#include.*|/* \0 */|' xdg.asn.h +if WITH_P11_TESTS +CHECK_PROGS = check-xdg-module +else +CHECK_PROGS = +endif + +TEST_PROGS = \ + test-xdg-module \ + test-xdg-trust + +check_PROGRAMS = $(TEST_PROGS) + +test: $(TEST_PROGS) $(CHECK_PROGS) + gtester --verbose -m $(TEST_MODE) --g-fatal-warnings $(TEST_PROGS) + @for prog in $(CHECK_PROGS); do SRCDIR='.' ./$$prog || exit 1; done + +check-local: test + +all-local: $(check_PROGRAMS) + +EXTRA_DIST += \ + p11-tests.conf \ + fixtures + +noinst_PROGRAMS = \ + frob-trust-file \ + dump-trust-file \ + $(CHECK_PROGS) + +check_xdg_module_CFLAGS = $(P11_TESTS_CFLAGS) +check_xdg_module_LDADD = $(P11_TESTS_LIBS) $(LDADD) + +noinst_LIBRARIES = libgkm-mock-xdg-module.a + +libgkm_mock_xdg_module_a_SOURCES = \ + mock-xdg-module.c mock-xdg-module.h diff --git a/pkcs11/xdg-store/tests/check-xdg-module.c b/pkcs11/xdg-store/check-xdg-module.c index 02050be5..02050be5 100644 --- a/pkcs11/xdg-store/tests/check-xdg-module.c +++ b/pkcs11/xdg-store/check-xdg-module.c diff --git a/pkcs11/xdg-store/tests/dump-trust-file.c b/pkcs11/xdg-store/dump-trust-file.c index 1ac880ba..1ac880ba 100644 --- a/pkcs11/xdg-store/tests/dump-trust-file.c +++ b/pkcs11/xdg-store/dump-trust-file.c diff --git a/pkcs11/xdg-store/tests/files/test-certificate-1.cer b/pkcs11/xdg-store/fixtures/test-certificate-1.cer Binary files differindex 1c084370..1c084370 100644 --- a/pkcs11/xdg-store/tests/files/test-certificate-1.cer +++ b/pkcs11/xdg-store/fixtures/test-certificate-1.cer diff --git a/pkcs11/xdg-store/tests/files/test-certificate-2.cer b/pkcs11/xdg-store/fixtures/test-certificate-2.cer Binary files differindex 1c084370..1c084370 100644 --- a/pkcs11/xdg-store/tests/files/test-certificate-2.cer +++ b/pkcs11/xdg-store/fixtures/test-certificate-2.cer diff --git a/pkcs11/xdg-store/tests/files/test-refer-1.trust b/pkcs11/xdg-store/fixtures/test-refer-1.trust Binary files differindex 8db12b91..8db12b91 100644 --- a/pkcs11/xdg-store/tests/files/test-refer-1.trust +++ b/pkcs11/xdg-store/fixtures/test-refer-1.trust diff --git a/pkcs11/xdg-store/tests/frob-trust-file.c b/pkcs11/xdg-store/frob-trust-file.c index 310e6741..310e6741 100644 --- a/pkcs11/xdg-store/tests/frob-trust-file.c +++ b/pkcs11/xdg-store/frob-trust-file.c diff --git a/pkcs11/xdg-store/tests/mock-xdg-module.c b/pkcs11/xdg-store/mock-xdg-module.c index 4d17d97b..cdc886bb 100644 --- a/pkcs11/xdg-store/tests/mock-xdg-module.c +++ b/pkcs11/xdg-store/mock-xdg-module.c @@ -109,8 +109,8 @@ mock_xdg_module_initialize_and_enter (void) CK_RV rv; directory = egg_tests_create_scratch_directory ( - SRCDIR "/files/test-refer-1.trust", - SRCDIR "/files/test-certificate-1.cer", + SRCDIR "/fixtures/test-refer-1.trust", + SRCDIR "/fixtures/test-certificate-1.cer", NULL); /* Setup test directory to work in */ @@ -119,7 +119,7 @@ mock_xdg_module_initialize_and_enter (void) args.pReserved = string; args.flags = CKF_OS_LOCKING_OK; - /* Copy files from test-data to scratch */ + /* Copy fixtures from test-data to scratch */ mock_xdg_module_empty_file ("invalid-without-ext"); mock_xdg_module_empty_file ("test-file.unknown"); mock_xdg_module_empty_file ("test-invalid.trust"); diff --git a/pkcs11/xdg-store/tests/mock-xdg-module.h b/pkcs11/xdg-store/mock-xdg-module.h index 9dc13714..9dc13714 100644 --- a/pkcs11/xdg-store/tests/mock-xdg-module.h +++ b/pkcs11/xdg-store/mock-xdg-module.h diff --git a/pkcs11/xdg-store/tests/p11-tests.conf b/pkcs11/xdg-store/p11-tests.conf index fda5f0dd..fda5f0dd 100644 --- a/pkcs11/xdg-store/tests/p11-tests.conf +++ b/pkcs11/xdg-store/p11-tests.conf diff --git a/pkcs11/xdg-store/tests/test-xdg-module.c b/pkcs11/xdg-store/test-xdg-module.c index 482d50c2..fb0d72dc 100644 --- a/pkcs11/xdg-store/tests/test-xdg-module.c +++ b/pkcs11/xdg-store/test-xdg-module.c @@ -181,7 +181,7 @@ test_create_and_add_object (Test *test, gconstpointer unused) { CKA_CERTIFICATE_TYPE, &ctype, sizeof (ctype) } }; - if (!g_file_get_contents (SRCDIR "/files/test-certificate-2.cer", &data, &n_data, NULL)) + if (!g_file_get_contents (SRCDIR "/fixtures/test-certificate-2.cer", &data, &n_data, NULL)) g_assert_not_reached (); attrs[0].pValue = data; diff --git a/pkcs11/xdg-store/tests/test-xdg-trust.c b/pkcs11/xdg-store/test-xdg-trust.c index f6ee580c..cdddd99b 100644 --- a/pkcs11/xdg-store/tests/test-xdg-trust.c +++ b/pkcs11/xdg-store/test-xdg-trust.c @@ -128,7 +128,7 @@ setup (Test *test, gconstpointer unused) rv = gkm_module_C_Login (test->module, gkm_session_get_handle (test->session), CKU_USER, NULL, 0); g_assert (rv == CKR_OK); - if (!g_file_get_contents (SRCDIR "/files/test-certificate-2.cer", &test->cert_data, &test->n_cert_data, NULL)) + if (!g_file_get_contents (SRCDIR "/fixtures/test-certificate-2.cer", &test->cert_data, &test->n_cert_data, NULL)) g_assert_not_reached (); } diff --git a/pkcs11/xdg-store/tests/Makefile.am b/pkcs11/xdg-store/tests/Makefile.am deleted file mode 100644 index 9f4db482..00000000 --- a/pkcs11/xdg-store/tests/Makefile.am +++ /dev/null @@ -1,54 +0,0 @@ - -INCLUDES = \ - -I$(top_builddir) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/pkcs11 \ - -DSRCDIR="\"@abs_srcdir@\"" \ - $(GLIB_CFLAGS) \ - $(LIBGCRYPT_CFLAGS) - -LDADD = \ - libgkm-mock-xdg-module.a \ - $(top_builddir)/pkcs11/xdg-store/libgkm-xdg-store.la \ - $(top_builddir)/pkcs11/gkm/libgkm.la \ - $(top_builddir)/egg/libegg.la \ - $(GLIB_LIBS) \ - $(GTHREAD_LIBS) \ - $(LIBGCRYPT_LIBS) - -if WITH_P11_TESTS -CHECK_PROGS = check-xdg-module -else -CHECK_PROGS = -endif - -TEST_PROGS = \ - test-xdg-module \ - test-xdg-trust - -check_PROGRAMS = $(TEST_PROGS) - -test: $(TEST_PROGS) $(CHECK_PROGS) - gtester --verbose -m $(TEST_MODE) --g-fatal-warnings $(TEST_PROGS) - @for prog in $(CHECK_PROGS); do SRCDIR='.' ./$$prog || exit 1; done - -check-local: test - -all-local: $(check_PROGRAMS) - -EXTRA_DIST = \ - p11-tests.conf \ - files - -noinst_PROGRAMS = \ - frob-trust-file \ - dump-trust-file \ - $(CHECK_PROGS) - -check_xdg_module_CFLAGS = $(P11_TESTS_CFLAGS) -check_xdg_module_LDADD = $(P11_TESTS_LIBS) $(LDADD) - -noinst_LIBRARIES = libgkm-mock-xdg-module.a - -libgkm_mock_xdg_module_a_SOURCES = \ - mock-xdg-module.c mock-xdg-module.h |