automake
[Top][All Lists]
Advanced

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

Re: How to pass parameters to test program


From: Dmitry V. Krivenok
Subject: Re: How to pass parameters to test program
Date: Fri, 17 Apr 2009 13:30:27 +0400
User-agent: Thunderbird 2.0.0.21 (X11/20090302)

Ralf Wildenhues wrote:
Hello Dmitry,

* Dmitry V. Krivenok wrote on Thu, Apr 16, 2009 at 02:18:25PM CEST:
I implemented some tests for my library using Boost.Test.
Resulting test executable works fine.
It's automatically executed when I run "make check".

Does it use the "simple Automake tests" test driver that is invoked when
the TESTS variable is set?

Yes, the header of Makefile.am is:
TESTS=liboragate_ng_test
check_PROGRAMS=liboragate_ng_test
...
...
The problem is that I want to pass parameters (--report_level=detailed --log_level=all) to my test program via command line. How can I specify parameters to be passed to test executable during "make check"?
Is it possible at all?

With Automake 1.10.2, it is possible but only through a kludge.
For example:

--- test-driver ---
#! /bin/sh
exec $1 --report_level=detailed --log_level=all

--- Makefile.am ---
# hack: put a driver right before the test name.
TESTS_ENVIRONMENT = ./test-driver

TESTS = prog1 ...
---
It looks really ugly :)
Fortunately, Boost.Test allows configuration via environment variables.
So, I defined TESTS_ENVIRONMENT in Makefile.am as follows:
TESTS_ENVIRONMENT=BOOST_TEST_REPORT_LEVEL=detailed BOOST_TEST_LOG_LEVEL=all

Thanks!

With the 'parallel-tests' driver in upcoming Automake 1.11, it will at
least be possible not use the TESTS_ENVIRONMENT variable (which is
indented to be a user variable), but a LOG_COMPILER variable (or
FOO_LOG_COMPILER for tests with known extension .foo) for this same
hack.  We still don't support passing arguments; I'm wondering whether
we should, and what to name the respective variables, and how to allow
to per-target'ify them.

Cheers,
Ralf


--
Sincerely yours, Dmitry V. Krivenok
Orange System Co., Ltd.
Saint-Petersburg, Russia
work phone: +7 812 332-32-40
cellular phone: +7 921 576-70-91
e-mail: address@hidden
web: http://www.orangesystem.ru
skype: krivenok_dmitry
jabber: address@hidden
icq: 242-526-443





reply via email to

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