automake
[Top][All Lists]
Advanced

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

Re: Automake TESTS question


From: Ralf Wildenhues
Subject: Re: Automake TESTS question
Date: Sun, 18 May 2008 14:11:44 +0200
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

* John Calcote wrote on Fri, May 16, 2008 at 11:00:40PM CEST:
> EXTRA_DIST = greptest.sh
> TESTS = greptest.sh
> 
> But this requires me to:
> 
> 1) Actually HAVE a one-line script file called "greptest.sh" as part of
> my package.
> 
> 2) Use the EXTRA_DIST line. Why is this? Can't Automake tell from the
> TESTS line that this is a file I need in my distribution?

You can use
  check_SCRIPTS = greptest.sh

Note that some make implementations have a builtin implicit rule to
update greptest from greptest.sh (which may or may not affect your
package).

> In my experiments, I've also discovered this method:
> 
> TESTS_ENVIRONMENT = $(SHELL)
> TESTS = greptest.sh
> 
> greptest.sh:
>        echo 'myprog | grep "myprog text"' > greptest.sh
> 
> clean-local:
>        -rm greptest.sh
> 
> But this seems overly complex for a one-liner.

Agreed.  Also I think that use of TESTS_ENVIRONMENT does not extend
nicely (and isn't covered by the documentation).

> In addition, I had to add
> the TESTS_ENVIRONMENT line because I could NOT get chmod to set
> greptest.sh to executable. The make utility just seemed to ignore the
> command, if I added it after the echo line.

I don't understand this failure.

> The clean-local line was necessary in this case because "make distcheck"
>  complains that greptest.sh was left lying around, and the "-" in front
> of "rm" was necessary because otherwise "make clean" will fail if "make
> check" isn't run first.

Sounds fine.

> Anyone know of a more concise way of doing this? Frankly, I'd like to
> just run the script inline somewhere, but I can't see a way to do it
> with Automake. It wants all TESTS to be real files.

Yes, unfortunately Automake's TESTS feature is that simple-minded.
You could take a look at Automake's own test suite for some ideas
how to use it.

You may also want to look into other test suite frameworks.  Autotest
and DejaGNU come to mind, but there are others as well.

Hope that helps.

Cheers,
Ralf




reply via email to

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