summaryrefslogtreecommitdiff
path: root/tools/build/test/core_variables_in_actions.py
diff options
context:
space:
mode:
authorChanho Park <chanho61.park@samsung.com>2014-12-11 18:55:56 +0900
committerChanho Park <chanho61.park@samsung.com>2014-12-11 18:55:56 +0900
commit08c1e93fa36a49f49325a07fe91ff92c964c2b6c (patch)
tree7a7053ceb8874b28ec4b868d4c49b500008a102e /tools/build/test/core_variables_in_actions.py
parentbb4dd8289b351fae6b55e303f189127a394a1edd (diff)
downloadboost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.gz
boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.bz2
boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.zip
Imported Upstream version 1.57.0upstream/1.57.0
Diffstat (limited to 'tools/build/test/core_variables_in_actions.py')
-rwxr-xr-xtools/build/test/core_variables_in_actions.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/tools/build/test/core_variables_in_actions.py b/tools/build/test/core_variables_in_actions.py
new file mode 100755
index 0000000000..e3a7177e20
--- /dev/null
+++ b/tools/build/test/core_variables_in_actions.py
@@ -0,0 +1,39 @@
+#!/usr/bin/python
+
+# Copyright 2012. Jurko Gospodnetic
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+
+# Tests that variables in actions get expanded but double quote characters
+# get treated as regular characters and not string literal delimiters when
+# determining string tokens concatenated to the variable being expanded.
+#
+# We also take care to make this test work correctly when run using both
+# Windows and Unix echo command variant. That is why we add the extra single
+# quotes around the text being echoed - they will make the double quotes be
+# displayed as regular characters in both cases but will be displayed
+# themselves only when using the Windows cmd shell's echo command.
+
+import BoostBuild
+
+t = BoostBuild.Tester(pass_toolset=0)
+t.write("file.jam", """\
+rule dummy ( i )
+{
+ local a = 1 2 3 ;
+ ECHO From rule: $(a)" seconds" ;
+ a on $(i) = $(a) ;
+}
+
+actions dummy
+{
+ echo 'From action: $(a)" seconds"'
+}
+
+dummy all ;
+""")
+t.run_build_system(["-ffile.jam", "-d1"])
+t.expect_output_lines("From rule: 1 seconds 2 seconds 3 seconds")
+t.expect_output_lines('*From action: 1" 2" 3" seconds"*')
+t.cleanup()