1#!/usr/local/bin/python3.8
2
3# Copyright 2001 Dave Abrahams
4# Copyright 2011 Steven Watanabe
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
8import BoostBuild
9import os
10
11t = BoostBuild.Tester(["-d1"], pass_toolset=0)
12
13t.write("subdir1/file-to-bind", "# This file intentionally left blank")
14
15t.write("file.jam", """\
16rule do-nothing ( target : source )
17{
18    DEPENDS $(target) : $(source) ;
19}
20actions quietly do-nothing { }
21
22# Make a non-file target which depends on a file that exists
23NOTFILE fake-target ;
24SEARCH on file-to-bind = subdir1 ;
25
26do-nothing fake-target : file-to-bind ;
27
28# Set jam up to call our bind-rule
29BINDRULE = bind-rule ;
30
31rule bind-rule ( target : path )
32{
33    ECHO "found:" $(target) at $(path) ;
34}
35
36DEPENDS all : fake-target ;
37""")
38
39t.run_build_system(["-ffile.jam"], stdout="""\
40found: all at all
41found: file-to-bind at subdir1%sfile-to-bind
42...found 3 targets...
43""" % os.sep)
44
45t.cleanup()
46