I am writing a small library and want to make it accessible using autotools with automake 1.11. The only interesting outcome is the library libfoo.so.
I wrote a unit test for the library which I want be executed during the make process or when running make check. I don not want the unit test to appear in $PREFIX/foo/bin/.
How do I achieve these goals?
As the automake manual describes, you use the
"check_"prefix. Let’s say the library is built under the directorysrc/, and the unit tests are undertests/– then in thetests/Makefile.amfile:I assume you’re using
libtoolof course. This takes care of linking, dynamic paths, etc., if you’re building a shared library.You should also have a look at the use of the
TESTSvariable in automake.