]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/absolute_sources.py
3 # Copyright 2003, 2004 Vladimir Prus
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 # Test that sources with absolute names are handled OK.
11 t
= BoostBuild
.Tester(use_test_config
=False)
13 t
.write("jamroot.jam", "path-constant TOP : . ;")
14 t
.write("jamfile.jam", """\
17 exe hello : $(pwd)/hello.cpp $(TOP)/empty.cpp ;
19 t
.write("hello.cpp", "int main() {}\n")
20 t
.write("empty.cpp", "\n")
23 t
.expect_addition("bin/$toolset/debug*/hello.exe")
26 # Test a contrived case in which an absolute name is used in a standalone
27 # project (not Jamfile). Moreover, the target with an absolute name is returned
28 # via an 'alias' and used from another project.
29 t
.write("a.cpp", "int main() {}\n")
30 t
.write("jamfile.jam", "exe a : /standalone//a ;")
31 t
.write("jamroot.jam", "import standalone ;")
32 t
.write("standalone.jam", """\
34 project.initialize $(__name__) ;
37 alias a : $(pwd)/a.cpp ;
40 t
.write("standalone.py", """
41 from b2.manager import get_manager
43 # FIXME: this is ugly as death
44 get_manager().projects().initialize(__name__)
48 # This use of list as parameter is also ugly.
49 project(['standalone'])
52 alias('a', [os.path.join(pwd, 'a.cpp')])
56 t
.expect_addition("bin/$toolset/debug*/a.exe")
58 # Test absolute path in target ids.
61 t
.write("d1/jamroot.jam", "")
62 t
.write("d1/jamfile.jam", "exe a : a.cpp ;")
63 t
.write("d1/a.cpp", "int main() {}\n")
64 t
.write("d2/jamroot.jam", "")
65 t
.write("d2/jamfile.jam", """\
67 alias x : $(pwd)/../d1//a ;
70 t
.run_build_system(subdir
="d2")
71 t
.expect_addition("d1/bin/$toolset/debug*/a.exe")