[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Test suite best practices ?



Xavier Roche <rocheml@httrack.com> writes:

> Are there any "best practices" on how to handle test suite in Debian ?

> Currently the best way seems to use the automake's testsuite, and call
> dh_auto_test after dh_auto_build - but it generally needs some hacking
> wrt. library and binary pathes - ie. something ugly like:

> # Makefile.am
> TESTS_ENVIRONMENT =
> LD_LIBRARY_PATH=$(top_builddir)/src/.libs:$$LD_LIBRARY_PATH
> TESTS_ENVIRONMENT += PATH=$(top_builddir)/src/.libs:$$PATH
> TESTS = *.test

> There might be better ways (and more portable - are we sure that
> LD_LIBRARY_PATH is awlays the right one ?) ?

This shouldn't be necessary to run the compile-time test suite.  If it is,
that's a bug in the upstream build system.  Judging from the use of .libs,
upstream is using libtool; the test programs should be handled by libtool
(replaced with shell scripts that set LD_LIBRARY_PATH and invoke the right
binary) so that they can run successfully from the build tree.  In other
words, as long as the test suite is built with libtool like the rest of
the package, this should just work.

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>


Reply to: