]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/tools/build/test/load_order.py
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / tools / build / test / load_order.py
CommitLineData
7c673cae
FG
1#!/usr/bin/python
2
3# Copyright 2004 Vladimir Prus.
4# Distributed under the Boost Software License, Version 1.0.
1e59de90
TL
5# (See accompanying file LICENSE.txt or copy at
6# https://www.bfgroup.xyz/b2/LICENSE.txt)
7c673cae
FG
7
8# Test that we load parent projects before loading children.
9
10import BoostBuild
11
12t = BoostBuild.Tester(use_test_config=False)
13
14t.write("jamroot.jam", """\
15use-project /child : child ;
16ECHO "Setting parent requirements" ;
17project : requirements <define>PASS_THE_TEST ;
18alias x : child//main ;
19""")
20
21t.write("child/jamfile.jam", """\
22ECHO "Setting child requirements" ;
23project /child ;
24exe main : main.cpp ;
25""")
26
27t.write("child/main.cpp", """\
28#if defined(PASS_THE_TEST)
29int main() {}
30#endif
31""")
32
33t.run_build_system()
34
b32b8144 35t.expect_addition("child/bin/$toolset/debug*/main.exe")
7c673cae
FG
36t.fail_test(t.stdout().find("Setting child requirements") < t.stdout().find(
37 "Setting parent requirements"))
38
39
40# Regression test: parent requirements were ignored in some cases.
41t.rm(".")
42t.write("jamroot.jam", "build-project src ;")
43t.write("src/jamfile.jam", "project : requirements <define>EVERYTHING_OK ;")
44t.write("src/app/jamfile.jam", "exe test : test.cpp ;")
45t.write("src/app/test.cpp", """\
46#ifdef EVERYTHING_OK
47int main() {}
48#endif
49""")
50
51t.run_build_system(subdir="src/app")
b32b8144 52t.expect_addition("src/app/bin/$toolset/debug*/test.exe")
7c673cae
FG
53
54
55# child/child2 used to be loaded before child
56t.rm(".")
57t.write("jamroot.jam", """\
58use-project /child/child2 : child/child2 ;
59rule parent-rule ( )
60{
61 ECHO "Running parent-rule" ;
62}
63""")
64t.write("child/jamfile.jam", "")
65t.write("child/child1/jamfile.jam", "")
66t.write("child/child2/jamfile.jam", "parent-rule ;")
67
68t.run_build_system(subdir="child/child1")
69t.expect_output_lines("Running parent-rule")
70
71t.cleanup()