]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/tools/build/test/project_root_constants.py
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / tools / build / test / project_root_constants.py
CommitLineData
7c673cae
FG
1#!/usr/bin/python
2
3# Copyright 2003, 2004, 2005 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
8import BoostBuild
9
10# Create a temporary working directory.
11t = BoostBuild.Tester()
12
13# Create the needed files.
14t.write("jamroot.jam", """\
15constant FOO : foobar gee ;
16ECHO $(FOO) ;
17""")
18
19t.run_build_system()
20t.expect_output_lines("foobar gee")
21
22# Regression test: when absolute paths were passed to path-constant rule,
f67539c2 23# B2 failed to recognize path as absolute and prepended the current
7c673cae
FG
24# dir.
25t.write("jamroot.jam", """\
26import path ;
27local here = [ path.native [ path.pwd ] ] ;
28path-constant HERE : $(here) ;
29if $(HERE) != $(here)
30{
31 ECHO "PWD =" $(here) ;
32 ECHO "path constant =" $(HERE) ;
33 EXIT ;
34}
35""")
36t.write("jamfile.jam", "")
37
38t.run_build_system()
39
40t.write("jamfile.jam", """\
41# This tests that rule 'hello' will be imported to children unlocalized, and
42# will still access variables in this Jamfile.
43x = 10 ;
44constant FOO : foo ;
45rule hello ( ) { ECHO "Hello $(x)" ; }
46""")
47
48t.write("d/jamfile.jam", """\
49ECHO "d: $(FOO)" ;
50constant BAR : bar ;
51""")
52
53t.write("d/d2/jamfile.jam", """\
54ECHO "d2: $(FOO)" ;
55ECHO "d2: $(BAR)" ;
56hello ;
57""")
58
59t.run_build_system(subdir="d/d2")
60t.expect_output_lines("d: foo\nd2: foo\nd2: bar\nHello 10")
61
62t.cleanup()