diff options
author | Stef Walter <stefw@gnome.org> | 2014-03-05 12:58:46 +0100 |
---|---|---|
committer | Stef Walter <stefw@gnome.org> | 2014-03-05 13:02:16 +0100 |
commit | 533044c5ef208543b00e5f56635dcaae1b93d31b (patch) | |
tree | 7679e20322fdbcf0d0f53f722386415b9168ea0b | |
parent | 4f0b8a25630d6555cf0d91b849273e0e24a174ad (diff) |
Makefile.am: Use parallel tests for 'make check'
Also build in a 'make check-memory' and related functionality
which drives valgrind.
-rw-r--r-- | .gitignore | 11 | ||||
-rw-r--r-- | Makefile.am | 75 | ||||
-rw-r--r-- | build/gcr.supp | 14 | ||||
-rw-r--r-- | build/gcrypt.supp | 39 | ||||
-rw-r--r-- | build/glib.supp | 419 | ||||
-rw-r--r-- | build/glibc.supp | 13 | ||||
-rw-r--r-- | build/p11-kit.supp | 6 | ||||
-rw-r--r-- | build/pixman.supp | 6 | ||||
-rw-r--r-- | build/pthread.supp | 7 | ||||
-rwxr-xr-x | build/tap-driver | 357 | ||||
-rwxr-xr-x | build/tap-gtester | 176 | ||||
-rw-r--r-- | build/unknown.supp | 420 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | daemon/dbus/Makefile.am | 5 | ||||
-rw-r--r-- | egg/Makefile.am | 5 | ||||
-rw-r--r-- | egg/egg-asn1x.c | 8 | ||||
-rw-r--r-- | pkcs11/gkm/Makefile.am | 5 | ||||
-rw-r--r-- | pkcs11/gnome2-store/Makefile.am | 5 | ||||
-rw-r--r-- | pkcs11/secret-store/Makefile.am | 5 | ||||
-rw-r--r-- | pkcs11/ssh-store/Makefile.am | 8 | ||||
-rw-r--r-- | pkcs11/wrap-layer/Makefile.am | 5 | ||||
-rw-r--r-- | pkcs11/xdg-store/Makefile.am | 8 |
22 files changed, 1546 insertions, 53 deletions
@@ -57,7 +57,7 @@ config.status config.status.lineno config.sub /configure -/install-sh +install-sh /intltool-extract /intltool-extract.in /intltool-merge @@ -81,8 +81,15 @@ depcomp /junk /TODO.tasks -/build/ +/test-* +/frob-* +/dump-* +/*-standalone +/gnome-keyring-3 +/valgrind-suppressions + /build/coverage +/build/test-driver /docs/*/html/ /docs/gnome-keyring-daemon/prompter.xml diff --git a/Makefile.am b/Makefile.am index c7089f95..18c9faed 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,14 +4,7 @@ SUBDIRS = \ . \ po -ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} - -EXTRA_DIST = \ - intltool-extract.in \ - intltool-merge.in \ - intltool-update.in \ - ChangeLog.old \ - HACKING +ACLOCAL_AMFLAGS = -I build/m4 ${ACLOCAL_FLAGS} DISTCHECK_CONFIGURE_FLAGS = \ --enable-doc \ @@ -70,27 +63,32 @@ asn1-reparse: sed -i 's|#include.*|/* \0 */|' $$a.h \ done -test: $(TEST_PROGS) - gtester --verbose -m $(TEST_MODE) --g-fatal-warnings $(TEST_PROGS) - -check-local: test - -all-local: $(check_PROGRAMS) - -TEST_ARGS = - -TEST_SUPPRESSIONS = $(top_builddir)/build/valgrind-suppressions - -perform-memcheck: $(TEST_PROGS) - make -C $(top_builddir)/build all - @for test in $(TEST_PROGS); do \ - G_SLICE=always-malloc libtool --mode=execute \ - valgrind --trace-children=no --gen-suppressions=all \ - --suppressions=$(TEST_SUPPRESSIONS) \ - --leak-check=full --show-reachable=yes --num-callers=16 \ - --quiet --error-exitcode=3 \ - $(builddir)/$$test $(TEST_ARGS) || exit 3; \ - done +# Default executable tests +LOG_DRIVER = $(srcdir)/build/tap-driver +LOG_DRIVER_FLAGS = --format=tap +LOG_COMPILER = $(srcdir)/build/tap-gtester + +VALGRIND_ARGS = --trace-children=no --quiet --error-exitcode=33 \ + --suppressions=valgrind-suppressions --gen-suppressions=all \ + --num-callers=16 +VALGRIND_SUPPRESSIONS = \ + build/gcr.supp \ + build/gcrypt.supp \ + build/glib.supp \ + build/glibc.supp \ + build/p11-kit.supp \ + build/pthread.supp \ + build/unknown.supp + +valgrind-suppressions: $(VALGRIND_SUPPRESSIONS) + $(AM_V_GEN) cat $^ > $@ + +check-memory: valgrind-suppressions + $(MAKE) LOG_FLAGS="-- libtool --mode=execute valgrind $(VALGRIND_ARGS)" \ + $(AM_MAKEFLAGS) check +recheck-memory: valgrind-suppressions + $(MAKE) LOG_FLAGS="-- libtool --mode=execute valgrind $(VALGRIND_ARGS)" \ + $(AM_MAKEFLAGS) recheck coverage: mkdir -p $(top_builddir)/build/coverage @@ -162,22 +160,31 @@ AM_CPPFLAGS = \ $(GLIB_CFLAGS) bin_PROGRAMS = -check_PROGRAMS = $(TEST_PROGS) +check_PROGRAMS = noinst_DATA = noinst_LIBRARIES = noinst_LTLIBRARIES = -noinst_PROGRAMS = +noinst_PROGRAMS = $(check_PROGRAMS) +TESTS = ASN1_FILES = BUILT_SOURCES = prep-builddir CLEANFILES = $(BUILT_SOURCES) -TEST_PROGS = moduledir = $(pkcs11standalonedir) module_LTLIBRARIES = -EXTRA_DIST += \ - $(ASN1_FILES) +EXTRA_DIST = \ + intltool-extract.in \ + intltool-merge.in \ + intltool-update.in \ + ChangeLog.old \ + HACKING \ + $(ASN1_FILES) \ + build/tap-driver \ + build/tap-gtester \ + $(VALGRIND_SUPPRESSIONS) \ + $(NULL) include egg/Makefile.am include daemon/Makefile.am diff --git a/build/gcr.supp b/build/gcr.supp new file mode 100644 index 00000000..69b6701c --- /dev/null +++ b/build/gcr.supp @@ -0,0 +1,14 @@ +{ + gcr_pkcs11_set_trust_store_uri + Memcheck:Leak + ... + fun:g_strdup + fun:gcr_pkcs11_set_trust_store_uri +} +{ + gcr_pkcs11_set_trust_lookup_uris + Memcheck:Leak + ... + fun:g_strdupv + fun:gcr_pkcs11_set_trust_lookup_uris +} diff --git a/build/gcrypt.supp b/build/gcrypt.supp new file mode 100644 index 00000000..05ff3959 --- /dev/null +++ b/build/gcrypt.supp @@ -0,0 +1,39 @@ +{ + gpg_err_init + Memcheck:Leak + ... + fun:gpg_err_init +} +{ + _gcry_module_add + Memcheck:Leak + ... + fun:_gcry_module_add +} +{ + _gcry_rngcsprng_create_nonce + Memcheck:Leak + ... + fun:_gcry_malloc + ... + fun:initialize + fun:_gcry_rngcsprng_create_nonce +} +{ + _gcry_rngcsprng_create_nonce + Memcheck:Leak + ... + fun:_gcry_malloc + ... + fun:initialize + fun:_gcry_rngcsprng_randomize +} +{ + gcry_control__init + Memcheck:Leak + ... + fun:glib_thread_mutex_init + ... + fun:_gcry_vcontrol + fun:gcry_control +} diff --git a/build/glib.supp b/build/glib.supp new file mode 100644 index 00000000..194b1e8a --- /dev/null +++ b/build/glib.supp @@ -0,0 +1,419 @@ +{ + g_type_register_static_1 + Memcheck:Leak + ... + fun:g_type_register_static +} +{ + g_type_register_fundamental + Memcheck:Leak + ... + fun:g_type_register_fundamental +} +{ + g_type_init_with_debug_flags + Memcheck:Leak + ... + fun:g_type_init_with_debug_flags +} +{ + g_type_class_ref + Memcheck:Leak + ... + fun:g_type_class_ref +} +{ + g_type_add_interface_static + Memcheck:Leak + ... + fun:g_type_add_interface_static +} +{ + g_param_spec_internal + Memcheck:Leak + ... + fun:g_type_class_ref + fun:g_type_create_instance + fun:g_param_spec_internal +} +{ + g_param_spec_enum + Memcheck:Leak + ... + fun:g_type_class_ref + fun:g_param_spec_enum +} +{ + g_param_spec_flags + Memcheck:Leak + ... + fun:g_type_class_ref + fun:g_param_spec_flags +} +{ + g_quark_from_static_string + Memcheck:Leak + ... + fun:g_quark_from_static_string +} +{ + g_quark_from_string + Memcheck:Leak + ... + fun:g_quark_from_string +} +{ + g_value_register_transform_func + Memcheck:Leak + ... + fun:g_value_register_transform_func +} +{ + test_run_seed + Memcheck:Leak + ... + fun:g_rand_new_with_seed_array + fun:test_run_seed + ... + fun:g_test_run_suite +} +{ + g_test_init + Memcheck:Leak + ... + fun:g_test_init +} +{ + g_intern_static_string + Memcheck:Leak + ... + fun:g_intern_static_string +} +{ + g_main_context_push_thread_default + Memcheck:Leak + ... + fun:g_queue_new + fun:g_main_context_push_thread_default +} +{ + g_dbus_error_register_error + Memcheck:Leak + ... + fun:g_dbus_error_register_error +} +{ + g_param_spec_pool_insert + Memcheck:Leak + ... + fun:g_param_spec_pool_insert +} +{ + g_main_context_default + Memcheck:Leak + ... + fun:g_main_context_default +} +{ + g_main_context_check + Memcheck:Leak + ... + fun:g_ptr_array_add + fun:g_main_context_check +} +{ + g_test_run_suite + Memcheck:Leak + ... + fun:g_slist_copy + fun:g_test_run_suite_internal + fun:g_test_run_suite +} +{ + g_dbus_interface_info_cache_build + Memcheck:Leak + ... + fun:g_dbus_interface_info_cache_build +} +{ + g_cancellable_push_current + Memcheck:Leak + ... + fun:thread_memory_from_self + ... + fun:g_cancellable_push_current +} +{ + g_io_scheduler_push_job + Memcheck:Leak + ... + fun:init_scheduler + fun:g_once_impl + fun:g_io_scheduler_push_job +} +{ + g_io_scheduler_push_job_2 + Memcheck:Leak + ... + fun:g_system_thread_new + ... + fun:g_io_scheduler_push_job +} +{ + g_bus_get_sync__available_connections + Memcheck:Leak + ... + fun:g_hash_table_new + fun:initable_init + fun:g_initable_init + fun:g_bus_get_sync +} +{ + g_socket_connection_factory_register_type + Memcheck:Leak + ... + fun:g_socket_connection_factory_register_type +} +{ + g_test_add_vtable + Memcheck:Leak + ... + fun:g_test_add_vtable +} +{ + g_mutex_lock + Memcheck:Leak + ... + fun:g_mutex_impl_new + fun:g_mutex_get_impl + fun:g_mutex_lock +} +{ + g_thread_self + Memcheck:Leak + ... + fun:g_thread_self +} +{ + g_rec_mutex_lock + Memcheck:Leak + ... + fun:g_rec_mutex_impl_new + fun:g_rec_mutex_get_impl + fun:g_rec_mutex_lock +} +{ + test_case_run + Memcheck:Leak + ... + fun:g_malloc0 + fun:test_case_run + ... + fun:g_test_run_suite +} +{ + g_get_charset + Memcheck:Leak + ... + fun:g_get_charset +} +{ + g_test_run_suite__timer_new + Memcheck:Leak + ... + fun:g_timer_new + fun:test_case_run + ... + fun:g_test_run_suite +} +{ + g_test_run_suite__timer_new2 + Memcheck:Leak + ... + fun:g_timer_new + fun:test_case_run* + ... + fun:g_test_run_suite +} +{ + g_test_run_suite__strconcat + Memcheck:Leak + ... + fun:g_strconcat + fun:test_case_run + ... + fun:g_test_run_suite + fun:g_test_run +} +{ + g_type_interface_add_prerequisite + Memcheck:Leak + ... + fun:g_type_interface_add_prerequisite +} +{ + g_test_run_suite_2 + Memcheck:Leak + ... + fun:g_slist_copy + fun:g_test_run_suite_internal + ... + fun:g_test_run_suite +} +{ + g_test_run_suite_3 + Memcheck:Leak + ... + fun:g_malloc0 + fun:g_test_run_suite_internal + ... + fun:g_test_run_suite +} +{ + g_set_prgname + Memcheck:Leak + ... + fun:g_set_prgname +} +{ + g_test_run_suite__strconcat_2 + Memcheck:Leak + ... + fun:g_strconcat + fun:g_test_run_suite_internal +} +{ + g_test_run_suite__strdup + Memcheck:Leak + ... + fun:g_strdup + fun:g_test_run_suite_internal +} +{ + g_private_get + Memcheck:Leak + ... + fun:g_private_get +} +{ + g_private_set + Memcheck:Leak + ... + fun:g_private_set +} +{ + g_static_private_set_1 + Memcheck:Leak + ... + fun:g_array_set_size + fun:g_static_private_set +} +{ + g_static_private_set_2 + Memcheck:Leak + ... + fun:g_array_sized_new + fun:g_static_private_set +} +{ + g_static_mutex_get_mutex_impl + Memcheck:Leak + ... + fun:g_static_mutex_get_mutex_impl +} +{ + g_variant_type_info_unref + Memcheck:Leak + ... + fun:g_hash_table_remove + fun:g_variant_type_info_unref +} +{ + g_get_filename_charsets + Memcheck:Leak + ... + fun:g_get_filename_charsets +} +{ + g_intern_string + Memcheck:Leak + ... + fun:g_intern_string +} +{ + g_main_context_iterate + Memcheck:Leak + ... + fun:g_malloc + fun:g_main_context_iterate +} +{ + g_main_context_dispatch + Memcheck:Leak + ... + fun:get_dispatch + fun:g_main_context_dispatch +} +{ + g_log_set_handler + Memcheck:Leak + ... + fun:g_log_set_handler +} +{ + g_simple_async_result_complete + Memcheck:Leak + ... + fun:g_main_context_push_thread_default + fun:g_simple_async_result_complete +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:g_static_private_set + fun:g_module_open +} +{ + g_child_watch_source_new + Memcheck:Leak + ... + fun:ensure_unix_signal_handler_installed_unlocked + fun:g_child_watch_source_new +} +{ + g_thread_pool_thread_proxy + Memcheck:Leak + ... + fun:g_malloc + fun:g_cond_new_posix_impl + ... + fun:g_async_queue_timed_pop + fun:g_thread_pool_thread_proxy +} +{ + g_module_open + Memcheck:Leak + ... + fun:g_private_impl_new + ... + fun:g_module_open +} +{ + g_system_thread_new + Memcheck:Leak + ... + fun:g_system_thread_new +} +{ + thread_memory_from_self + Memcheck:Leak + ... + fun:thread_memory_from_self +} +{ + g_get_language_names + Memcheck:Leak + ... + fun:g_get_language_names +} diff --git a/build/glibc.supp b/build/glibc.supp new file mode 100644 index 00000000..34e68bff --- /dev/null +++ b/build/glibc.supp @@ -0,0 +1,13 @@ +{ + dlclose + Memcheck:Leak + ... + fun:dlclose +} +{ + dlopen + Memcheck:Leak + ... + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} diff --git a/build/p11-kit.supp b/build/p11-kit.supp new file mode 100644 index 00000000..ad8b9289 --- /dev/null +++ b/build/p11-kit.supp @@ -0,0 +1,6 @@ +{ + _p11_library_get_thread_local + Memcheck:Leak + ... + fun:_p11_library_get_thread_local +} diff --git a/build/pixman.supp b/build/pixman.supp new file mode 100644 index 00000000..a384e0e1 --- /dev/null +++ b/build/pixman.supp @@ -0,0 +1,6 @@ +{ + pixman + Memcheck:Leak + fun:malloc + obj:/usr/lib64/libpixman-1.so.0.22.2 +} diff --git a/build/pthread.supp b/build/pthread.supp new file mode 100644 index 00000000..a04bfc19 --- /dev/null +++ b/build/pthread.supp @@ -0,0 +1,7 @@ +{ + _dl_allocate_tls + Memcheck:Leak + ... + fun:_dl_allocate_tls + fun:pthread_create* +} diff --git a/build/tap-driver b/build/tap-driver new file mode 100755 index 00000000..3906b40e --- /dev/null +++ b/build/tap-driver @@ -0,0 +1,357 @@ +#!/usr/bin/python + +# Copyright (C) 2013 Red Hat, Inc. +# +# Cockpit is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# Cockpit is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with Cockpit; If not, see <http://www.gnu.org/licenses/>. + +# +# This is a TAP driver for automake +# +# In particular it leaves stderr untouched, and is cleaner than the +# one implemented in shell that is making the rounds. +# +# This implements the automake "Custom Test Driver" protocol: +# https://www.gnu.org/software/automake/manual/html_node/Custom-Test-Drivers.html +# +# This consumes the Test Anything Protocol (ie: TAP) +# https://metacpan.org/pod/release/PETDANCE/Test-Harness-2.64/lib/Test/Harness/TAP.pod +# + +import argparse +import os +import select +import subprocess +import sys + +class Driver: + def __init__(self, args): + self.argv = args.command + self.test_name = args.test_name + self.log = open(args.log_file, "w") + self.log.write("# %s\n" % " ".join(sys.argv)) + self.trs = open(args.trs_file, "w") + self.color_tests = args.color_tests + self.expect_failure = args.expect_failure + + def report(self, code, *args): + CODES = { + "XPASS": '\x1b[0;31m', # red + "FAIL": '\x1b[0;31m', # red + "PASS": '\x1b[0;32m', # grn + "XFAIL": '\x1b[1;32m', # lgn + "SKIP": '\x1b[1;34m', # blu + "ERROR": '\x1b[0;35m', # mgn + } + + # Print out to console + if self.color_tests: + if code in CODES: + sys.stdout.write(CODES[code]) + sys.stdout.write(code) + if self.color_tests: + sys.stdout.write('\x1b[m') + sys.stdout.write(": ") + sys.stdout.write(self.test_name) + sys.stdout.write(" ") + for arg in args: + sys.stdout.write(str(arg)) + sys.stdout.write("\n") + sys.stdout.flush() + + # Book keeping + if code in CODES: + self.trs.write(":test-result: %s\n" % code) + + def result_pass(self, *args): + if self.expect_failure: + self.report("XPASS", *args) + else: + self.report("PASS", *args) + + def result_fail(self, *args): + if self.expect_failure: + self.report("XFAIL", *args) + else: + self.report("FAIL", *args) + + def result_skip(self, *args): + if self.expect_failure: + self.report("XFAIL", *args) + else: + self.report("SKIP", *args) + + def report_error(self, description=""): + self.report("ERROR", "", description) + + def process(self, output): + pass + + def execute(self): + try: + proc = subprocess.Popen(self.argv, close_fds=True, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + except OSError, ex: + self.report_error("Couldn't run %s: %s" % (self.argv[0], str(ex))) + return + + outf = proc.stdout.fileno() + errf = proc.stderr.fileno() + rset = [outf, errf] + while len(rset) > 0: + ret = select.select(rset, [], [], 10) + if outf in ret[0]: + data = os.read(outf, 1024) + if data == "": + rset.remove(outf) + self.log.write(data) + self.process(data) + if errf in ret[0]: + data = os.read(errf, 1024) + if data == "": + rset.remove(errf) + self.log.write(data) + sys.stderr.write(data) + + proc.wait() + return proc.returncode + + +class TapDriver(Driver): + def __init__(self, args): + Driver.__init__(self, args) + self.output = "" + self.reported = { } + self.test_plan = None + self.late_plan = False + self.errored = False + self.bail_out = False + + def report(self, code, num, *args): + if num: + Driver.report(self, code, num, " ", *args) + self.reported[num] = code + else: + Driver.report(self, code, *args) + if code == "ERROR": + self.errored = True + + def consume_test_line(self, ok, data): + # It's an error if the caller sends a test plan in the middle of tests + if self.late_plan: + self.report_error("Got tests after late TAP test plan") + self.late_plan = False + + # Parse out a number and then description + (num, unused, description) = data.partition(" ") + try: + num = int(num) + except ValueError: + self.report_error("Invalid test number: %s" % data) + return + description = description.lstrip() + + # Special case if description starts with this, then skip + if description.lower().startswith("# skip"): + self.result_skip(num, description) + elif ok: + self.result_pass(num, description) + else: + self.result_fail(num, description) + + def consume_test_plan(self, first, last): + # Only one test plan is supported + if self.test_plan: + self.report_error("Get a second TAP test plan") + return + + try: + first = int(first) + last = int(last) + except ValueError: + self.report_error("Invalid test plan: %s..%s" % (first, last)) + return + + self.test_plan = (first, last) + self.late_plan = self.reported and True or False + + def consume_bail_out(self, line): + self.bail_out = True + self.report("SKIP", 0, line) + + def process(self, output): + if output: + self.output += output + elif self.output: + self.output += "\n" + (ready, unused, self.output) = self.output.rpartition("\n") + for line in ready.split("\n"): + if line.startswith("ok "): + self.consume_test_line(True, line[3:]) + elif line.startswith("not ok "): + self.consume_test_line(False, line[7:]) + elif line and line[0].isdigit() and ".." in line: + (first, unused, last) = line.partition("..") + self.consume_test_plan(first, last) + elif line.lower().startswith("bail out!"): + self.consume_bail_out(line) + + def run(self): + returncode = self.execute() + + failed = False + skipped = True + + # Basic collation of results + for (num, code) in self.reported.items(): + if code == "ERROR": + self.errored = True + elif code == "FAIL" or code == "XPASS": + failed = True + if code != "SKIP": + skipped = False + + if not self.errored and returncode: + self.report_error("process failed: %d" % returncode) + self.errored = True + + # Check the plan + if not self.errored: + if not self.test_plan: + if not self.bail_out: + self.report_error("Didn't receive a TAP test plan") + else: + for i in range(self.test_plan[0], self.test_plan[1] + 1): + if i not in self.reported: + if self.bail_out: + self.report("SKIP", i, "- bailed out") + else: + self.report("ERROR", i, "- missing test") + skipped = False + self.errored = True + + if self.errored: + self.trs.write(":global-test-result: ERROR\n") + self.trs.write(":test-global-result: ERROR\n") + self.trs.write(":recheck: yes\n") + elif failed: + self.trs.write(":global-test-result: FAIL\n") + self.trs.write(":test-global-result: FAIL\n") + self.trs.write(":recheck: yes\n") + elif skipped: + self.trs.write(":global-test-result: SKIP\n") + self.trs.write(":test-global-result: SKIP\n") + self.trs.write(":recheck: no\n") + else: + self.trs.write(":global-test-result: PASS\n") + self.trs.write(":test-global-result: PASS\n") + self.trs.write(":recheck: no\n") + if self.errored or failed: + self.trs.write(":copy-in-global-log: yes\n") + + # Process result code + return 0 + + +class SimpleDriver(Driver): + def __init__(self, args): + Driver.__init__(self, args) + + def run(self): + returncode = self.execute() + if returncode == 0: + self.result_pass() + self.trs.write(":global-test-result: PASS\n") + self.trs.write(":test-global-result: PASS\n") + self.trs.write(":recheck: no\n") + elif returncode == 77: + self.result_skip() + self.trs.write(":global-test-result: SKIP\n") + self.trs.write(":test-global-result: SKIP\n") + self.trs.write(":recheck: no\n") + elif returncode == 99: + self.report_error() + self.trs.write(":global-test-result: ERROR\n") + self.trs.write(":test-global-result: ERROR\n") + self.trs.write(":copy-in-global-log: yes\n") + self.trs.write(":recheck: yes\n") + else: + self.result_fail() + self.trs.write(":global-test-result: FAIL\n") + self.trs.write(":test-global-result: FAIL\n") + self.trs.write(":copy-in-global-log: yes\n") + self.trs.write(":recheck: yes\n") + + # Process result code + return 0 + + +class MissingDriver(Driver): + def __init__(self, args): + Driver.__init__(self, args) + self.missing = args.missing + + def run(self): + self.result_skip("skipping due to: ", self.missing) + self.trs.write(":global-test-result: SKIP\n") + self.trs.write(":test-global-result: SKIP\n") + self.trs.write(":recheck: no\n") + return 0 + + +class YesNoAction(argparse.Action): + def __init__(self, option_strings, dest, **kwargs): + argparse.Action.__init__(self, option_strings, dest, **kwargs) + self.metavar = "[yes|no]" + def __call__(self, parser, namespace, values, option_string=None): + if not values or "yes" in values: + setattr(namespace, self.dest, True) + else: + setattr(namespace, self.dest, False) + + +def main(argv): + parser = argparse.ArgumentParser(description='Automake TAP driver') + parser.add_argument('--format', metavar='FORMAT', choices=[ "simple", "tap" ], + default="simple", help='The type of test to drive') + parser.add_argument('--missing', metavar="TOOL", nargs='?', + help="Force the test to skip due to missing tool") + parser.add_argument('--test-name', metavar='NAME', + help='The name of the test') + parser.add_argument('--log-file', metavar='PATH.log', required=True, + help='The .log file the driver creates') + parser.add_argument('--trs-file', metavar='PATH.trs', required=True, + help='The .trs file the driver creates') + parser.add_argument('--color-tests', default=True, action=YesNoAction, + help='Whether the console output should be colorized or not') + parser.add_argument('--expect-failure', default=False, action=YesNoAction, + help="Whether the tested program is expected to fail") + parser.add_argument('--enable-hard-errors', default=False, action=YesNoAction, + help="Whether hard errors in the tested program are treated differently") + parser.add_argument('command', nargs='+', + help="A test command line to run") + args = parser.parse_args(argv[1:]) + + if not args.test_name: + args.test_name = os.path.basename(args.command[0]) + if args.missing: + driver = MissingDriver(args) + elif args.format == "simple": + driver = SimpleDriver(args) + elif args.format == "tap": + driver = TapDriver(args) + return driver.run() + +if __name__ == "__main__": + sys.exit(main(sys.argv)) diff --git a/build/tap-gtester b/build/tap-gtester new file mode 100755 index 00000000..ff7506a4 --- /dev/null +++ b/build/tap-gtester @@ -0,0 +1,176 @@ +#!/usr/bin/python + +# Copyright (C) 2014 Red Hat, Inc. +# +# Cockpit is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# Cockpit is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with Cockpit; If not, see <http://www.gnu.org/licenses/>. + +# +# This is a test output compiler which produces TAP from GTest output +# if GTest output is detected. +# +# Versions of glib later than 2.38.x output TAP natively when tests are +# run with the --tap option. However we can't depend on such a recent +# version of glib for our purposes. +# +# This implements the Test Anything Protocol (ie: TAP) +# https://metacpan.org/pod/release/PETDANCE/Test-Harness-2.64/lib/Test/Harness/TAP.pod +# + +import argparse +import os +import select +import subprocess +import sys + +class NullCompiler: + def __init__(self, command): + self.command = command + + def input(self, line): + sys.stdout.write(line) + + def process(self, proc): + while True: + line = proc.stdout.readline() + if not line: + break + self.input(line) + proc.wait() + return proc.returncode + + def run(self, proc, line=None): + if line: + self.input(line) + return self.process(proc) + + +class GTestCompiler(NullCompiler): + def __init__(self, filename): + NullCompiler.__init__(self, filename) + self.test_num = 0 + self.test_name = None + self.test_remaining = [] + + def input(self, line): + line = line.strip() + if line.startswith("GTest: "): + (cmd, unused, data) = line[7:].partition(": ") + cmd = cmd.strip() + data = data.strip() + if cmd == "run": + self.test_name = data + assert self.test_name in self.test_remaining, "%s %s" % (self.test_name, repr(self.test_remaining)) + self.test_remaining.remove(self.test_name) + self.test_num += 1 + elif cmd == "result": + if data == "OK": + print "ok %d %s" % (self.test_num, self.test_name) + if data == "FAIL": + print "not ok %d %s", (self.test_num, self.test_name) + self.test_name = None + elif cmd == "skipping": + if "/subprocess" not in data: + print "ok %d # skip -- %s" % (self.test_num, data) + self.test_name = None + elif data: + print "# %s: %s" % (cmd, data) + else: + print "# %s" % cmd + elif line.startswith("(MSG: "): + print "# %s" % line[6:-1] + elif line: + print "# %s" % line + sys.stdout.flush() + + def run(self, proc, output=""): + # Complete retrieval of the list of tests + output += proc.stdout.read() + proc.wait() + if proc.returncode: + sys.stderr.write("tap-gtester: listing GTest tests failed: %d\n" % proc.returncode) + return proc.returncode + self.test_remaining = [] + for line in output.split("\n"): + if line.startswith("/"): + self.test_remaining.append(line.strip()) + if not self.test_remaining: + print "Bail out! No tests found in GTest: %s" % self.command[0] + return 0 + + print "1..%d" % len(self.test_remaining) + + # First try to run all the tests in a batch + proc = subprocess.Popen(self.command + ["--verbose" ], close_fds=True, stdout=subprocess.PIPE) + result = self.process(proc) + if result == 0: + return 0 + + # Now pick up any stragglers due to failures + while True: + # Assume that the last test failed + if self.test_name: + print "not ok %d %s" % (self.test_num, self.test_name) + self.test_name = None + + # Run any tests which didn't get run + if not self.test_remaining: + break + + proc = subprocess.Popen(self.command + ["--verbose", "-p", self.test_remaining[0]], + close_fds=True, stdout=subprocess.PIPE) + result = self.process(proc) + + # The various exit codes and signals we continue for + if result not in [ 0, 1, -4, -5, -6, -7, -8, -11, 33 ]: + break + + return result + +def main(argv): + parser = argparse.ArgumentParser(description='Automake TAP compiler') + parser.add_argument('--format', metavar='FORMAT', choices=[ "auto", "gtest", "tap" ], + default="auto", help='The input format to compile') + parser.add_argument('--verbose', action='store_true', + default=True, help='Verbose mode (ignored)') + parser.add_argument('command', nargs='+', help="A test command to run") + args = parser.parse_args(argv[1:]) + + output = None + format = args.format + cmd = args.command + proc = None + + if format in ["auto", "gtest"]: + list_cmd = cmd + ["-l", "--verbose"] + proc = subprocess.Popen(list_cmd, close_fds=True, stdout=subprocess.PIPE) + output = proc.stdout.readline() + # Smell whether we're dealing with GTest list output from first line + if "random seed" in output or "GTest" in output or output.startswith("/"): + format = "gtest" + else: + format = "tap" + else: + proc = subprocess.Popen(cmd, close_fds=True, stdout=subprocess.PIPE) + + if format == "gtest": + compiler = GTestCompiler(cmd) + elif format == "tap": + compiler = NullCompiler(cmd) + else: + assert False, "not reached" + + return compiler.run(proc, output) + +if __name__ == "__main__": + sys.exit(main(sys.argv)) diff --git a/build/unknown.supp b/build/unknown.supp new file mode 100644 index 00000000..bc7eea18 --- /dev/null +++ b/build/unknown.supp @@ -0,0 +1,420 @@ +{ + _g_dbus_shared_thread_ref + Memcheck:Leak + ... + fun:_g_dbus_shared_thread_ref +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + fun:malloc + fun:standard_malloc + fun:g_malloc + fun:g_slice_alloc + fun:g_slice_alloc0 + fun:g_type_create_instance + fun:g_object_constructor + fun:g_object_newv + fun:g_object_new + fun:g_dbus_message_new + fun:g_dbus_message_new_from_blob + fun:_g_dbus_worker_do_read_cb + fun:g_simple_async_result_complete + fun:complete_in_idle_cb + fun:g_idle_dispatch + fun:g_main_dispatch +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + fun:malloc + ... + obj:/lib64/libgcrypt.so.11.7.0 + fun:egg_dh_gen_pair +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:parse_value_from_blob + fun:g_dbus_message_new_from_blob + fun:_g_dbus_worker_do_read_cb +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:g_dbus_message_new + fun:g_dbus_message_new_from_blob + fun:_g_dbus_worker_do_read_cb + fun:g_simple_async_result_complete + fun:complete_in_idle_cb + fun:g_idle_dispatch +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:g_variant_get + fun:g_dbus_message_to_gerror + fun:decode_method_reply + fun:g_dbus_connection_call_done +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:g_dbus_message_set_header + fun:g_dbus_message_new_from_blob + fun:_g_dbus_worker_do_read_cb +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + fun:malloc + fun:standard_malloc + fun:g_malloc + fun:g_malloc_n + fun:g_main_context_iterate + fun:g_main_loop_run + fun:gdbus_shared_thread_func + fun:g_thread_proxy + fun:start_thread + fun:clone +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + fun:malloc + fun:standard_malloc + fun:g_malloc + fun:g_slice_alloc + fun:g_list_prepend + fun:g_queue_push_head + fun:g_main_context_push_thread_default + fun:gdbus_shared_thread_func + fun:g_thread_proxy + fun:start_thread + fun:clone +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + fun:malloc + fun:standard_malloc + fun:g_malloc + fun:g_slice_alloc + fun:g_slice_alloc0 + fun:get_dispatch + fun:g_main_dispatch + fun:g_main_context_dispatch + fun:g_main_context_iterate + fun:g_main_loop_run + fun:g_dbus_connection_send_message_with_reply_sync + fun:g_dbus_connection_call_sync_internal + fun:g_dbus_connection_call_sync + fun:initable_init + fun:g_initable_init + fun:g_bus_get_sync +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + fun:malloc + fun:standard_malloc + fun:g_malloc + fun:g_slice_alloc + fun:g_slice_alloc0 + fun:get_dispatch + fun:g_main_dispatch + fun:g_main_context_dispatch + fun:g_main_context_iterate + fun:g_main_loop_run + fun:gdbus_shared_thread_func + fun:g_thread_proxy + fun:start_thread + fun:clone +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + fun:malloc + fun:standard_malloc + fun:g_malloc + fun:g_malloc_n + fun:g_main_context_iterate +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + fun:malloc + fun:realloc + fun:standard_realloc + fun:g_realloc + fun:_g_dbus_worker_do_read_unlocked + fun:_g_dbus_worker_do_initial_read +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:_g_socket_output_stream_new + fun:g_socket_connection_get_output_stream + fun:g_io_stream_get_output_stream + fun:_g_dbus_auth_run_client +} +{ + _g_dbus_worker_do_initial_read + Memcheck:Leak + ... + fun:_g_dbus_worker_do_read_unlocked + fun:_g_dbus_worker_do_initial_read +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:g_unix_socket_address_new_with_type + fun:g_dbus_address_connect + fun:g_dbus_address_try_connect_one + fun:g_dbus_address_get_stream_sync +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:_g_socket_input_stream_new + fun:g_socket_connection_get_input_stream + fun:g_io_stream_get_input_stream + fun:_g_dbus_auth_run_client +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:_g_dbus_worker_close + fun:_g_dbus_worker_stop +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:g_simple_async_result_complete_in_idle + fun:_g_socket_read_with_control_messages_ready + fun:_g_socket_read_with_control_messages + fun:_g_dbus_worker_do_read_unlocked + fun:_g_dbus_worker_do_read_cb +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:g_source_new + fun:g_idle_source_new + fun:g_simple_async_result_complete_in_idle + fun:g_socket_connection_close_async + fun:g_io_stream_close_async + ... + fun:gdbus_shared_thread_func +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:g_simple_async_result_new + fun:g_socket_connection_close_async + fun:g_io_stream_close_async + fun:maybe_write_next_message + fun:write_message_in_idle_cb +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:g_socket_connection_factory_create_connection + ... + fun:initable_init +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:g_socket_client_connect + fun:g_dbus_address_connect + fun:g_dbus_address_try_connect_one +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:_g_dbus_worker_new +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:_g_socket_read_with_control_messages + fun:_g_dbus_worker_do_read_unlocked + fun:_g_dbus_worker_do_read_cb +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:g_socket_receive_message + fun:_g_socket_read_with_control_messages_ready + fun:_g_socket_read_with_control_messages + fun:_g_dbus_worker_do_read_unlocked + fun:_g_dbus_worker_do_read_cb +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:maybe_write_next_message + ... + fun:gdbus_shared_thread_func +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:remove_match_rule + fun:unsubscribe_id_internal +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:g_object_new + fun:get_uninitialized_connection + fun:g_bus_get_sync +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:g_dbus_connection_signal_subscribe + fun:async_initable_init_first +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:g_dbus_connection_send_message_with_reply_unlocked + fun:g_dbus_connection_send_message_with_reply + fun:g_dbus_connection_send_message_with_reply_sync + fun:g_dbus_connection_call_sync_internal + fun:g_dbus_connection_call_sync +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:_g_dbus_auth_new +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:_g_dbus_auth_run_client +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:_g_dbus_auth_init +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:g_variant_dup_string + ... + fun:g_variant_get + ... + fun:g_initable_init + fun:g_bus_get_sync +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:g_main_context_push_thread_default + ... + fun:gdbus_shared_thread_func +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:g_main_context_add_poll_unlocked + ... + fun:g_main_loop_run + fun:gdbus_shared_thread_func +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_memdup + fun:g_hash_table_insert_node + fun:handler_insert + fun:g_signal_connect_data +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:g_cond_new_posix_impl + fun:g_async_queue_pop_intern_unlocked + fun:g_thread_pool_thread_proxy + fun:g_thread_create_proxy + fun:start_thread + fun:clone +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:g_thread_create_full + fun:g_thread_pool_start_thread + fun:g_thread_pool_push +} +{ + thread_memory_from_self + Memcheck:Leak + ... + fun:thread_memory_from_self + ... + fun:g_object_new +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + fun:malloc + fun:standard_malloc + fun:g_malloc + fun:g_slice_alloc + fun:g_slice_alloc0 + fun:get_dispatch + fun:g_main_dispatch + fun:g_main_context_dispatch + fun:g_main_context_iterate + fun:g_main_loop_run +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + fun:malloc + fun:standard_malloc + fun:g_malloc + fun:g_memdup + fun:g_hash_table_insert_node + fun:g_hash_table_insert_internal + fun:g_hash_table_insert + fun:handler_list_ensure + fun:handler_insert + fun:g_signal_connect_data +} diff --git a/configure.ac b/configure.ac index 987042a1..e4fef4b7 100644 --- a/configure.ac +++ b/configure.ac @@ -31,7 +31,7 @@ AC_CONFIG_MACRO_DIR([build/m4]) AC_CONFIG_AUX_DIR([build]) AC_CONFIG_HEADERS(config.h) AC_CONFIG_SRCDIR([daemon/gkd-main.c]) -AM_INIT_AUTOMAKE([1.9 foreign dist-bzip2 no-dist-gzip]) +AM_INIT_AUTOMAKE([1.13 foreign dist-bzip2 no-dist-gzip parallel-tests]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AM_SANITY_CHECK diff --git a/daemon/dbus/Makefile.am b/daemon/dbus/Makefile.am index bc33ffa4..dead5f4c 100644 --- a/daemon/dbus/Makefile.am +++ b/daemon/dbus/Makefile.am @@ -75,7 +75,7 @@ daemon_dbus_LIBS = \ $(GIO_LIBS) \ $(GLIB_LIBS) -TEST_PROGS += \ +daemon_dbus_TESTS = \ test-dbus-util \ test-dbus-search \ test-dbus-items \ @@ -98,3 +98,6 @@ test_dbus_signals_CFLAGS = $(daemon_dbus_CFLAGS) test_dbus_lock_SOURCES = daemon/dbus/test-dbus-lock.c test_dbus_lock_LDADD = $(daemon_dbus_LIBS) + +check_PROGRAMS += $(daemon_dbus_TESTS) +TESTS += $(daemon_dbus_TESTS) diff --git a/egg/Makefile.am b/egg/Makefile.am index 02570375..21d9898b 100644 --- a/egg/Makefile.am +++ b/egg/Makefile.am @@ -130,7 +130,7 @@ egg_LIBS = \ $(GTHREAD_LIBS) \ $(GLIB_LIBS) -TEST_PROGS += \ +egg_TESTS = \ test-asn1 \ test-asn1x \ test-dn \ @@ -187,3 +187,6 @@ test_dh_LDADD = $(egg_LIBS) test_spawn_SOURCES = egg/test-spawn.c test_spawn_LDADD = $(egg_LIBS) + +check_PROGRAMS += $(egg_TESTS) +TESTS += $(egg_TESTS) diff --git a/egg/egg-asn1x.c b/egg/egg-asn1x.c index 4ffcdf21..b18ddefe 100644 --- a/egg/egg-asn1x.c +++ b/egg/egg-asn1x.c @@ -4513,7 +4513,7 @@ traverse_and_dump (GNode *node, gpointer unused) depth = g_node_depth (node); for (i = 0; i < depth - 1; ++i) - g_printerr (" "); + g_print (" "); an = node->data; output = g_string_new (""); @@ -4521,14 +4521,14 @@ traverse_and_dump (GNode *node, gpointer unused) dump_append_flags (output, anode_def_flags (node)); string = g_utf8_casefold (output->str, output->len - 1); g_string_free (output, TRUE); - g_printerr ("+ %s: %s [%s]%s\n", anode_def_name (node), anode_def_value (node), + g_print ("+ %s: %s [%s]%s\n", anode_def_name (node), anode_def_value (node), string, an->parsed || an->value ? " *" : ""); g_free (string); /* Print out all the options */ for (l = an->opts; l; l = g_list_next (l)) { for (i = 0; i < depth; ++i) - g_printerr (" "); + g_print (" "); def = l->data; output = g_string_new (""); @@ -4536,7 +4536,7 @@ traverse_and_dump (GNode *node, gpointer unused) dump_append_flags (output, def->type); string = g_utf8_casefold (output->str, output->len - 1); g_string_free (output, TRUE); - g_printerr ("- %s: %s [%s]\n", def->name, (const gchar*)def->value, string); + g_print ("- %s: %s [%s]\n", def->name, (const gchar*)def->value, string); g_free (string); } diff --git a/pkcs11/gkm/Makefile.am b/pkcs11/gkm/Makefile.am index 20c7d912..65d27d75 100644 --- a/pkcs11/gkm/Makefile.am +++ b/pkcs11/gkm/Makefile.am @@ -146,7 +146,7 @@ gkm_LIBS = \ $(GTHREAD_LIBS) \ $(LIBGCRYPT_LIBS) -TEST_PROGS += \ +gkm_TESTS = \ test-attributes \ test-credential \ test-data-asn1 \ @@ -201,3 +201,6 @@ test_transaction_SOURCES = pkcs11/gkm/test-transaction.c test_transaction_LDADD = $(gkm_LIBS) ASN1_FILES += pkcs11/gkm/test.asn + +check_PROGRAMS += $(gkm_TESTS) +TESTS += $(gkm_TESTS) diff --git a/pkcs11/gnome2-store/Makefile.am b/pkcs11/gnome2-store/Makefile.am index 1f7d8e45..14f2d08b 100644 --- a/pkcs11/gnome2-store/Makefile.am +++ b/pkcs11/gnome2-store/Makefile.am @@ -56,7 +56,7 @@ gnome2_store_LIBS = \ # check_gnome2_module_LDADD = $(P11_TESTS_LIBS) $(LDADD) # endif -TEST_PROGS += \ +gnome2_store_TESTS = \ test-gnome2-file \ test-gnome2-storage \ test-gnome2-private-key \ @@ -81,6 +81,9 @@ test_import_SOURCES = pkcs11/gnome2-store/test-import.c test_import_CFLAGS = $(GCR_BASE_CFLAGS) $(GCK_CFLAGS) test_import_LDADD = $(GCR_BASE_LIBS) $(GCK_LIBS) $(gnome2_store_LIBS) +check_PROGRAMS += $(gnome2_store_TESTS) +TESTS += $(gnome2_store_TESTS) + noinst_PROGRAMS += \ frob-gnome2-file diff --git a/pkcs11/secret-store/Makefile.am b/pkcs11/secret-store/Makefile.am index 9bdfe71e..3b359bae 100644 --- a/pkcs11/secret-store/Makefile.am +++ b/pkcs11/secret-store/Makefile.am @@ -76,7 +76,7 @@ dump_keyring0_format_SOURCES = \ pkcs11/secret-store/dump-keyring0-format.c dump_keyring0_format_LDADD = $(secret_store_LIBS) -TEST_PROGS += \ +secret_store_TESTS = \ test-secret-compat \ test-secret-fields \ test-secret-data \ @@ -119,3 +119,6 @@ test_secret_binary_SOURCES = pkcs11/secret-store/test-secret-binary.c test_secret_binary_LDADD = $(secret_store_LIBS) EXTRA_DIST += pkcs11/secret-store/fixtures + +check_PROGRAMS += $(secret_store_TESTS) +TESTS += $(secret_store_TESTS) diff --git a/pkcs11/ssh-store/Makefile.am b/pkcs11/ssh-store/Makefile.am index 6300dbe5..5cbb0389 100644 --- a/pkcs11/ssh-store/Makefile.am +++ b/pkcs11/ssh-store/Makefile.am @@ -54,7 +54,7 @@ ssh_store_LIBS = \ # check_ssh_module_LDADD = $(P11_TESTS_LIBS) $(LDADD) # p11-tests.conf.in -TEST_PROGS += \ +ssh_store_TESTS = \ test-ssh-openssh \ test-private-key @@ -64,11 +64,13 @@ test_ssh_openssh_LDADD = $(ssh_store_LIBS) test_private_key_SOURCES = pkcs11/ssh-store/test-private-key.c test_private_key_LDADD = $(ssh_store_LIBS) +check_PROGRAMS += $(ssh_store_TESTS) +TESTS += $(ssh_store_TESTS) + noinst_LIBRARIES += libgkm-mock-ssh-module.a libgkm_mock_ssh_module_a_SOURCES = \ pkcs11/ssh-store/mock-ssh-module.c \ pkcs11/ssh-store/mock-ssh-module.h -EXTRA_DIST += \ - pkcs11/ssh-store/fixtures +EXTRA_DIST += pkcs11/ssh-store/fixtures diff --git a/pkcs11/wrap-layer/Makefile.am b/pkcs11/wrap-layer/Makefile.am index 7692e467..8d3ecdcd 100644 --- a/pkcs11/wrap-layer/Makefile.am +++ b/pkcs11/wrap-layer/Makefile.am @@ -37,7 +37,7 @@ wrap_layer_LIBS = \ $(GCR_BASE_LIBS) \ $(GLIB_LIBS) -TEST_PROGS += \ +wrap_layer_TESTS = \ test-create-credential \ test-init-pin \ test-login-auto \ @@ -77,6 +77,9 @@ test_set_pin_SOURCES = pkcs11/wrap-layer/test-set-pin.c test_set_pin_LDADD = $(wrap_layer_LIBS) test_set_pin_CFLAGS = $(wrap_layer_CFLAGS) +check_PROGRAMS += $(wrap_layer_TESTS) +TESTS += $(wrap_layer_TESTS) + noinst_LIBRARIES += libgkm-mock-secret-store.a libgkm_mock_secret_store_a_SOURCES = \ diff --git a/pkcs11/xdg-store/Makefile.am b/pkcs11/xdg-store/Makefile.am index 4b6b8902..659b3dec 100644 --- a/pkcs11/xdg-store/Makefile.am +++ b/pkcs11/xdg-store/Makefile.am @@ -62,7 +62,7 @@ xdg_store_LIBS = \ # check_xdg_module_CFLAGS = $(P11_TESTS_CFLAGS) # check_xdg_module_LDADD = $(P11_TESTS_LIBS) $(LDADD) -TEST_PROGS += \ +xdg_store_TESTS = \ test-xdg-module \ test-xdg-trust @@ -72,8 +72,10 @@ test_xdg_module_LDADD = $(xdg_store_LIBS) test_xdg_trust_SOURCES = pkcs11/xdg-store/test-xdg-trust.c test_xdg_trust_LDADD = $(xdg_store_LIBS) -EXTRA_DIST += \ - pkcs11/xdg-store/fixtures +check_PROGRAMS += $(xdg_store_TESTS) +TESTS += $(xdg_store_TESTS) + +EXTRA_DIST += pkcs11/xdg-store/fixtures noinst_PROGRAMS += \ frob-trust-file \ |