2
0
mirror of https://github.com/boostorg/build.git synced 2026-01-19 04:02:14 +00:00
Files
build/test/escaping_dollar_before_round_bracket.py
ivan kotov 45a76a1803 Added the ability to escape the '$' character before '(' as "$$" which will allow using the "$()" and "$(())" expressions of bash, sh, and other shells. (#467)
The '$' character is now escaped as the "$$" sequence when a non-zero-length "$$" character sequence ends with the "$(" sequence or the '(' character.
This allows the use of SHELL $(...) or $((...)) expressions within bjam expressions such as "actions { ... }" or "[ SHELL ... ]".

---------

Co-authored-by: René Ferdinand Rivera Morell <grafikrobot@gmail.com>
2025-11-23 21:56:44 -06:00

40 lines
796 B
Python
Executable File

#!/usr/bin/env python3
# Copyright Ivan Kotov 2025.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or copy at
# https://www.bfgroup.xyz/b2/LICENSE.txt)
# Regression test. When Jamfile contained "using whatever ; " and the 'whatever'
# module declared a project, then all targets in Jamfile were considered to be
# declared in the project associated with 'whatever', not with the Jamfile.
import BoostBuild
t = BoostBuild.Tester(use_test_config=False)
t.write("jamroot.jam", """\
rule test {
value = zero ;
echo $(value) ;
echo $$(value) ;
echo $$$(value) ;
echo $$$$(value) ;
echo $$$$ ;
}
test a.test ;
""")
t.run_build_system(stdout="""zero
$(value)
$zero
$$(value)
$$$$
...found 1 target...
""")
t.cleanup()