mirror of
https://github.com/boostorg/build.git
synced 2026-02-14 00:32:11 +00:00
Internal Boost Build module_actions.py test cleanup - no longer depends on externally prepared data, minor stylistic changes.
[SVN r80089]
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
# Copyright 2003 Dave Abrahams
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
boost-build . ;
|
||||
@@ -1,61 +0,0 @@
|
||||
# Copyright 2003 Dave Abrahams
|
||||
# Copyright 2006 Rene Rivera
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
# Demonstration that module variables have the right effect in actions.
|
||||
|
||||
|
||||
# Top-level rule that causes a target to be built by invoking the specified
|
||||
# action.
|
||||
rule make ( target : sources * : act )
|
||||
{
|
||||
DEPENDS all : $(target) ;
|
||||
DEPENDS $(target) : $(sources) ;
|
||||
$(act) $(target) : $(sources) ;
|
||||
}
|
||||
|
||||
|
||||
X1 = X1-global ;
|
||||
X2 = X2-global ;
|
||||
X3 = X3-global ;
|
||||
|
||||
module A
|
||||
{
|
||||
X1 = X1-A ;
|
||||
|
||||
rule act ( target )
|
||||
{
|
||||
NOTFILE $(target) ;
|
||||
ALWAYS $(target) ;
|
||||
}
|
||||
|
||||
actions act { echo A.act $(<): $(X1) $(X2) $(X3) }
|
||||
|
||||
make t1 : : A.act ;
|
||||
make t2 : : A.act ;
|
||||
make t3 : : A.act ;
|
||||
}
|
||||
|
||||
module B
|
||||
{
|
||||
X2 = X2-B ;
|
||||
|
||||
actions act { echo B.act $(<): $(X1) $(X2) $(X3) }
|
||||
|
||||
make t1 : : B.act ;
|
||||
make t2 : : B.act ;
|
||||
make t3 : : B.act ;
|
||||
}
|
||||
|
||||
actions act { echo act $(<): $(X1) $(X2) $(X3) }
|
||||
|
||||
make t1 : : act ;
|
||||
make t2 : : act ;
|
||||
make t3 : : act ;
|
||||
|
||||
X1 on t1 = X1-t1 ;
|
||||
X2 on t2 = X2-t2 ;
|
||||
X3 on t3 = X3-t3 ;
|
||||
|
||||
DEPENDS all : t1 t2 t3 ;
|
||||
@@ -4,7 +4,10 @@
|
||||
# Copyright 2006 Rene Rivera
|
||||
# Copyright 2003 Vladimir Prus
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
# Demonstration that module variables have the correct effect in actions.
|
||||
|
||||
import BoostBuild
|
||||
import os
|
||||
@@ -12,7 +15,60 @@ import re
|
||||
|
||||
t = BoostBuild.Tester(["-d+1"], pass_toolset=0)
|
||||
|
||||
t.set_tree('module-actions')
|
||||
t.write("boost-build.jam", "boost-build . ;")
|
||||
t.write("bootstrap.jam", """\
|
||||
# Top-level rule causing a target to be built by invoking the specified action.
|
||||
rule make ( target : sources * : act )
|
||||
{
|
||||
DEPENDS all : $(target) ;
|
||||
DEPENDS $(target) : $(sources) ;
|
||||
$(act) $(target) : $(sources) ;
|
||||
}
|
||||
|
||||
X1 = X1-global ;
|
||||
X2 = X2-global ;
|
||||
X3 = X3-global ;
|
||||
|
||||
module A
|
||||
{
|
||||
X1 = X1-A ;
|
||||
|
||||
rule act ( target )
|
||||
{
|
||||
NOTFILE $(target) ;
|
||||
ALWAYS $(target) ;
|
||||
}
|
||||
|
||||
actions act { echo A.act $(<): $(X1) $(X2) $(X3) }
|
||||
|
||||
make t1 : : A.act ;
|
||||
make t2 : : A.act ;
|
||||
make t3 : : A.act ;
|
||||
}
|
||||
|
||||
module B
|
||||
{
|
||||
X2 = X2-B ;
|
||||
|
||||
actions act { echo B.act $(<): $(X1) $(X2) $(X3) }
|
||||
|
||||
make t1 : : B.act ;
|
||||
make t2 : : B.act ;
|
||||
make t3 : : B.act ;
|
||||
}
|
||||
|
||||
actions act { echo act $(<): $(X1) $(X2) $(X3) }
|
||||
|
||||
make t1 : : act ;
|
||||
make t2 : : act ;
|
||||
make t3 : : act ;
|
||||
|
||||
X1 on t1 = X1-t1 ;
|
||||
X2 on t2 = X2-t2 ;
|
||||
X3 on t3 = X3-t3 ;
|
||||
|
||||
DEPENDS all : t1 t2 t3 ;
|
||||
""")
|
||||
|
||||
expected_lines = [
|
||||
"...found 4 targets...",
|
||||
|
||||
Reference in New Issue
Block a user