summaryrefslogtreecommitdiff
path: root/tools/build/v2/test/engine/parallel_actions.jam
blob: adcd1ad85561314260b5fbb6365ca52fd2c83f7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#~ 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)

if ! $(BJAM_SUBTEST)
{
    ECHO --- Testing -jN parallel execution of actions... ;

    assert "...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...
" : (==) : [ SHELL "\"$(ARGV[1])\" -f parallel_actions.jam -sBJAM_SUBTEST=1 -j4" ] ;
}
else
{
    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 ;
}