]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/tools/build/test/core_variables_in_actions.py
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / tools / build / test / core_variables_in_actions.py
CommitLineData
7c673cae
FG
1#!/usr/bin/python
2
3# Copyright 2012. Jurko Gospodnetic
4# Distributed under the Boost Software License, Version 1.0.
1e59de90
TL
5# (See accompanying file LICENSE.txt or copy at
6# https://www.bfgroup.xyz/b2/LICENSE.txt)
7c673cae
FG
7
8# Tests that variables in actions get expanded but double quote characters
9# get treated as regular characters and not string literal delimiters when
10# determining string tokens concatenated to the variable being expanded.
11#
12# We also take care to make this test work correctly when run using both
13# Windows and Unix echo command variant. That is why we add the extra single
14# quotes around the text being echoed - they will make the double quotes be
15# displayed as regular characters in both cases but will be displayed
16# themselves only when using the Windows cmd shell's echo command.
17
18import BoostBuild
19
20t = BoostBuild.Tester(pass_toolset=0)
21t.write("file.jam", """\
22rule dummy ( i )
23{
24 local a = 1 2 3 ;
11fdf7f2 25 ECHO From "rule:" $(a)" seconds" ;
7c673cae
FG
26 a on $(i) = $(a) ;
27}
28
29actions dummy
30{
31 echo 'From action: $(a)" seconds"'
32}
33
34dummy all ;
35""")
36t.run_build_system(["-ffile.jam", "-d1"])
37t.expect_output_lines("From rule: 1 seconds 2 seconds 3 seconds")
38t.expect_output_lines('*From action: 1" 2" 3" seconds"*')
39t.cleanup()