automake
[Top][All Lists]
Advanced

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

Re: Launch bash script for functional testing with "make check" and "mak


From: Stefano Lattarini
Subject: Re: Launch bash script for functional testing with "make check" and "make distcheck"
Date: Wed, 09 Jan 2013 13:22:09 +0100

On 01/09/2013 05:41 AM, Timothée Flutre wrote:
> Hello,
> I am using Autotools for my C++ package. My package has a single
> binary (let's call it "myprog"). I also wrote a bash script,
> "launch_functional_tests.bash". This script has 4 steps:
> (1) create input files,
> (2) generate expected output files (by launching something like "R
> --file=functional_tests.R",
> (3) launch "myprog" on the input files,
> (4) compare the outputs of "prog" with the expected outputs generated
> by the R script at step 2.
> 
> In step 3, "launch_functional_tests.bash" needs to know the path to
> "myprog". If I run the bashs cript on standalone myself, I give the
> path to "myprog" as an option on the command-line. But what can I do
> when using make check?
> 
Pass is as an environment variable instead, and define that in
AM_TESTS_ENVIRONMENT [1][2]; e.g. (untested):

  AM_TESTS_ENVIRONMENT = \
    my_prog_abspath='$(abs_top_srcdir)'/myprog;
    export my_prog_abspath;

(yes, the semicolon at the end is really required).

That should work in VPATH setups as well, and in particular, in
"make distcheck".

[1] Reference to documentation:
    
<http://www.gnu.org/software/automake/manual/automake.html#index-AM_005fTESTS_005fENVIRONMENT-842>
[2] If you are catering to Automake 1.11 as well, you should use
    TESTS_ENVIRONMENT instead of the safer AM_TESTS_ENVIRONMENT,
    since the former is only supported starting with Automake 1.12.

>
> [MEGA-SNIP]
>

HTH,
  Stefano



reply via email to

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