1#!/usr/local/bin/python3.8
2
3# Copyright 2003 Vladimir Prus
4# Distributed under the Boost Software License, Version 1.0.
5# (See accompanying file LICENSE_1_0.txt or copy at
6# http://www.boost.org/LICENSE_1_0.txt)
7
8import BoostBuild
9
10t = BoostBuild.Tester(use_test_config=False)
11
12
13# Regression tests: standalone project were not able to refer to targets
14# declared in themselves.
15
16t.write("a.cpp", "int main() {}\n")
17t.write("jamroot.jam", "import standalone ;")
18t.write("standalone.jam", """\
19import alias ;
20import project ;
21
22project.initialize $(__name__) ;
23project standalone ;
24
25local pwd = [ PWD ] ;
26
27alias x : $(pwd)/../a.cpp ;
28alias runtime : x ;
29""")
30
31t.write("standalone.py", """\
32from b2.manager import get_manager
33
34# FIXME: this is ugly as death
35get_manager().projects().initialize(__name__)
36
37import os ;
38
39# This use of list as parameter is also ugly.
40project(['standalone'])
41
42pwd = os.getcwd()
43alias('x', [os.path.join(pwd, '../a.cpp')])
44alias('runtime', ['x'])
45""")
46
47
48t.write("sub/jamfile.jam", "stage bin : /standalone//runtime ;")
49
50t.run_build_system(subdir="sub")
51t.expect_addition("sub/bin/a.cpp")
52
53t.cleanup()
54