[Scons-dev] Hummm... rant on

Russel Winder russel at winder.org.uk
Mon Mar 3 02:35:20 EST 2014


On Sun, 2014-03-02 at 14:55 -0500, Gary Oberbrunner wrote:

> As far as I understand it, env.Detect calls env.WhereIs with path=None,

> which means it uses env['ENV']['PATH']. By default, a new Environment

> doesn't inherit the user's shell environment into env['ENV'], but users can

> modify it as they want. So in a real user's code, the path Detect will use

> depends on what they put into their SConstruct.

>

> I see your point about the tests being more lenient in where they look; it

> makes it hard to skip tests reliably. Perhaps the tests that do that

> should add their executable's dir to env['ENV']['PATH'] when running the

> tests? If you like that, perhaps we could codify it by making it easy to

> do from the test framework.


The point for me is that TestSCons.TestSCons().where_is(x) appears not
to be following the same rules as env.Detect and it should.

This then raises the issue you are hinting at: the base PATH only
includes the standard "out of the box", "newly installed" OS path. This
is fine for me actually, but if, and only if, there is a way for a test
environment to declare a new base PATH because it has to.

An example: my Debians have dmd and gdc from packages so they are in the
base path. My Fedoras have no gdc (because, … well let's leave that
there :-). None of them have an up to date ldc2 so that is only found in
the location I set because it is not packaged. My OSX has a very similar
set up to my Fedora. Using only the pure base path, I can never test gdc
and ldc2 related tests, unless there is some way of setting the base
path for env.Detect. This has to be on a per-test location basis, not
hardwired in code of SCons and it's tests since where anyone else has
dmd, gdc and ldc2 may be different.

Having an entry 'test_base_path = '...' in a ~/.scons/settings.py or
something similar would work fine for me. This only alters the behaviour
for tests, not for normal execution.

--
Russel.
=============================================================================
Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder at ekiga.net
41 Buckmaster Road m: +44 7770 465 077 xmpp: russel at winder.org.uk
London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder



More information about the Scons-dev mailing list