I am working in a project with other people in the team using GNU autotools. In the project we are using unit test for each non trivial C++ class. I found out that there is support for unit testing. For that I am using this structure:
./
+ tests/
+ Makefile.am
+ classA_test.cc
....
+ classB_test.cc
+ src/
+ lib/
+ Makefile.am
The problem comes since my main Makefile.am is using subdir-objects options --note that I am not using recursive makefile for the source files--, I cannot export my variables --such as, AM_CPPFLAGS-- to the other Makefile. So far I made it work using:
$ make check
but I keep getting problems for the paths and the options when I do
$ make distcheck
So my questions is, how is the standard way to deal with unit tests?
EDIT:
I made it work as long as I remove the subdir-objects from the tests/Makefile.am. Now it throw some warnings but it compiles. Still it seems not to be an appropriate way to deal with unit tests