]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/source_order.py
3 # Copyright 2013 Steven Watanabe
4 # Distributed under the Boost Software License, Version 1.0.
5 # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
7 # Tests that action sources are not reordered
11 t
= BoostBuild
.Tester()
13 t
.write("check-order.jam", """\
17 type.register ORDER_TEST : order-test ;
23 echo$(SPACE)$(>[1])>$(<[1])
24 echo$(SPACE)$(>[2-])>>$(<[1])$(nl)
27 generators.register-composing check-order.check-order : C : ORDER_TEST ;
35 from b2.build import type as type_, generators
36 from b2.tools import common
37 from b2.manager import get_manager
39 MANAGER = get_manager()
40 ENGINE = MANAGER.engine()
42 type_.register('ORDER_TEST', ['order-test'])
44 generators.register_composing('check-order.check-order', ['C'], ['ORDER_TEST'])
46 def check_order(targets, sources, properties):
47 ENGINE.set_target_variable(targets, 'SPACE', ' ')
48 ENGINE.set_target_variable(targets, 'nl', '\\n')
50 ENGINE.register_action(
51 'check-order.check-order',
54 echo$(SPACE)$(>[1])>$(<[1])
55 echo$(SPACE)$(>[2-])>>$(<[1])$(nl)
61 # The aliases are necessary for this test, since
62 # the targets were sorted by virtual target
63 # id, not by file name.
64 t
.write("jamroot.jam", """\
66 alias file1 : file1.c ;
67 alias file2 : file2.c ;
68 alias file3 : file3.c ;
69 order-test check : file2 file1 file3 ;
72 t
.write("file1.c", "")
73 t
.write("file2.c", "")
74 t
.write("file3.c", "")
77 t
.expect_addition("bin/$toolset/debug/check.order-test")
78 t
.expect_content("bin/$toolset/debug/check.order-test", """\