I don't know Module::Install, but a more portable Unix way to write:

 export MATH_ROUND_FAIR_DEBUG=1

is:

 MATH_ROUND_FAIR_DEBUG=1;export MATH_ROUND_FAIR_DEBUG

The former abbreviated syntax was introduced in the Korn shell, while
the latter works with both the Korn shell and the original Bourne shell
(bash is Korn-shell derived).

Of course this is Unix-shell specific and may not work on non-Unix platforms.

HTH,
/-\


----- Original Message ----
From: Marc Mims <m...@questright.com>
To: module-authors@perl.org
Sent: Thu, 16 December, 2010 12:16:14 PM
Subject: Setting an environment variable for tests

I recently released a new version of Math::Round::Fair.  Anders Johnson 
provided several in situ tests that we optimized out at compile time 
using Devel::Assert.  They can be turned on by setting an environment 
variable:

    MATH_ROUND_FAIR_DEBUG=1

I wanted the assertions enabled when "make test" runs without having to 
explicitly set the variable in each test.  And I found a way to do that, 
using Module::Install's "preamble":

    ぴreamble "export MATH_ROUND_FAIR_DEBUG=1\n";

That works for Linux systems, but seems to be failing on other 
platforms:

http://www.cpantesters.org/cpan/report/28e28ab0-0825-11e0-bb29-ad544afd17af
http://www.cpantesters.org/cpan/report/68705c5e-086e-11e0-bb29-ad544afd17af


So, how *should* I be doing this?

    -Marc




Reply via email to