From 7f0a65439fa766d4260c4684c568304fd56f5879 Mon Sep 17 00:00:00 2001 From: Romain Tartiere Date: Sat, 26 Mar 2011 13:30:14 +0000 Subject: [PATCH] Build unit-tests as part of all-am if DEBUG is enabled, otherwise at check-am before running the test suite. --- test/Makefile.am | 37 ++++++++++++++++++++----------------- test/common/Makefile.am | 10 ++++++++-- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index a56a171..13a4dad 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -12,20 +12,26 @@ if WITH_CUTTER TESTS = run-test.sh TESTS_ENVIRONMENT = NO_MAKE=yes CUTTER="$(CUTTER)" -check_LTLIBRARIES = \ - test_mad.la \ - test_mifare_application.la \ - test_mifare_classic.la \ - test_mifare_classic_create_trailer_block.la \ - test_mifare_classic_sector_boundaries.la \ - test_mifare_desfire.la \ - test_mifare_desfire_aes.la \ - test_mifare_desfire_aid.la \ - test_mifare_desfire_des.la \ - test_mifare_desfire_ev1.la \ - test_mifare_desfire_key.la \ - test_mifare_ultralight.la \ - test_tlv.la +cutter_unit_test_libs = \ + test_mad.la \ + test_mifare_application.la \ + test_mifare_classic.la \ + test_mifare_classic_create_trailer_block.la \ + test_mifare_classic_sector_boundaries.la \ + test_mifare_desfire.la \ + test_mifare_desfire_aes.la \ + test_mifare_desfire_aid.la \ + test_mifare_desfire_des.la \ + test_mifare_desfire_ev1.la \ + test_mifare_desfire_key.la \ + test_mifare_ultralight.la \ + test_tlv.la + +if WITH_DEBUG +noinst_LTLIBRARIES = $(cutter_unit_test_libs) +else +check_LTLIBRARIES = $(cutter_unit_test_libs) +endif AM_LDFLAGS = -module -rpath $(libdir) -avoid-version -no-undefined @@ -89,7 +95,4 @@ echo-cutter: EXTRA_DIST = run-test.sh CLEANFILES = *.gcno -update: - $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) - endif diff --git a/test/common/Makefile.am b/test/common/Makefile.am index 9750b1e..dbad4e7 100644 --- a/test/common/Makefile.am +++ b/test/common/Makefile.am @@ -5,8 +5,14 @@ AM_CFLAGS = @LIBNFC_CFLAGS@ if WITH_CUTTER -check_LTLIBRARIES = \ - libtestcommon.la +cutter_unit_test_libs = \ + libtestcommon.la + +if WITH_DEBUG +noinst_LTLIBRARIES = $(cutter_unit_test_libs) +else +check_LTLIBRARIES = $(cutter_unit_test_libs) +endif libtestcommon_la_SOURCES = mifare_desfire_auto_authenticate.c \ mifare_desfire_auto_authenticate.h