[Scons-users] blocking execution until compilation is done

Kenny, Jason L jason.l.kenny at intel.com
Mon Oct 8 15:39:01 EDT 2012


While I agree with Bill, not sure why you need the test to run after stuff builds.. unless you like some idea of phases, which SCons does not really do ( as it shouldn't). you could map all your top level build actions to an Alias() value and have your tests Alias depend on the "build" alias

However if you do this you need to say something like:

Env.Alias("Tests","build")

As Depends() will not do the correct thing at the moment.
This assume you are using an Alias to do the run command. Such as

Env.Alias("Tests",env.Actions("your command to run test"))

Then you can say

Scons build -> build all your stuff
Scons Tests -> build all your stuff then run the tests.

Hope this helps,
Jason

-----Original Message-----
From: scons-users-bounces at scons.org [mailto:scons-users-bounces at scons.org] On Behalf Of William Deegan
Sent: Monday, October 08, 2012 1:56 PM
To: SCons users mailing list
Subject: Re: [Scons-users] blocking execution until compilation is done


On Oct 8, 2012, at 9:49 AM, edA-qa mort-ora-y <eda-qa at disemia.com> wrote:


> But when I add a Depends to a target it requires that dependency to be

> built if it is out-of-date. That is, it creates an actual dependency.

>

> I have "check_b" which requires "prog_b". I don't wish the "check_b"

> to run until all compilation is done then I do "env.Depends( check_b,

> prog_a )". But what happens now is that if "prog_a" is outdated and I

> do "scons check_b" it will proceed to build "prog_a". That's not what

> I want. I only want to build "prog_a" if it is actually required.

>

> I'm trying to create a fence which basically says all my build actions

> have to occur prior to all my check actions. But there is no

> dependency between all the check and build actions.


Why is this important? (that all build items finish before any test items are run?)

Previously you said:

> Ideally only the builds required for the test should build when running that test.



>From your example:

> check_a : prog_a

> check_b : prob_b

>

> check_all : check_a check_b

>

> If I run "check_a" then only "prog_a" should be built. But if I run

> "check_all" then both prog_a and prog_b should be built prior to

> running either of the check programs. As a project grows I find this

> to be a very useful, if not essential feature, to avoid over building

> and allowing test driver development.


It seems reasonable to imply that if you run "scons check_b' that it would build prog_b.

I don't understand why you want a hard line between building your programs and running your tests.
That said, you can make it so your tests aren't run by default, and only if requested explicitly..

so:
scons would just build your software
and:
scons check_all would run your tests, but still if the programs for the test were out of date for some reason they would be built...


-Bill



>

>

> On 08/10/12 18:05, Kenny, Jason L wrote:

>> Normally in SCons you set up a depend chains. So none the tests or actions you want to run after the compiler action is finish. In simple terms this might like:

>>

>> Outs=env.Program(...)

>> Env.test1(...,outs)

>>

>> Or it could be like

>>

>> Outs=env.Program(...)

>> Tout=Env.runtest(...)

>> Env.Depends(touts,outs)

>>

>>

>> Jason

>>

>> -----Original Message-----

>> From: scons-users-bounces at scons.org

>> [mailto:scons-users-bounces at scons.org] On Behalf Of edA-qa mort-ora-y

>> Sent: Monday, October 08, 2012 10:57 AM

>> To: scons-users at scons.org

>> Subject: Re: [Scons-users] blocking execution until compilation is

>> done

>>

>> On 08/10/12 07:51, William Deegan wrote:

>>> O.k. I don't see what the problem is.

>>> You can do that with SCons..

>>

>> I don't see how I can do it, that's why I'm asking.

>>

>>

>

>

> --

> edA-qa mort-ora-y

> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

> --

> Sign: Please digitally sign your emails.

> Encrypt: I'm also happy to receive encrypted mail.

>

> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/mailman/listinfo/scons-users


_______________________________________________
Scons-users mailing list
Scons-users at scons.org
http://four.pairlist.net/mailman/listinfo/scons-users


More information about the Scons-users mailing list