From b79e8b369649f053ce3a39d3d178e4e2dbcf9993 Mon Sep 17 00:00:00 2001 From: Morgan Deters Date: Sat, 24 Sep 2011 18:04:08 +0000 Subject: Fix to building and linking for unit tests. (This should fix the segfaulting units in optimized-dynamic. The problem was that the code incorrectly determined the address of one of the thread-scoped global variables, and I think it's because the same library was linked twice into the unit test in two different ways, confusing the runtime support code.) --- Makefile.am | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index b293da744..f8538b548 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,7 +10,10 @@ SUBDIRS = src test contrib .PHONY: units systemtests regress regress0 regress1 regress2 regress3 systemtests regress regress0 regress1 regress2 regress3: all +(cd test && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1 +# We descend into "src" with the "check" target here to ensure that +# the test prerequisites are all built. units: all + (cd src && $(MAKE) $(AM_MAKEFLAGS) check) +(cd test && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1 LCOV = lcov @@ -29,6 +32,7 @@ if COVERAGE_ENABLED # work...) lcov: all $(LCOV) -z -d . + $(MAKE) check -C src +$(MAKE) check -C test/unit $(LCOV) -c -d . -t cvc4_units -o cvc4-coverage-full.info $(LCOV) -o cvc4-coverage.info -r cvc4-coverage-full.info $(LCOV_EXCLUDES) @@ -40,6 +44,7 @@ lcov: all lcov-all: all $(LCOV) -z -d . + $(MAKE) check -C src +$(MAKE) check -C test $(LCOV) -c -d . -t cvc4_units -o cvc4-coverage-full.info $(LCOV) -o cvc4-coverage.info -r cvc4-coverage-full.info $(LCOV_EXCLUDES) @@ -57,6 +62,8 @@ lcov18: all echo; echo "=== Collecting coverage data from $$testtype unit tests ==="; \ echo $(LCOV) -z -d .; \ $(LCOV) -z -d . || exit 1; \ + echo $(MAKE) check -C src || exit 1; \ + $(MAKE) check -C src || exit 1; \ echo $(MAKE) check -C test/unit TEST_SUFFIX=_$$testtype || exit 1; \ $(MAKE) check -C test/unit TEST_SUFFIX=_$$testtype || exit 1; \ echo $(LCOV) -c -d . -t $$testtype -o cvc4-coverage-$$testtype-full.info || exit 1; \ -- cgit v1.2.3