|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r75834 - in trunk/tools/build/v2/test: . engine
From: steven_at_[hidden]
Date: 2011-12-06 21:43:31
Author: steven_watanabe
Date: 2011-12-06 21:43:29 EST (Tue, 06 Dec 2011)
New Revision: 75834
URL: http://svn.boost.org/trac/boost/changeset/75834
Log:
Integrate the tests in test/engine/ into the Python test scripts.
Added:
trunk/tools/build/v2/test/core_action_status.py (contents, props changed)
trunk/tools/build/v2/test/core_actions_quietly.py (contents, props changed)
trunk/tools/build/v2/test/core_option_d2.py (contents, props changed)
trunk/tools/build/v2/test/core_option_l.py (contents, props changed)
trunk/tools/build/v2/test/core_option_n.py (contents, props changed)
trunk/tools/build/v2/test/core_parallel_actions.py (contents, props changed)
trunk/tools/build/v2/test/core_parallel_multifile_actions_1.py (contents, props changed)
trunk/tools/build/v2/test/core_parallel_multifile_actions_2.py (contents, props changed)
Removed:
trunk/tools/build/v2/test/engine/
Text files modified:
trunk/tools/build/v2/test/BoostBuild.py | 4
trunk/tools/build/v2/test/core_language.jam | 141 ++++++++++++++++++++++++++++++++++++++-
trunk/tools/build/v2/test/test_all.py | 8 ++
3 files changed, 145 insertions(+), 8 deletions(-)
Modified: trunk/tools/build/v2/test/BoostBuild.py
==============================================================================
--- trunk/tools/build/v2/test/BoostBuild.py (original)
+++ trunk/tools/build/v2/test/BoostBuild.py 2011-12-06 21:43:29 EST (Tue, 06 Dec 2011)
@@ -206,7 +206,7 @@
def __init__(self, arguments="", executable="bjam",
match=TestCmd.match_exact, boost_build_path=None,
translate_suffixes=True, pass_toolset=True, use_test_config=True,
- ignore_toolset_requirements=True, workdir="", **keywords):
+ ignore_toolset_requirements=True, workdir="", pass_d0=True, **keywords):
self.original_workdir = os.getcwd()
if workdir != '' and not os.path.isabs(workdir):
@@ -273,6 +273,8 @@
sys.exit(1)
verbosity = ['-d0', '--quiet']
+ if not pass_d0:
+ verbosity = []
if '--verbose' in sys.argv:
keywords['verbose'] = True
verbosity = ['-d+2']
Added: trunk/tools/build/v2/test/core_action_status.py
==============================================================================
--- (empty file)
+++ trunk/tools/build/v2/test/core_action_status.py 2011-12-06 21:43:29 EST (Tue, 06 Dec 2011)
@@ -0,0 +1,27 @@
+#!/usr/bin/python
+
+# Copyright 2007 Rene Rivera.
+# Copyright 2011 Steven Watanabe
+# 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)
+
+import BoostBuild
+
+t = BoostBuild.Tester(pass_toolset=0)
+
+t.write("file.jam", """
+ actions quietly .a. { $(ACTION) }
+
+ rule .a.
+ {
+ DEPENDS $(<) : $(>) ;
+ }
+
+ NOTFILE subtest ;
+ .a. subtest_a : subtest ;
+ DEPENDS all : subtest_a ;
+""")
+
+t.run_build_system("-ffile.jam -sACTION=invalid", status=1)
+
+t.cleanup()
Added: trunk/tools/build/v2/test/core_actions_quietly.py
==============================================================================
--- (empty file)
+++ trunk/tools/build/v2/test/core_actions_quietly.py 2011-12-06 21:43:29 EST (Tue, 06 Dec 2011)
@@ -0,0 +1,59 @@
+#!/usr/bin/python
+
+# Copyright 2007 Rene Rivera.
+# Copyright 2011 Steven Watanabe
+# 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)
+
+import BoostBuild
+
+t = BoostBuild.Tester(pass_toolset=0)
+
+t.write("file.jam", """
+ actions quietly .a.
+ {
+echo [$(<:B)] 0
+echo [$(<:B)] 1
+echo [$(<:B)] 2
+ }
+
+ rule .a.
+ {
+ DEPENDS $(<) : $(>) ;
+ }
+
+ NOTFILE subtest ;
+ .a. subtest_a : subtest ;
+ .a. subtest_b : subtest ;
+ DEPENDS all : subtest_a subtest_b ;
+""")
+
+t.run_build_system("-ffile.jam -d2", stdout="""...found 4 targets...
+...updating 2 targets...
+.a. subtest_a
+
+echo [subtest_a] 0
+echo [subtest_a] 1
+echo [subtest_a] 2
+
+[subtest_a] 0
+[subtest_a] 1
+[subtest_a] 2
+.a. subtest_b
+
+echo [subtest_b] 0
+echo [subtest_b] 1
+echo [subtest_b] 2
+
+[subtest_b] 0
+[subtest_b] 1
+[subtest_b] 2
+...updated 2 targets...
+""")
+
+t.run_build_system("-ffile.jam -d1", stdout="""...found 4 targets...
+...updating 2 targets...
+...updated 2 targets...
+""")
+
+t.cleanup()
Modified: trunk/tools/build/v2/test/core_language.jam
==============================================================================
--- trunk/tools/build/v2/test/core_language.jam (original)
+++ trunk/tools/build/v2/test/core_language.jam 2011-12-06 21:43:29 EST (Tue, 06 Dec 2011)
@@ -9,7 +9,10 @@
rule show-result ( id : test-result )
{
- ECHO $(test-result): $(id) ;
+ if ! ( --quiet in $(ARGV) )
+ {
+ ECHO $(test-result): $(id) ;
+ }
$(test-result) = [ CALC $($(test-result)) + 1 ] ;
}
@@ -57,6 +60,9 @@
local case1 = L U ;
local vars = 7 8 ;
local sub = 2 1 ;
+local p0 = name ;
+local p1 = dir/name ;
+local p2 = dir/sub/name ;
check-equal var-product : $(v1)$(v2) : 14 15 16 24 25 26 34 35 36 ;
@@ -74,6 +80,16 @@
check-equal var-member : $(v6:M) : (member.txt) ;
check-equal var-multi : $(v6:$(select1)) : <GRIST> path generic/path.txt ;
+check-equal var-D=-0 : name : $(p0:D=) ;
+check-equal var-D=-1 : name : $(p1:D=) ;
+check-equal var-D=-2 : name : $(p2:D=) ;
+check-equal var-D-0 : "" : $(p0:D) ;
+check-equal var-D-1 : dir : $(p1:D) ;
+check-equal var-D-2 : dir/sub : $(p2:D) ;
+check-equal var-S-1 : "" : $(p0:S) ;
+check-equal var-no-at-file-0 : ($(p0)) : [ MATCH ^@(.*) : "@($(p0))" ] ;
+check-equal var-no-at-file-1 : ($(p0)) : [ MATCH @(.*) : "--@($(p0))" ] ;
+
if $(OS) = CYGWIN
{
local cyg-root = $(:WE=/) ;
@@ -158,22 +174,35 @@
rule test-rule
{
- return $(<) $(>) $(1) $(2) $(3) $(4) $(5) $(6) $(7) $(8) $(9) $(10) $(11) $(12) $(13) $(14) $(15) $(16) $(17) $(18) $(19) ;
+ return $(<) - $(>) - $(1) - $(2) - $(3) - $(4) - $(5) - $(6) - $(7) - $(8) - $(9) - $(10) - $(11) - $(12) - $(13) - $(14) - $(15) - $(16) - $(17) - $(18) - $(19) ;
}
-check-equal rule-arguments :
+check-equal rule-arguments-numbered :
[ test-rule a1 : a2 : a3 : a4 : a5 : a6 : a7 : a8 : a9 : a10 : a11 : a12 : a13 : a14 : a15 : a16 : a17 : a18 : a19 ] :
- a1 a2 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 ;
+ a1 - a2 - a1 - a2 - a3 - a4 - a5 - a6 - a7 - a8 - a9 - a10 - a11 - a12 - a13 - a14 - a15 - a16 - a17 - a18 - a19 ;
rule test-rule
{
- return $(<:L) $(>:L) $(1:L) $(2:L) $(3:L) $(4:L) $(5:L) $(6:L) $(7:L) $(8:L) $(9:L) $(10:L) $(11:L) $(12:L) $(13:L) $(14:L) $(15:L) $(16:L) $(17:L) $(18:L) $(19:L) ;
+ return $(<:L) - $(>:L) - $(1:L) - $(2:L) - $(3:L) - $(4:L) - $(5:L) - $(6:L) - $(7:L) - $(8:L) - $(9:L) - $(10:L) - $(11:L) - $(12:L) - $(13:L) - $(14:L) - $(15:L) - $(16:L) - $(17:L) - $(18:L) - $(19:L) ;
}
# behavior change
-check-equal rule-arguments :
+check-equal rule-arguments-numbered-lower :
+ [ test-rule a1 : a2 : a3 : a4 : a5 : a6 : a7 : a8 : a9 : a10 : a11 : a12 : a13 : a14 : a15 : a16 : a17 : a18 : a19 ] :
+ a1 - a2 - a1 - a2 - a3 - a4 - a5 - a6 - a7 - a8 - a9 - a10 - a11 - a12 - a13 - a14 - a15 - a16 - a17 - a18 - a19 ;
+
+
+rule test-rule ( p1 : p2 : p3 : p4 : p5 : p6 : p7 : p8 : p9 :
+ p10 : p11 : p12 : p13 : p14 : p15 : p16 : p17 : p18 : p19 )
+
+
+{
+ return $(p1) - $(p2) - $(p3) - $(p4) - $(p5) - $(p6) - $(p7) - $(p8) - $(p9) - $(p10) - $(p11) - $(p12) - $(p13) - $(p14) - $(p15) - $(p16) - $(p17) - $(p18) - $(p19) ;
+}
+
+check-equal rule-arguments-named :
[ test-rule a1 : a2 : a3 : a4 : a5 : a6 : a7 : a8 : a9 : a10 : a11 : a12 : a13 : a14 : a15 : a16 : a17 : a18 : a19 ] :
- a1 a2 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 ;
+ a1 - a2 - a3 - a4 - a5 - a6 - a7 - a8 - a9 - a10 - a11 - a12 - a13 - a14 - a15 - a16 - a17 - a18 - a19 ;
}
@@ -1017,6 +1046,104 @@
}
+# Test NORMALIZE_PATH
+
+{
+check-equal normalize-path : "." : [ NORMALIZE_PATH ] ;
+check-equal normalize-path : "." : [ NORMALIZE_PATH "" ] ;
+check-equal normalize-path : "." : [ NORMALIZE_PATH "." ] ;
+check-equal normalize-path : ".." : [ NORMALIZE_PATH ".." ] ;
+check-equal normalize-path : "/" : [ NORMALIZE_PATH "/" ] ;
+check-equal normalize-path : "/" : [ NORMALIZE_PATH "\\" ] ;
+check-equal normalize-path : "/" : [ NORMALIZE_PATH "//" ] ;
+check-equal normalize-path : "/" : [ NORMALIZE_PATH "\\\\" ] ;
+check-equal normalize-path : "/" : [ NORMALIZE_PATH "//\\\\//\\\\" ] ;
+check-equal normalize-path : "/" : [ NORMALIZE_PATH "/." ] ;
+check-equal normalize-path : "/" : [ NORMALIZE_PATH "/./" ] ;
+check-equal normalize-path : "/" : [ NORMALIZE_PATH "\\\\///.///\\\\\\" ] ;
+check-equal normalize-path : "." : [ NORMALIZE_PATH "./././././." ] ;
+check-equal normalize-path : "/" : [ NORMALIZE_PATH "/./././././." ] ;
+check-equal normalize-path : "foo" : [ NORMALIZE_PATH "foo" ] ;
+check-equal normalize-path : "foo" : [ NORMALIZE_PATH "foo/" ] ;
+check-equal normalize-path : "foo" : [ NORMALIZE_PATH "foo\\" ] ;
+check-equal normalize-path : "foo" : [ NORMALIZE_PATH "foo\\\\/////" ] ;
+check-equal normalize-path : "foo" : [ NORMALIZE_PATH "foo\\\\/////././." ] ;
+check-equal normalize-path : "foo" : [ NORMALIZE_PATH "foo\\\\/////./././" ] ;
+check-equal normalize-path : "." : [ NORMALIZE_PATH "foo/.." ] ;
+check-equal normalize-path : "." : [ NORMALIZE_PATH "foo////.." ] ;
+check-equal normalize-path : "/" : [ NORMALIZE_PATH "///foo/\\\\/.." ] ;
+check-equal normalize-path : "/" : [ NORMALIZE_PATH "\\\\\\foo\\//\\.." ] ;
+check-equal normalize-path : "." : [ NORMALIZE_PATH "foo/./.." ] ;
+check-equal normalize-path : "." : [ NORMALIZE_PATH "foo/././././.." ] ;
+check-equal normalize-path : "foo" : [ NORMALIZE_PATH "foo/./././bar/./././.././././baz/./././.." ] ;
+check-equal normalize-path : "/foo" : [ NORMALIZE_PATH "/foo/./././bar/./././.././././baz/./././.." ] ;
+check-equal normalize-path : "foo" : [ NORMALIZE_PATH "foo/./././bar/./././////.././././baz/./././.." ] ;
+check-equal normalize-path : "/foo" : [ NORMALIZE_PATH "/foo/./././bar/./././////.././././baz/./././.." ] ;
+check-equal normalize-path : ".." : [ NORMALIZE_PATH "./.." ] ;
+check-equal normalize-path : ".." : [ NORMALIZE_PATH "././././.." ] ;
+check-equal normalize-path : "../.." : [ NORMALIZE_PATH "../.." ] ;
+check-equal normalize-path : "../.." : [ NORMALIZE_PATH "./../.." ] ;
+check-equal normalize-path : "../.." : [ NORMALIZE_PATH "././././../.." ] ;
+check-equal normalize-path : "../.." : [ NORMALIZE_PATH "./.././././.." ] ;
+check-equal normalize-path : "../.." : [ NORMALIZE_PATH "././././.././././.." ] ;
+check-equal normalize-path : "../.." : [ NORMALIZE_PATH "..//\\\\\\//.." ] ;
+check-equal normalize-path : "../.." : [ NORMALIZE_PATH "../..\\\\/\\\\" ] ;
+check-equal normalize-path : "." : [ NORMALIZE_PATH "foo/../bar/../baz/.." ] ;
+check-equal normalize-path : "." : [ NORMALIZE_PATH "foo////..////bar////.//////.////../baz/.." ] ;
+check-equal normalize-path : "/" : [ NORMALIZE_PATH "/foo/../bar/../baz/.." ] ;
+check-equal normalize-path : "/" : [ NORMALIZE_PATH "/foo////..////bar////.//////.////../baz/.." ] ;
+
+# Invalid rooted paths with leading dotdots.
+check-equal normalize-path-invalid : : [ NORMALIZE_PATH "/.." ] ;
+check-equal normalize-path-invalid : : [ NORMALIZE_PATH "/../" ] ;
+check-equal normalize-path-invalid : : [ NORMALIZE_PATH "//\\\\//\\\\/.." ] ;
+check-equal normalize-path-invalid : : [ NORMALIZE_PATH "\\\\//\\\\//\\.." ] ;
+check-equal normalize-path-invalid : : [ NORMALIZE_PATH "/../.." ] ;
+check-equal normalize-path-invalid : : [ NORMALIZE_PATH "/../../.." ] ;
+check-equal normalize-path-invalid : : [ NORMALIZE_PATH "/foo/bar/../baz/../../.." ] ;
+check-equal normalize-path-invalid : : [ NORMALIZE_PATH "/../for/././../././bar/././../././.." ] ;
+check-equal normalize-path-invalid : : [ NORMALIZE_PATH "/../foo/bar" ] ;
+
+}
+
+# Test W32_GETREGNAMES
+
+{
+
+if $(NT)
+{
+ local sound = "Beep" "ExtendedSounds" ;
+ local r1 = [ W32_GETREGNAMES "HKEY_CURRENT_USER\\Control Panel\\Sound" : values ] ;
+ check-equal w32_getregnames : $(sound:L) : $(r1:L) ;
+ local r2 = [ W32_GETREGNAMES "HKCU\\Control Panel\\Sound" : values ] ;
+ check-equal w32_getregnames : $(sound:L) : $(r2:L) ;
+
+ local CurrentControlSet = "Control" "Enum" "Hardware Profiles" "Services" ;
+ local r3 = [ W32_GETREGNAMES "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet" : subkeys ] ;
+ check-equal w32_getregnames : $(CurrentControlSet:L) : $(r3:L) ;
+ local r4 = [ W32_GETREGNAMES "HKLM\\SYSTEM\\CurrentControlSet" : subkeys ] ;
+ check-equal w32_getregnames : $(CurrentControlSet:L) : $(r4:L) ;
+}
+
+}
+
+# Test SHELL
+
+{
+
+local c = "echo value" ;
+
+check-equal shell : "value\n" : [ SHELL $(c) ] ;
+check-equal shell : "" : [ SHELL $(c) : no-output ] ;
+check-equal shell : "value\n" 0 : [ SHELL $(c) : exit-status ] ;
+check-equal shell : "" 0 : [ SHELL $(c) : no-output : exit-status ] ;
+check-equal command : "value\n" : [ COMMAND $(c) ] ;
+check-equal command : "" : [ COMMAND $(c) : no-output ] ;
+check-equal command : "value\n" 0 : [ COMMAND $(c) : exit-status ] ;
+check-equal command : "" 0 : [ COMMAND $(c) : no-output : exit-status ] ;
+
+}
+
# Test summary
if $(failed) = 0
Added: trunk/tools/build/v2/test/core_option_d2.py
==============================================================================
--- (empty file)
+++ trunk/tools/build/v2/test/core_option_d2.py 2011-12-06 21:43:29 EST (Tue, 06 Dec 2011)
@@ -0,0 +1,59 @@
+#!/usr/bin/python
+
+# Copyright 2007 Rene Rivera.
+# Copyright 2011 Steven Watanabe
+# 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)
+
+import BoostBuild
+
+t = BoostBuild.Tester(pass_toolset=0, pass_d0=False)
+
+t.write("sleep.bat","""@setlocal
+@echo off
+timeout /T %1 /NOBREAK >nul
+""")
+
+t.write("file.jam", """
+ actions .a.
+ {
+echo [$(<:B)] 0
+echo [$(<:B)] 1
+echo [$(<:B)] 2
+ }
+
+ rule .a.
+ {
+ DEPENDS $(<) : $(>) ;
+ }
+
+ NOTFILE subtest ;
+ .a. subtest_a : subtest ;
+ .a. subtest_b : subtest ;
+ DEPENDS all : subtest_a subtest_b ;
+""")
+
+t.run_build_system("-ffile.jam -d2", stdout="""...found 4 targets...
+...updating 2 targets...
+.a. subtest_a
+
+echo [subtest_a] 0
+echo [subtest_a] 1
+echo [subtest_a] 2
+
+[subtest_a] 0
+[subtest_a] 1
+[subtest_a] 2
+.a. subtest_b
+
+echo [subtest_b] 0
+echo [subtest_b] 1
+echo [subtest_b] 2
+
+[subtest_b] 0
+[subtest_b] 1
+[subtest_b] 2
+...updated 2 targets...
+""")
+
+t.cleanup()
Added: trunk/tools/build/v2/test/core_option_l.py
==============================================================================
--- (empty file)
+++ trunk/tools/build/v2/test/core_option_l.py 2011-12-06 21:43:29 EST (Tue, 06 Dec 2011)
@@ -0,0 +1,44 @@
+#!/usr/bin/python
+
+# Copyright 2007 Rene Rivera.
+# Copyright 2011 Steven Watanabe
+# 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)
+
+import BoostBuild
+
+t = BoostBuild.Tester(pass_toolset=0)
+
+t.write("sleep.bat","""@setlocal
+@echo off
+timeout /T %1 /NOBREAK >nul
+""")
+
+t.write("file.jam", """
+
+actions .a. {
+echo 001
+sleep 4
+echo 002
+}
+
+.a. sleeper ;
+
+DEPENDS all : sleeper ;
+""")
+
+t.run_build_system("-ffile.jam -d1 -l2", status=1, stdout="""...found 2 targets...
+...updating 1 target...
+.a. sleeper
+2 second time limit exceeded
+001
+
+echo 001
+sleep 4
+echo 002
+
+...failed .a. sleeper...
+...failed updating 1 target...
+""")
+
+t.cleanup()
Added: trunk/tools/build/v2/test/core_option_n.py
==============================================================================
--- (empty file)
+++ trunk/tools/build/v2/test/core_option_n.py 2011-12-06 21:43:29 EST (Tue, 06 Dec 2011)
@@ -0,0 +1,48 @@
+#!/usr/bin/python
+
+# Copyright 2007 Rene Rivera.
+# Copyright 2011 Steven Watanabe
+# 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)
+
+import BoostBuild
+
+t = BoostBuild.Tester(pass_toolset=0, pass_d0=False)
+
+t.write("file.jam", """
+ actions .a.
+ {
+echo [$(<:B)] 0
+echo [$(<:B)] 1
+echo [$(<:B)] 2
+ }
+
+ rule .a.
+ {
+ DEPENDS $(<) : $(>) ;
+ }
+
+ NOTFILE subtest ;
+ .a. subtest_a : subtest ;
+ .a. subtest_b : subtest ;
+ DEPENDS all : subtest_a subtest_b ;
+""")
+
+t.run_build_system("-ffile.jam -n", stdout="""...found 4 targets...
+...updating 2 targets...
+.a. subtest_a
+
+echo [subtest_a] 0
+echo [subtest_a] 1
+echo [subtest_a] 2
+
+.a. subtest_b
+
+echo [subtest_b] 0
+echo [subtest_b] 1
+echo [subtest_b] 2
+
+...updated 2 targets...
+""")
+
+t.cleanup()
Added: trunk/tools/build/v2/test/core_parallel_actions.py
==============================================================================
--- (empty file)
+++ trunk/tools/build/v2/test/core_parallel_actions.py 2011-12-06 21:43:29 EST (Tue, 06 Dec 2011)
@@ -0,0 +1,100 @@
+#!/usr/bin/python
+
+# Copyright 2006 Rene Rivera.
+# Copyright 2011 Steven Watanabe
+# 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)
+
+import BoostBuild
+
+t = BoostBuild.Tester(pass_toolset=0, pass_d0=False)
+
+t.write("sleep.bat","""@setlocal
+@echo off
+timeout /T %1 /NOBREAK >nul
+""")
+
+t.write("file.jam", """
+ if $(NT)
+ {
+ actions sleeper
+ {
+echo [$(<:S)] 0
+sleep 1
+echo [$(<:S)] 1
+sleep 1
+echo [$(<:S)] 2
+sleep $(<:B)
+ }
+ }
+ else
+ {
+ actions sleeper
+ {
+echo "[$(<:S)] 0" 1>&2
+sleep 1
+echo "[$(<:S)] 1"
+sleep 1
+echo "[$(<:S)] 2" 1>&2
+sleep $(<:B)
+ }
+ }
+
+ rule sleeper
+ {
+ DEPENDS $(<) : $(>) ;
+ }
+
+ NOTFILE front ;
+ sleeper 1.a : front ;
+ sleeper 2.a : front ;
+ sleeper 3.a : front ;
+ sleeper 4.a : front ;
+ NOTFILE choke ;
+ DEPENDS choke : 1.a 2.a 3.a 4.a ;
+ sleeper 1.b : choke ;
+ sleeper 2.b : choke ;
+ sleeper 3.b : choke ;
+ sleeper 4.b : choke ;
+ DEPENDS bottom : 1.b 2.b 3.b 4.b ;
+ DEPENDS all : bottom ;
+""")
+
+t.run_build_system("-ffile.jam -j4", stdout="""...found 12 targets...
+...updating 8 targets...
+sleeper 1.a
+[.a] 0
+[.a] 1
+[.a] 2
+sleeper 2.a
+[.a] 0
+[.a] 1
+[.a] 2
+sleeper 3.a
+[.a] 0
+[.a] 1
+[.a] 2
+sleeper 4.a
+[.a] 0
+[.a] 1
+[.a] 2
+sleeper 1.b
+[.b] 0
+[.b] 1
+[.b] 2
+sleeper 2.b
+[.b] 0
+[.b] 1
+[.b] 2
+sleeper 3.b
+[.b] 0
+[.b] 1
+[.b] 2
+sleeper 4.b
+[.b] 0
+[.b] 1
+[.b] 2
+...updated 8 targets...
+""")
+
+t.cleanup()
Added: trunk/tools/build/v2/test/core_parallel_multifile_actions_1.py
==============================================================================
--- (empty file)
+++ trunk/tools/build/v2/test/core_parallel_multifile_actions_1.py 2011-12-06 21:43:29 EST (Tue, 06 Dec 2011)
@@ -0,0 +1,54 @@
+#!/usr/bin/python
+
+# Copyright 2007 Rene Rivera.
+# Copyright 2011 Steven Watanabe
+# 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)
+
+import BoostBuild
+
+t = BoostBuild.Tester(pass_toolset=0, pass_d0=False)
+
+t.write("sleep.bat","""@setlocal
+@echo off
+timeout /T %1 /NOBREAK >nul
+""")
+
+t.write("file.jam", """
+ actions .gen. {
+echo 001
+sleep 4
+echo 002
+}
+ rule .use.1 { DEPENDS $(<) : $(>) ; }
+ actions .use.1 {
+echo 003
+}
+ rule .use.2 { DEPENDS $(<) : $(>) ; }
+ actions .use.2 {
+sleep 1
+echo 004
+}
+
+ .gen. g1.generated g2.generated ;
+ .use.1 u1.user : g1.generated ;
+ .use.2 u2.user : g2.generated ;
+
+ NOTFILE root ;
+ DEPENDS g1.generated g2.generated : root ;
+ DEPENDS all : u1.user u2.user ;
+""")
+
+t.run_build_system("-ffile.jam -j2", stdout="""...found 6 targets...
+...updating 4 targets...
+.gen. g1.generated
+001
+002
+.use.1 u1.user
+003
+.use.2 u2.user
+004
+...updated 4 targets...
+""")
+
+t.cleanup()
Added: trunk/tools/build/v2/test/core_parallel_multifile_actions_2.py
==============================================================================
--- (empty file)
+++ trunk/tools/build/v2/test/core_parallel_multifile_actions_2.py 2011-12-06 21:43:29 EST (Tue, 06 Dec 2011)
@@ -0,0 +1,58 @@
+#!/usr/bin/python
+
+# Copyright 2008 Jurko Gospodnetic, Vladimir Prus
+# Copyright 2011 Steven Watanabe
+# 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)
+
+# Added to guard against a bug causing targets to be used before they
+# themselves have finished building. This used to happen for targets built by a
+# multi-file action that got triggered by another target, except when the target
+# triggering the action was the first one in the list of targets produced by
+# that action.
+#
+# Example:
+# When target A and target B were declared as created by a single action with
+# A being the first one listed, and target B triggered running that action then
+# while the action was still running, target A was already reporting as being
+# built causing other targets depending on target A to be built prematurely.
+
+import BoostBuild
+
+t = BoostBuild.Tester(pass_toolset=0, pass_d0=False)
+
+t.write("sleep.bat","""@setlocal
+@echo off
+timeout /T %1 /NOBREAK >nul
+""")
+
+t.write("file.jam", """
+ actions link
+ {
+ sleep 1
+ echo 001 - linked
+ }
+
+ link dll lib ;
+
+ actions install
+ {
+ echo 002 - installed
+ }
+
+ install installed_dll : dll ;
+ DEPENDS installed_dll : dll ;
+
+ DEPENDS all : lib installed_dll ;
+""")
+
+t.run_build_system("-ffile.jam -j2", stdout="""...found 4 targets...
+...updating 3 targets...
+link dll
+001 - linked
+install installed_dll
+002 - installed
+...updated 3 targets...
+""")
+
+t.cleanup()
Modified: trunk/tools/build/v2/test/test_all.py
==============================================================================
--- trunk/tools/build/v2/test/test_all.py (original)
+++ trunk/tools/build/v2/test/test_all.py 2011-12-06 21:43:29 EST (Tue, 06 Dec 2011)
@@ -140,6 +140,14 @@
"conditionals_multiple",
"configuration",
"copy_time",
+ "core_action_status",
+ "core_actions_quietly",
+ "core_option_d2",
+ "core_option_l",
+ "core_option_n",
+ "core_parallel_actions",
+ "core_parallel_multifile_actions_1",
+ "core_parallel_multifile_actions_2",
"custom_generator",
"default_build",
"default_features",
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk