autoconf
[Top][All Lists]
Advanced

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

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


From: Bruce Korb
Subject: Re: How do I pass an argument to a test???
Date: Sat, 12 Apr 2003 17:00:55 -0700

"Dr. David Kirkby" wrote:
> 
> 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.

It's defined at config time, not at run time.
Add:  ``mpirun_found=$(mpirun_found)'' to the environment
and see this page:

   http://Autogen.SourceForge.Net/conftest.html

using a ``test'' type of test to set up what you want.




reply via email to

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