Imported Upstream version 1.51.0
[platform/upstream/boost.git] / tools / build / v2 / test / resolution.py
1 #!/usr/bin/python
2
3 # Copyright (C) Vladimir Prus 2006.
4 # Distributed under the Boost Software License, Version 1.0. (See
5 # accompanying file LICENSE_1_0.txt or copy at
6 # http://www.boost.org/LICENSE_1_0.txt)
7
8 # Tests for the target id resolution process.
9
10 import BoostBuild
11
12 # Create a temporary working directory.
13 t = BoostBuild.Tester()
14
15 # Create the needed files
16 t.write("jamroot.jam", """
17 exe hello : hello.cpp ;
18 # This should use the 'hello' target, even if there is a 'hello' file in the
19 # current dir.
20 install s : hello : <location>. ;
21 """)
22
23 t.write("hello.cpp", """
24 int main() {}
25 """)
26
27 t.run_build_system()
28
29 t.expect_addition("bin/$toolset/debug/hello.obj")
30
31 t.touch("hello.cpp")
32 t.run_build_system("s")
33 # If 'hello' in the 's' target resolved to file in the current dir, nothing will
34 # be rebuilt.
35 t.expect_touch("bin/$toolset/debug/hello.obj")
36
37 t.cleanup()