automake
[Top][All Lists]
Advanced

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

How do I pass an argument to a test???


From: Dr. David Kirkby
Subject: How do I pass an argument to a test???
Date: Sun, 13 Apr 2003 00:35:45 +0100

Hi,
        I'm hoping some king sole can help me here, as I am stuck. The only
solution I can think of is rather messy. 

I have a configure.ac which sets a variable 'mpirun_found' to yes or
no, depending on whether or not it can find a program called 'mpirun'.
This is done with the following in my configure.ac

#configure.ac
AC_CHECK_PROG(mpirun_found,mpirun,yes,no,$PATH)


I have about 85 tests in the $top_srdir/tests, each exiting with
either a 0 (passed) or 1 (failed). Most tests make use of the
variables $top_builddir and $top_builddir, which I passed to the tests
with a tests/Makefile.am like this

# This tests/Makefile.am
TESTS_ENVIRONMENT = top_builddir=$(top_builddir)
top_srcdir=$(top_srcdir)
TESTS =  \
always.test \
sometimes.test  
etc.

I would like the first test 'always.test' to always be executed, but
the second 'sometimes.test' to only be executed if the variable
'mpirun_found' is defined. 

I know I can exit with with an exit code of 77 if the test should not
counted in the statistics. But how can I do choose to exit with an
exit code of 77, based on the value of the variable 'mpirun_found'? It
seems it never gets passed to tests/sometimes.test, so there is no
obvious way I can base any decision on its value. 

I tried appending the variable to the 'TESTS_ENVIRONMENT' in
tests/Makefile.am, but that did not work.

I did think of creating an empty file 'mpirun_found' in the tests
directory if the program 'mpirun' was found, and basing my decisions
on the presence or absence of that file. But it seems a bit messy. 

Any better suggestions???? 

-- 
Dr. David Kirkby,
Senior Research Fellow,
Department of Medical Physics,
University College London,
11-20 Capper St, London, WC1E 6JA.
Tel: 020 7679 6408 Fax: 020 7679 6269
Internal telephone: ext 46408
e-mail address@hidden




reply via email to

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