automake
[Top][All Lists]
Advanced

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

Re: Doing something just a bit more complex than `make check'


From: Ralf Wildenhues
Subject: Re: Doing something just a bit more complex than `make check'
Date: Mon, 24 Oct 2005 15:04:49 +0200
User-agent: Mutt/1.5.11

Hello there,

* Roberto Bagnara wrote on Wed, Oct 19, 2005 at 09:13:16PM CEST:
> 
> Instead, what I would like to have is to only say
> 
> test1_SOURCES = test1.cc
> test2_SOURCES = test2.cc
> ...
> 
> and then achieve the effect of (sorry for the pseudo-code)
> 
>    for flags in $FLAGS_CHOICES
>    do
>       make check with CXXFLAGS="$flags"
>       force recompilation at the next iteration (e.g., by erasing 
>       executables)
>    done
> 
> How can I best obtain this effect without giving up (too many of)
> the advantages offered by Automake?

I believe something along these lines may be achieved by

| check_SCRIPTS = runtests
| check_PROGRAMS = test1 test2
| test1_SOURCES = test1.cc
| test2_SOURCES = test2.cc
| TESTS = $(check_SCRIPTS)
| my-check-clean:
|       rm -f $(check_PROGRAMS) *.o *.obj

in Makefile.am, and your pseudo code in `./runtests':
    for flags in $FLAGS_CHOICES
    do
       make check CXXFLAGS="$flags" TESTS='test1 test2'
       make my-check-clean
       # to force recompilation at the next iteration
    done

Surely the object removal is a bit of a hack, and should be adapted
unless your test suite lives in its own directory/Makefile.am.
I haven't tested this, by the way; please complain if it doesn't work.  :)

If you want to go much further, you either end up creating more complex
shell scripts, or using one of the more advanced test suite creation
tools: Autoconf's Autotest, DejaGNU, ...

Cheers,
Ralf




reply via email to

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