]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
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() | |
b32b8144 | 19 | t.expect_addition("bin/$toolset/debug*/src/a.obj") |
7c673cae FG |
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() | |
b32b8144 | 26 | t.expect_addition("bin/$toolset/debug*/src/a.obj") |
7c673cae FG |
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") | |
b32b8144 | 36 | t.expect_addition("build/bin/$toolset/debug*/a.obj") |
7c673cae FG |
37 | |
38 | t.cleanup() |