Discussion:
test programs in C and C++
Vincent Delecroix
2018-03-11 12:53:52 UTC
Permalink
Dear all,

I am working on the C project e-antic [1] which also contains a (header
only) C++ interface. Most of the tests are written in C but the ones
testing the C++ interface are of course in C++. I am facing difficulties
to make it work properly.

The current automake setup is as follows

- /Makefile.am: for the C code compilation and the C test programs

- /e-antic/test/Makefile.am: for the C++ test programs

First of all, I would be happier with only one Makefile.am but I am not
sure it is easily feasible. Secondly, when running "make check" in VPATH
builds the C++ test programs fail to find the header files (it works
fine when the source tree and the build tree is the same). The relevant
instructions in /e-antic/test/Makefile.am are

AM_CPPFLAGS = -I../..
LDADD = ../../libeantic.la

and I believe that they are wrong. Though I was not able to fix them.

Best
Vincent

[1] https://github.com/videlec/e-antic
Vincent Torri
2018-03-11 20:22:18 UTC
Permalink
On Sun, Mar 11, 2018 at 1:53 PM, Vincent Delecroix
Post by Vincent Delecroix
Dear all,
I am working on the C project e-antic [1] which also contains a (header
only) C++ interface. Most of the tests are written in C but the ones
testing the C++ interface are of course in C++. I am facing difficulties
to make it work properly.
The current automake setup is as follows
- /Makefile.am: for the C code compilation and the C test programs
- /e-antic/test/Makefile.am: for the C++ test programs
First of all, I would be happier with only one Makefile.am but I am not
sure it is easily feasible.
you can put everything in the top level Makefile.am, and use relative
path to the top level directory of you project, for example.
Post by Vincent Delecroix
Secondly, when running "make check" in VPATH
builds the C++ test programs fail to find the header files (it works
fine when the source tree and the build tree is the same). The relevant
instructions in /e-antic/test/Makefile.am are
AM_CPPFLAGS = -I../..
LDADD = ../../libeantic.la
if ../../ is the top level directory, try :

AM_CPPFLAGS = -I$(top_srcdir)
LDADD = $(top_builddir)/libeantic.la

best regards

Vincent Torri
Post by Vincent Delecroix
and I believe that they are wrong. Though I was not able to fix them.
Best
Vincent
[1] https://github.com/videlec/e-antic
Loading...