]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/relative_sources.py
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / tools / build / test / relative_sources.py
1 #!/usr/bin/python
2
3 # Copyright 2003 Dave Abrahams
4 # Copyright 2002, 2006 Vladimir Prus
5 # Distributed under the Boost Software License, Version 1.0.
6 # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
7
8 # Test that we can specify sources using relative names.
9
10 import BoostBuild
11
12 t = BoostBuild.Tester(use_test_config=False)
13
14 # Test that relative path to source, 'src', is preserved.
15 t.write("jamroot.jam", "exe a : src/a.cpp ;")
16 t.write("src/a.cpp", "int main() {}\n")
17
18 t.run_build_system()
19 t.expect_addition("bin/$toolset/debug/src/a.obj")
20
21 # Test that the relative path to source is preserved
22 # when using 'glob'.
23 t.rm("bin")
24 t.write("jamroot.jam", "exe a : [ glob src/*.cpp ] ;")
25 t.run_build_system()
26 t.expect_addition("bin/$toolset/debug/src/a.obj")
27
28
29 # Test that relative path with ".." is *not* added to
30 # target path.
31 t.rm(".")
32 t.write("jamroot.jam", "")
33 t.write("a.cpp", "int main() { return 0; }\n")
34 t.write("build/Jamfile", "exe a : ../a.cpp ; ")
35 t.run_build_system(subdir="build")
36 t.expect_addition("build/bin/$toolset/debug/a.obj")
37
38 t.cleanup()