|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r78670 - trunk/tools/build/v2/test
From: jurko.gospodnetic_at_[hidden]
Date: 2012-05-26 20:00:30
Author: jurko
Date: 2012-05-26 20:00:30 EDT (Sat, 26 May 2012)
New Revision: 78670
URL: http://svn.boost.org/trac/boost/changeset/78670
Log:
Added a new Boost Build unit test exercising the Jam variable expansion in actions.
Added:
trunk/tools/build/v2/test/core_variables_in_actions.py (contents, props changed)
Text files modified:
trunk/tools/build/v2/test/test_all.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
Added: trunk/tools/build/v2/test/core_variables_in_actions.py
==============================================================================
--- (empty file)
+++ trunk/tools/build/v2/test/core_variables_in_actions.py 2012-05-26 20:00:30 EDT (Sat, 26 May 2012)
@@ -0,0 +1,38 @@
+#!/usr/bin/python
+
+# Copyright 2012. Jurko Gospodnetic
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or 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_line("From rule: 1 seconds 2 seconds 3 seconds")
+t.expect_output_line('*From action: 1" 2" 3" seconds"*')
+t.cleanup()
Modified: trunk/tools/build/v2/test/test_all.py
==============================================================================
--- trunk/tools/build/v2/test/test_all.py (original)
+++ trunk/tools/build/v2/test/test_all.py 2012-05-26 20:00:30 EDT (Sat, 26 May 2012)
@@ -155,6 +155,7 @@
"core_parallel_multifile_actions_1",
"core_parallel_multifile_actions_2",
"core_update_now",
+ "core_variables_in_actions",
"custom_generator",
"default_build",
"default_features",
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk