Boost logo

Boost-Build :

From: David Abrahams (dave_at_[hidden])
Date: 2006-09-28 18:37:28

"Eric Niebler" <eric_at_[hidden]> writes:

> Rene Rivera wrote:
>> Eric Niebler wrote:
>>> I'm writing a Jamfile.v2 for some tests. I have two test suites, like:
>>> import testing ;
>>> {
>>> test-suite blah : [ run stuff.cpp ] ;
>>> }
>>> {
>>> test-suite blah-ext : [ run experimental.cpp ] ;
>>> }
>>> Now, I'd like only the blah test suite to run by default, and I want
>>> blah-ext to run only if I explicitly request it. The BBv2 docs led me to
>>> believe "explicit" would help me, and I believed it! Sadly, it seems not
>>> to be the case. Regardless of where I put the "explicit blah-ext ;"
>>> line, the blah-ext test suite always runs, whether I ask for it or not.
>>> What have I overlooked?
>> Looking up the testing.jam code... "test-suite" isn't a target.

Rene means to say that the first argument to the test-suite rule
doesn't become the name of a target.

> So, test-suite is not a target, and explicit only works on targets.
> Fine. But what makes test-suite not a target? How can I tell based on
> the syntax of:
> test-suite blah : [ blarg.cpp ] ;
> that test-suite is not a target? Syntactically, it looks a lot like
> things which are targets, right?

No, that looks like a rule invocation (a.k.a. function call). Whether
a rule invocation creates a target or not, and what that target is
called, is totally up to the implementation of the rule.

> Why are they (targets, aliases for targets) syntactically identical
> if they don't behave alike?
> Again, sorry if that's a stupid question.

Not stupid at all; systems like make would lead you to believe that
was a target declaration. bjam doesn't syntactically distinguish
target declaration from other activities.

Dave Abrahams
Boost Consulting

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at