Thanks, I've added TESTS_ENVIRONMENT (tried with or without "AC_") in my test/Makefile.am and updated the rest like this:
launch_functional_tests.bash: $(srcdir)/launch_functional_tests.in sed -e 's,PATHTOMYPROG,$(myprog_abspath),g' $(srcdir)/launch_functional_tests.in > launch_functional_tests.bash chmod +x launch_functional_tests.bash However, the variable $(myprog_abspath) is empty! This can be seen on the stdout when running "make": ... make[1]: Entering directory `~/mypkg/test' sed -e 's,PATHTOMYPROG,,g' ./launch_functional_tests.in > launch_functional_tests.bash chmod +x launch_functional_tests.bash make[1]: Leaving directory `~/mypkg/test' ... I'm using Automake v1.9.6. Can the problem come from this? (For completeness, the machine I'm using has Autoconf v2.59.) I also noticed that you wrote "export myprog_abspath;" and not "export $(myprog_abspath);". Still, I tried both, but without success. The manual also speaks of a script "tests-env.sh". Is there a GNU package using something like this, so that I could have a look at it? Tim On Wed, Jan 9, 2013 at 6:22 AM, Stefano Lattarini <stefano.lattar...@gmail.com> wrote: > > 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