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()
11
12# Regression test for double loading of the same Jamfile.
13t.write("jamroot.jam", "")
14t.write("jamfile.jam", "build-project subdir ;")
15t.write("subdir/jamfile.jam", 'ECHO "Loaded subdir" ;')
16
17t.run_build_system(subdir="subdir")
18t.expect_output_lines("Loaded subdir")
19
20
21# Regression test for a more contrived case. The top-level Jamfile refers to
22# subdir via use-project, while subdir's Jamfile is being loaded. The
23# motivation why use-project referring to subprojects is useful can be found
24# at: http://article.gmane.org/gmane.comp.lib.boost.build/3906
25t.write("jamroot.jam", "")
26t.write("jamfile.jam", "use-project /subdir : subdir ;")
27t.write("subdir/jamfile.jam", "project subdir ;")
28
29t.run_build_system(subdir="subdir");
30
31t.cleanup()
32