1#!/usr/local/bin/python3.8
2
3# Copyright 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)
6
7# This test tries to stage the same file to the same location by *two* different
8# stage rules, in two different projects. This is not exactly good thing to do,
9# but still, V2 should handle this. We had two bugs:
10# - since the file is referred from two projects, we created to different
11#   virtual targets
12# - we also failed to figure out that the two target corresponding to the copied
13#   files (created in two projects) are actually equivalent.
14
15import BoostBuild
16
17t = BoostBuild.Tester()
18
19t.write("a.cpp", """
20""")
21
22t.write("jamroot.jam", """
23build-project a ;
24build-project b ;
25""")
26
27t.write("a/jamfile.jam", """
28stage bin : ../a.cpp : <location>../dist ;
29""")
30
31t.write("b/jamfile.jam", """
32stage bin : ../a.cpp : <location>../dist ;
33""")
34
35t.run_build_system()
36t.expect_addition("dist/a.cpp")
37
38t.cleanup()
39