[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
only running tests if a given library is available
From: |
Adam Mercer |
Subject: |
only running tests if a given library is available |
Date: |
Wed, 12 Aug 2009 12:03:29 -0500 |
Hi
In one of my projects the test suite requires an extra library to be
available that isn't required to build the rest of the package so I
would like to make this library an optional dependency and then only
build the test suite if configure finds this library. To detect this
library I have the following in the projects configure.ac:
# check for lalsupport, needed for test suite
PKG_CHECK_MODULES([LALSUPPORT],[lalsupport],[true],[false])
AC_CHECK_LIB([lalsupport],[LALOpenDataFile2],,[lalsupport=false])
AM_CONDITIONAL([LALSUPPORT], [test x$lalsupport = xtrue])
the check finds the library but fails the function check:
checking for LALSUPPORT... yes
checking for LALOpenDataFile2 in -llalsupport... no
and then I have the following in the test/Makefile.am
if LALSUPPORT
TESTS = StochasticCrossCorrelationStatisticTest \
StochasticHeterodynedCrossCorrelationStatisticTest \
StochasticCrossCorrelationSpectrumTest \
SZeroPadAndFFTTest CZeroPadAndFFTTest \
StochasticOptimalFilterTest \
StochasticOptimalFilterNormalizationTest StochasticOmegaGWTest \
OverlapReductionFunctionTest StochasticInverseNoiseTest \
AstroOmegaTest SimulateSBTest SimulatePopcornTest
else
TESTS =
endif
but running make check tries to build the test programs even though
the function wasn't found in the library. Shouldn't LALSUPPORT be set
to false as this function isn't found, therefore the test programs
shouldn't be built. I'm clearly missing something here? Can anyone see
what I'm doing wrong?
Cheers
Adam
- only running tests if a given library is available,
Adam Mercer <=