diff --git a/configure.ac b/configure.ac index 1daf685..05a4386 100644 --- a/configure.ac +++ b/configure.ac @@ -69,6 +69,7 @@ AC_ARG_ENABLE(builtin, enable_builtin=yes AC_DEFINE([WITH_BUILTIN], [1], [compile PSL data into library]) ]) +AM_CONDITIONAL([WITH_BUILTIN], [test $enable_builtin = yes]) # Check for valgrind ac_enable_valgrind=no diff --git a/src/Makefile.am b/src/Makefile.am index 0f70961..7a584bb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,3 @@ -#EXTRA_DIST = $(top_srcdir)/data/effective_tld_names.dat - # suffixes.c must be created before psl.c is compiled BUILT_SOURCES = suffixes.c diff --git a/tests/Makefile.am b/tests/Makefile.am index b358ada..e200a22 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -2,9 +2,20 @@ DEFS = @DEFS@ -DDATADIR=\"$(top_srcdir)/data\" -DSRCDIR=\"$(srcdir)\" -DPSL_FILE AM_CPPFLAGS = -I$(top_srcdir)/include LDADD = ../src/libpsl-@LIBPSL_API_VERSION@.la +if WITH_BUILTIN + PSL_TESTS = test-is-public test-is-public-builtin test-is-public-all test-registrable-domain \ test-is-cookie-domain-acceptable +else + +# ./configure'd with '--disable-builtin' +# Do not call test-is-public-builtin here: it does not make sense. +# Do not call test-registrable-domain here: it would fail due to missing punycode entries in PSL file. +PSL_TESTS = test-is-public test-is-public-all test-is-cookie-domain-acceptable + +endif + check_PROGRAMS = $(PSL_TESTS) TESTS_ENVIRONMENT = TESTS_VALGRIND="@VALGRIND_ENVIRONMENT@" diff --git a/tests/test-is-public-builtin.c b/tests/test-is-public-builtin.c index fdc2701..e4ff3fc 100644 --- a/tests/test-is-public-builtin.c +++ b/tests/test-is-public-builtin.c @@ -121,9 +121,7 @@ int main(int argc, const char * const *argv) } } -#ifdef WITH_BUILTIN test_psl(); -#endif if (failed) { printf("Summary: %d out of %d tests failed\n", failed, ok + failed); diff --git a/tests/test-registrable-domain.c b/tests/test-registrable-domain.c index c1756a9..17bed2f 100644 --- a/tests/test-registrable-domain.c +++ b/tests/test-registrable-domain.c @@ -156,9 +156,7 @@ int main(int argc, const char * const *argv) } } -#ifdef WITH_BUILTIN test_psl(); -#endif if (failed) { printf("Summary: %d out of %d tests failed\n", failed, ok + failed);