automake
[Top][All Lists]
Advanced

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

RE: Trouble creating a check program in automake


From: Arthur Schwarz
Subject: RE: Trouble creating a check program in automake
Date: Wed, 11 Mar 2015 08:14:26 -0700


-----Original Message-----


> I'm trying to learn automake (Autotools by John Calcotte) and am stumped
on
> creating a check program to test my C++ library. A partial listing of the
> program is given below. The example in the text shows creation of a test
> program using a shell script testing the output of the test program. I
have
> a program, linked to the library, which when executed tests the library
> functionality. Do I have to create the test program using noinst and then
> execute using a shell script? Any scripting examples or references to
> examples would help.

There needs to be check_PROGRAMS set to the list of programs which 
need to be built to support the 'check' target.  It seems like you did 
that.  However, I don't see where you created the build specification 
for the program 'Test' (e.g. Test_SOURCES).

To be more clear, you can have many test programs so your 
'check_SOURCES' specification does not make sense.   Each test program 
has its own _SOURCES and the only program you have listed is 'Test'.

I would offer my own project as an example but it is large, 
non-recursive, uses Makefile includes from subdirectories, and uses 
Automake's TAP test framework so it may not be easy to understand.

Bob

-------------------- My modified src/Makefile.am -----------------------

# Testing SLIP

testdir            = ./test

check_PROGRAMS      = test
test_SOURCES       = $(testCPP) $(testHead)
test_LDADD         = libslip.a
TESTS              = $(check_PROGRAMS)

CLEANFILES         = $(testdir)

The reported sequence of commands for 'make check' are:
        make check
        make check-Tests

The compile of my test is successful but linking is not done. The message
is:

    g++: warning: Test.o: linker input file unused because linking not done

for each source file. This error occurs for both 'make check' and 'make
check-Tests' indicating, I suppose, that there are two attempts to link.

Any idea what I'm doing wrong? I've now attempted to read four manuals
trying to find out how to make this fool thing work and am just stymied (and
frustrated).

art




reply via email to

[Prev in Thread] Current Thread [Next in Thread]