]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/core_parallel_multifile_actions_2.py
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / tools / build / test / core_parallel_multifile_actions_2.py
1 #!/usr/bin/python
2
3 # Copyright 2008 Jurko Gospodnetic, Vladimir Prus
4 # Copyright 2011 Steven Watanabe
5 # Distributed under the Boost Software License, Version 1.0.
6 # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
7
8 # Added to guard against a bug causing targets to be used before they
9 # themselves have finished building. This used to happen for targets built by a
10 # multi-file action that got triggered by another target, except when the
11 # target triggering the action was the first one in the list of targets
12 # produced by that action.
13 #
14 # Example:
15 # When target A and target B were declared as created by a single action with
16 # A being the first one listed, and target B triggered running that action
17 # then, while the action was still running, target A was already reporting as
18 # being built causing other targets depending on target A to be built
19 # prematurely.
20
21 import BoostBuild
22
23 t = BoostBuild.Tester(pass_toolset=0)
24
25 t.write("sleep.bat", """\
26 ::@timeout /T %1 /NOBREAK >nul
27 @ping 127.0.0.1 -n 2 -w 1000 >nul
28 @ping 127.0.0.1 -n %1 -w 1000 >nul
29 @exit /B 0
30 """)
31
32 t.write("file.jam", """\
33 if $(NT)
34 {
35 SLEEP = @call sleep.bat ;
36 }
37 else
38 {
39 SLEEP = sleep ;
40 }
41
42 actions link
43 {
44 $(SLEEP) 1
45 echo 001 - linked
46 }
47
48 link dll lib ;
49
50 actions install
51 {
52 echo 002 - installed
53 }
54
55 install installed_dll : dll ;
56 DEPENDS installed_dll : dll ;
57
58 DEPENDS all : lib installed_dll ;
59 """)
60
61 t.run_build_system(["-ffile.jam", "-j2"], stdout="""\
62 ...found 4 targets...
63 ...updating 3 targets...
64 link dll
65 001 - linked
66 install installed_dll
67 002 - installed
68 ...updated 3 targets...
69 """)
70
71 t.cleanup()