|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r79698 - trunk/tools/build/v2/test
From: jurko.gospodnetic_at_[hidden]
Date: 2012-07-23 12:54:21
Author: jurko
Date: 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
New Revision: 79698
URL: http://svn.boost.org/trac/boost/changeset/79698
Log:
Boost Build internal testing framework cleanup - minor stylistic changes (Python string literal quoting, line wrapping, trailing spaces, updated expected output line leading & trailing spaces to match the actual output).
Text files modified:
trunk/tools/build/v2/test/BoostBuild.py | 159 +++++++++++++++++++--------------------
trunk/tools/build/v2/test/build_file.py | 10 +-
trunk/tools/build/v2/test/builtin_split_by_characters.py | 3
trunk/tools/build/v2/test/conditionals_multiple.py | 3
trunk/tools/build/v2/test/configuration.py | 18 ++-
trunk/tools/build/v2/test/copy_time.py | 6
trunk/tools/build/v2/test/core_action_output.py | 3
trunk/tools/build/v2/test/core_arguments.py | 5
trunk/tools/build/v2/test/core_at_file.py | 7 +
trunk/tools/build/v2/test/core_d12.py | 7 +
trunk/tools/build/v2/test/core_nt_cmd_line.py | 10 +
trunk/tools/build/v2/test/core_option_l.py | 3
trunk/tools/build/v2/test/core_source_line_tracking.py | 3
trunk/tools/build/v2/test/core_variables_in_actions.py | 3
trunk/tools/build/v2/test/default_toolset.py | 32 ++++---
trunk/tools/build/v2/test/dll_path.py | 8 +-
trunk/tools/build/v2/test/double_loading.py | 13 +-
trunk/tools/build/v2/test/gcc_runtime.py | 3
trunk/tools/build/v2/test/generator_selection.py | 13 +-
trunk/tools/build/v2/test/generators_test.py | 12 +-
trunk/tools/build/v2/test/load_order.py | 49 ++++--------
trunk/tools/build/v2/test/notfile.py | 18 +---
trunk/tools/build/v2/test/project_glob.py | 93 ++++++----------------
trunk/tools/build/v2/test/project_test3.py | 9 +
trunk/tools/build/v2/test/sort_rule.py | 10 +-
trunk/tools/build/v2/test/tag.py | 22 ++--
trunk/tools/build/v2/test/test_rc.py | 3
trunk/tools/build/v2/test/test_result_dumping.py | 3
trunk/tools/build/v2/test/timedata.py | 3
29 files changed, 249 insertions(+), 282 deletions(-)
Modified: trunk/tools/build/v2/test/BoostBuild.py
==============================================================================
--- trunk/tools/build/v2/test/BoostBuild.py (original)
+++ trunk/tools/build/v2/test/BoostBuild.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -2,8 +2,8 @@
# Copyright 2002-2003 Dave Abrahams.
# Copyright 2006 Rene Rivera.
# 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)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
import TestCmd
@@ -79,14 +79,14 @@
def get_toolset():
toolset = None
for arg in sys.argv[1:]:
- if not arg.startswith('-'):
+ if not arg.startswith("-"):
toolset = arg
- return toolset or 'gcc'
+ return toolset or "gcc"
# Detect the host OS.
-cygwin = hasattr(os, 'uname') and os.uname()[0].lower().startswith('cygwin')
-windows = cygwin or os.environ.get('OS', '').lower().startswith('windows')
+cygwin = hasattr(os, "uname") and os.uname()[0].lower().startswith("cygwin")
+windows = cygwin or os.environ.get("OS", "").lower().startswith("windows")
def prepare_prefixes_and_suffixes(toolset):
@@ -105,21 +105,21 @@
suffixes = {}
if windows:
if toolset == "gcc":
- suffixes['.lib'] = '.a' # mingw static libs use suffix '.a'.
- suffixes['.obj'] = '.o'
+ suffixes[".lib"] = ".a" # mingw static libs use suffix ".a".
+ suffixes[".obj"] = ".o"
if cygwin:
- suffixes['.implib'] = '.lib.a'
+ suffixes[".implib"] = ".lib.a"
else:
- suffixes['.implib'] = '.lib'
+ suffixes[".implib"] = ".lib"
else:
- suffixes['.exe'] = ''
- suffixes['.dll'] = '.so'
- suffixes['.lib'] = '.a'
- suffixes['.obj'] = '.o'
- suffixes['.implib'] = '.no_implib_files_on_this_platform'
+ suffixes[".exe"] = ""
+ suffixes[".dll"] = ".so"
+ suffixes[".lib"] = ".a"
+ suffixes[".obj"] = ".o"
+ suffixes[".implib"] = ".no_implib_files_on_this_platform"
- if hasattr(os, 'uname') and os.uname()[0] == 'Darwin':
- suffixes['.dll'] = '.dylib'
+ if hasattr(os, "uname") and os.uname()[0] == "Darwin":
+ suffixes[".dll"] = ".dylib"
def prepare_library_prefix(toolset):
@@ -173,7 +173,7 @@
match those actually created by the current
toolset. For example, static library files
are specified by using the .lib suffix but
- when the 'gcc' toolset is used it actually
+ when the "gcc" toolset is used it actually
creates them using the .a suffix.
`pass_toolset` - Whether the test system should pass the
specified toolset to the run executable.
@@ -192,7 +192,7 @@
`description` - Test description string displayed in case
of a failed test.
- `subdir' - List of subdirectories to automatically
+ `subdir` - List of subdirectories to automatically
create under the working directory. Each
subdirectory needs to be specified
separately, parent coming before its child.
@@ -221,32 +221,32 @@
self.pass_toolset = pass_toolset
self.ignore_toolset_requirements = ignore_toolset_requirements
- prepare_prefixes_and_suffixes(pass_toolset and self.toolset or 'gcc')
+ prepare_prefixes_and_suffixes(pass_toolset and self.toolset or "gcc")
- use_default_bjam = '--default-bjam' in sys.argv
+ use_default_bjam = "--default-bjam" in sys.argv
if not use_default_bjam:
jam_build_dir = ""
- if os.name == 'nt':
+ if os.name == "nt":
jam_build_dir = "bin.ntx86"
- elif (os.name == 'posix') and os.__dict__.has_key('uname'):
- if os.uname()[0].lower().startswith('cygwin'):
+ elif (os.name == "posix") and os.__dict__.has_key("uname"):
+ if os.uname()[0].lower().startswith("cygwin"):
jam_build_dir = "bin.cygwinx86"
- if ('TMP' in os.environ and
- os.environ['TMP'].find('~') != -1):
- print('Setting $TMP to /tmp to get around problem '
- 'with short path names')
- os.environ['TMP'] = '/tmp'
- elif os.uname()[0] == 'Linux':
+ if ("TMP" in os.environ and
+ os.environ["TMP"].find("~") != -1):
+ print("Setting $TMP to /tmp to get around problem "
+ "with short path names")
+ os.environ["TMP"] = "/tmp"
+ elif os.uname()[0] == "Linux":
cpu = os.uname()[4]
if re.match("i.86", cpu):
jam_build_dir = "bin.linuxx86"
else:
jam_build_dir = "bin.linux" + os.uname()[4]
- elif os.uname()[0] == 'SunOS':
+ elif os.uname()[0] == "SunOS":
jam_build_dir = "bin.solaris"
- elif os.uname()[0] == 'Darwin':
- if os.uname()[4] == 'i386':
+ elif os.uname()[0] == "Darwin":
+ if os.uname()[4] == "i386":
jam_build_dir = "bin.macosxx86"
else:
jam_build_dir = "bin.macosxppc"
@@ -267,8 +267,8 @@
# Find where jam_src is located. Try for the debug version if it is
# lying around.
- dirs = [os.path.join('../engine', jam_build_dir + '.debug'),
- os.path.join('../engine', jam_build_dir)]
+ dirs = [os.path.join("../engine", jam_build_dir + ".debug"),
+ os.path.join("../engine", jam_build_dir)]
for d in dirs:
if os.path.exists(d):
jam_build_dir = d
@@ -277,12 +277,12 @@
print("Cannot find built Boost.Jam")
sys.exit(1)
- verbosity = ['-d0', '--quiet']
+ verbosity = ["-d0", "--quiet"]
if not pass_d0:
verbosity = []
- if '--verbose' in sys.argv:
- keywords['verbose'] = True
- verbosity = ['-d+2']
+ if "--verbose" in sys.argv:
+ keywords["verbose"] = True
+ verbosity = ["-d+2"]
if boost_build_path is None:
boost_build_path = self.original_workdir + "/.."
@@ -451,21 +451,21 @@
ignore_toolset_requirements = self.ignore_toolset_requirements
try:
- kw['program'] = []
- kw['program'] += self.program
+ kw["program"] = []
+ kw["program"] += self.program
if extra_args:
- kw['program'] += extra_args
+ kw["program"] += extra_args
if pass_toolset:
- kw['program'].append("toolset=" + self.toolset)
+ kw["program"].append("toolset=" + self.toolset)
if use_test_config:
- kw['program'].append('--test-config="%s"' % os.path.join(
+ kw["program"].append('--test-config="%s"' % os.path.join(
self.original_workdir, "test-config.jam"))
if ignore_toolset_requirements:
- kw['program'].append("--ignore-toolset-requirements")
+ kw["program"].append("--ignore-toolset-requirements")
if "--python" in sys.argv:
- kw['program'].append("--python")
- kw['chdir'] = subdir
- self.last_program_invocation = kw['program']
+ kw["program"].append("--python")
+ kw["chdir"] = subdir
+ self.last_program_invocation = kw["program"]
apply(TestCmd.TestCmd.run, [self], kw)
except:
self.dump_stdio()
@@ -488,11 +488,11 @@
self.unexpected_difference = copy.deepcopy(self.difference)
if (status and self.status) is not None and self.status != status:
- expect = ''
+ expect = ""
if status != 0:
expect = " (expected %d)" % status
- annotation("failure", '"%s" returned %d%s' % (kw['program'],
+ annotation("failure", '"%s" returned %d%s' % (kw["program"],
self.status, expect))
annotation("reason", "unexpected status returned by bjam")
@@ -530,7 +530,7 @@
def glob_file(self, name):
result = None
- if hasattr(self, 'difference'):
+ if hasattr(self, "difference"):
for f in (self.difference.added_files +
self.difference.modified_files +
self.difference.touched_files):
@@ -560,17 +560,17 @@
except:
annotation("failure", "Could not open '%s'" % name)
self.fail_test(1)
- return ''
+ return ""
def read_and_strip(self, name):
if not self.glob_file(name):
- return ''
+ return ""
f = open(self.glob_file(name), "rb")
lines = f.readlines()
f.close()
result = string.join(map(string.rstrip, lines), "\n")
- if lines and lines[-1][-1] != '\n':
- return result + '\n'
+ if lines and lines[-1][-1] != "\n":
+ return result + "\n"
return result
def fail_test(self, condition, dump_difference=True, dump_stdio=True,
@@ -578,7 +578,7 @@
if not condition:
return
- if dump_difference and hasattr(self, 'difference'):
+ if dump_difference and hasattr(self, "difference"):
f = StringIO.StringIO()
self.difference.pprint(f)
annotation("changes caused by the last build command", f.getvalue())
@@ -586,7 +586,7 @@
if dump_stdio:
self.dump_stdio()
- if '--preserve' in sys.argv:
+ if "--preserve" in sys.argv:
print
print "*** Copying the state of working dir into 'failed_test' ***"
print
@@ -597,7 +597,7 @@
raise "Path " + path + " already exists and is not a directory"
shutil.copytree(self.workdir, path)
print "The failed command was:"
- print ' '.join(self.last_program_invocation)
+ print " ".join(self.last_program_invocation)
if dump_stack:
annotate_stack_trace()
@@ -698,15 +698,15 @@
# Not totally sure about this change, but I do not see a good
# alternative.
if windows:
- self.ignore('*.ilk') # MSVC incremental linking files.
- self.ignore('*.pdb') # MSVC program database files.
- self.ignore('*.rsp') # Response files.
- self.ignore('*.tds') # Borland debug symbols.
- self.ignore('*.manifest') # MSVC DLL manifests.
+ self.ignore("*.ilk") # MSVC incremental linking files.
+ self.ignore("*.pdb") # MSVC program database files.
+ self.ignore("*.rsp") # Response files.
+ self.ignore("*.tds") # Borland debug symbols.
+ self.ignore("*.manifest") # MSVC DLL manifests.
# Debug builds of bjam built with gcc produce this profiling data.
- self.ignore('gmon.out')
- self.ignore('*/gmon.out')
+ self.ignore("gmon.out")
+ self.ignore("*/gmon.out")
# Boost Build's 'configure' functionality (unfinished at the time)
# produces this file.
@@ -716,7 +716,7 @@
self.ignore("*.pyc")
if not self.unexpected_difference.empty():
- annotation('failure', 'Unexpected changes found')
+ annotation("failure", "Unexpected changes found")
output = StringIO.StringIO()
self.unexpected_difference.pprint(output)
annotation("unexpected changes", output.getvalue())
@@ -743,12 +743,11 @@
(expected, content))
self.fail_test(1)
- def expect_output_line(self, line, expected_to_exist=True):
- self.__expect_line(self.stdout(), line, expected_to_exist)
+ def expect_output_line(self, line, expected=True):
+ self.__expect_line(self.stdout(), line, expected)
- def expect_content_line(self, name, line, expected_to_exist=True):
- content = self.__read_file(name)
- self.__expect_line(content, line, expected_to_exist)
+ def expect_content_line(self, filename, line, expected=True):
+ self.__expect_line(self.__read_file(filename), line, expected)
def __read_file(self, name, exact=False):
name = self.adjust_names(name)[0]
@@ -809,8 +808,8 @@
# exact Python/OS platform version, os.system() call may gobble up
# the external process's return code and return 0 itself.
if os.system('diff -u "%s" "%s"' % (e, a)) not in [0, 1]:
- print('Unable to compute difference: diff -u "%s" "%s"' % (e,
- a))
+ print('Unable to compute difference: diff -u "%s" "%s"' % (e, a
+ ))
os.unlink(e)
os.unlink(a)
else:
@@ -823,7 +822,7 @@
return None
here = arguments[0]
- if type(here) == type(''):
+ if type(here) == type(""):
here = [here]
if len(arguments) > 1:
@@ -921,11 +920,11 @@
elements = []
if isinstance(s, type("")):
# Have to handle escaped spaces correctly.
- s = string.replace(s, "\ ", '\001')
+ s = string.replace(s, "\ ", "\001")
elements = string.split(s)
else:
elements = s
- self.l = [string.replace(e, '\001', ' ') for e in elements]
+ self.l = [string.replace(e, "\001", " ") for e in elements]
def __len__(self):
return len(self.l)
@@ -943,9 +942,7 @@
return str(self.l)
def __repr__(self):
- return (self.__module__ + '.List('
- + repr(string.join(self.l, ' '))
- + ')')
+ return "%s.List(%r)" % (self.__module__, " ".join(self.l))
def __mul__(self, other):
result = List()
@@ -968,7 +965,7 @@
# Quickie tests. Should use doctest instead.
-if __name__ == '__main__':
+if __name__ == "__main__":
assert str(List("foo bar") * "/baz") == "['foo/baz', 'bar/baz']"
assert repr("foo/" * List("bar baz")) == "__main__.List('foo/bar foo/baz')"
- print('tests passed')
+ print("tests passed")
Modified: trunk/tools/build/v2/test/build_file.py
==============================================================================
--- trunk/tools/build/v2/test/build_file.py (original)
+++ trunk/tools/build/v2/test/build_file.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -1,10 +1,10 @@
#!/usr/bin/python
-# Copyright (C) Vladimir Prus 2006.
-# Copyright (C) Jurko Gospodnetic 2008.
-# 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)
+# Copyright (C) 2006. Vladimir Prus
+# Copyright (C) 2008. 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 we explicitly request a file (not target) to be built by
# specifying its name on the command line.
Modified: trunk/tools/build/v2/test/builtin_split_by_characters.py
==============================================================================
--- trunk/tools/build/v2/test/builtin_split_by_characters.py (original)
+++ trunk/tools/build/v2/test/builtin_split_by_characters.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -2,7 +2,8 @@
# 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)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
# This tests the SPLIT_BY_CHARACTERS rule.
Modified: trunk/tools/build/v2/test/conditionals_multiple.py
==============================================================================
--- trunk/tools/build/v2/test/conditionals_multiple.py (original)
+++ trunk/tools/build/v2/test/conditionals_multiple.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -2,7 +2,8 @@
# Copyright 2008 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)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
# Tests that properties conditioned on more than one other property work as
# expected.
Modified: trunk/tools/build/v2/test/configuration.py
==============================================================================
--- trunk/tools/build/v2/test/configuration.py (original)
+++ trunk/tools/build/v2/test/configuration.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -2,7 +2,8 @@
# Copyright 2008, 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)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
# Test Boost Build configuration file handling.
@@ -27,9 +28,12 @@
"""
- implicitConfigLoadMessage = "notice: Loading user-config configuration file: *"
- explicitConfigLoadMessage = "notice: Loading explicitly specified user configuration file:"
- disabledConfigLoadMessage = "notice: User configuration file loading explicitly disabled."
+ implicitConfigLoadMessage = \
+ "notice: Loading user-config configuration file: *"
+ explicitConfigLoadMessage = \
+ "notice: Loading explicitly specified user configuration file:"
+ disabledConfigLoadMessage = \
+ "notice: User configuration file loading explicitly disabled."
testMessage = "_!_!_!_!_!_!_!_!_ %s _!_!_!_!_!_!_!_!_"
toolsetName = "__myDummyToolset__"
subdirName = "ASubDirectory"
@@ -250,9 +254,9 @@
"""
Unsets the given environment variable if it is currently set.
- Note that we can not use os.environ.pop() or os.environ.clear() here
- since prior to Python 2.6 these functions did not remove the actual
- environment variable by calling os.unsetenv().
+ Note that we can not use os.environ.pop() or os.environ.clear() here
+ since prior to Python 2.6 these functions did not remove the actual
+ environment variable by calling os.unsetenv().
"""
try:
Modified: trunk/tools/build/v2/test/copy_time.py
==============================================================================
--- trunk/tools/build/v2/test/copy_time.py (original)
+++ trunk/tools/build/v2/test/copy_time.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -2,8 +2,8 @@
#
# Copyright (c) 2008 Steven Watanabe
#
-# Distributed under the Boost Software License, Version 1.0. (See
-# accompanying file LICENSE_1_0.txt or copy at
+# 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)
# Test that the common.copy rule set the modification date of the new file to
@@ -63,7 +63,7 @@
tester.fail_test(1)
tester.run_build_system(["-d1"])
-tester.expect_output_line("common.copy*", expected_to_exist=False)
+tester.expect_output_line("common.copy*", False)
tester.expect_nothing_more()
tester.cleanup()
Modified: trunk/tools/build/v2/test/core_action_output.py
==============================================================================
--- trunk/tools/build/v2/test/core_action_output.py (original)
+++ trunk/tools/build/v2/test/core_action_output.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -2,7 +2,8 @@
# 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)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
# Test correct "-p" option handling.
Modified: trunk/tools/build/v2/test/core_arguments.py
==============================================================================
--- trunk/tools/build/v2/test/core_arguments.py (original)
+++ trunk/tools/build/v2/test/core_arguments.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -3,7 +3,8 @@
# Copyright 2001 Dave Abrahams
# Copyright 2011 Steven Watanabe
# 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)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
import BoostBuild
@@ -88,7 +89,7 @@
test_varargs(t, "1 : 2 : 3 4 5 : 6 7 : 8 : 9 : 10 : 11 : 12 : 13 : 14 : 15 : "
"16 : 17 : 18 : 19a 19b 19c : 20", "a= 1 b= c= : d= 2 : e= 3 4 5 : rest= "
"6 7 : 8 : 9 : 10 : 11 : 12 : 13 : 14 : 15 : 16 : 17 : 18 : 19a 19b 19c : "
- "20 ")
+ "20")
# Check varargs upper limit
expected = "a= 1 b= c= : d= 2 : e= 3 : rest= " + simple_args(4, 19)
Modified: trunk/tools/build/v2/test/core_at_file.py
==============================================================================
--- trunk/tools/build/v2/test/core_at_file.py (original)
+++ trunk/tools/build/v2/test/core_at_file.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -1,8 +1,9 @@
#!/usr/bin/python
# Copyright 2011 Steven Watanabe
-# 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)
+# 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)
import BoostBuild
@@ -30,7 +31,7 @@
""")
t.run_build_system(["-d2"])
-t.expect_output_line('echo file: "on1 on2 .txt"');
+t.expect_output_line(' echo file: "on1 on2 .txt" ');
t.expect_addition("on1 on2 .txt")
t.expect_content("on1 on2 .txt", " test -DM1 -DM2", True)
Modified: trunk/tools/build/v2/test/core_d12.py
==============================================================================
--- trunk/tools/build/v2/test/core_d12.py (original)
+++ trunk/tools/build/v2/test/core_d12.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -2,15 +2,16 @@
# Copyright 2002, 2003 Vladimir Prus
# 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)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
# This tests correct handling of "-d1" and "-d2" options.
import BoostBuild
-t = BoostBuild.Tester(["-ffile.jam"], pass_toolset=0)
+t = BoostBuild.Tester(["-ffile.jam"], pass_d0=False, pass_toolset=0)
-t.write("file.jam", """
+t.write("file.jam", """\
actions a { }
actions quietly b { }
ALWAYS all ;
Modified: trunk/tools/build/v2/test/core_nt_cmd_line.py
==============================================================================
--- trunk/tools/build/v2/test/core_nt_cmd_line.py (original)
+++ trunk/tools/build/v2/test/core_nt_cmd_line.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -3,7 +3,8 @@
# Copyright 2001 Dave Abrahams
# Copyright 2011 Steven Watanabe
# 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)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
# Tests Windows command line construction.
#
@@ -172,13 +173,16 @@
t.expect_addition("two.txt")
t.write("file_pipe.jam", """\
-actions do_pipe { echo one | echo two }
+actions do_pipe
+{
+ echo one | echo two
+}
JAMSHELL = % ;
do_pipe all ;
""")
t.run_build_system(["-ffile_pipe.jam"])
t.expect_output_line("do_pipe all")
- t.expect_output_line("one", False)
+ t.expect_output_line("one*", False)
t.expect_output_line("two")
t.expect_output_line("Executing raw command directly", False)
t.expect_output_line("Executing using a command file and the shell: "
Modified: trunk/tools/build/v2/test/core_option_l.py
==============================================================================
--- trunk/tools/build/v2/test/core_option_l.py (original)
+++ trunk/tools/build/v2/test/core_option_l.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -3,7 +3,8 @@
# Copyright 2007 Rene Rivera.
# Copyright 2011 Steven Watanabe
# 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)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
import BoostBuild
Modified: trunk/tools/build/v2/test/core_source_line_tracking.py
==============================================================================
--- trunk/tools/build/v2/test/core_source_line_tracking.py (original)
+++ trunk/tools/build/v2/test/core_source_line_tracking.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -2,7 +2,8 @@
# 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)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
# Test Boost Jam parser's source line tracking & reporting.
Modified: trunk/tools/build/v2/test/core_variables_in_actions.py
==============================================================================
--- trunk/tools/build/v2/test/core_variables_in_actions.py (original)
+++ trunk/tools/build/v2/test/core_variables_in_actions.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -2,7 +2,8 @@
# 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)
+# (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
Modified: trunk/tools/build/v2/test/default_toolset.py
==============================================================================
--- trunk/tools/build/v2/test/default_toolset.py (original)
+++ trunk/tools/build/v2/test/default_toolset.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -2,13 +2,14 @@
# Copyright 2008 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)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
# Test that the expected default toolset is used when no toolset is explicitly
# specified on the command line or used from code via the using rule. Test that
# the default toolset is correctly used just like any other explicitly used
-# toolset (e.g. toolset prerequisites, properties conditioned on toolset related
-# features, etc.).
+# toolset (e.g. toolset prerequisites, properties conditioned on toolset
+# related features, etc.).
#
# Note that we need to ignore regular site/user/test configuration files to
# avoid them marking any toolsets not under our control as used.
@@ -21,12 +22,12 @@
'warning: Configuring default toolset "%s".'
-################################################################################
+###############################################################################
#
# test_conditions_on_default_toolset()
# ------------------------------------
#
-################################################################################
+###############################################################################
def test_conditions_on_default_toolset():
"""Test that toolset and toolset subfeature conditioned properties get
@@ -96,19 +97,20 @@
t.expect_output_line(configuring_default_toolset_message % toolset_name)
t.expect_output_line(message_loaded)
t.expect_output_line(message_initialized)
- t.expect_output_line("descriptions: /stand-alone/ /toolset/ /toolset-version/")
+ t.expect_output_line("descriptions: /stand-alone/ /toolset/ "
+ "/toolset-version/")
t.expect_output_line("toolset: /%s/" % toolset_name)
t.expect_output_line("toolset-version: /%s/" % toolset_version)
t.cleanup()
-################################################################################
+###############################################################################
#
# test_default_toolset_on_os()
# ----------------------------
#
-################################################################################
+###############################################################################
def test_default_toolset_on_os( os, expected_toolset ):
"""Test that the given toolset is used as the default toolset on the given
@@ -127,17 +129,18 @@
# load missing toolsets might cause random failures with which we are not
# concerned in this test.
t.run_build_system(stderr=None)
- t.expect_output_line(configuring_default_toolset_message % expected_toolset)
+ t.expect_output_line(configuring_default_toolset_message %
+ expected_toolset)
t.cleanup()
-################################################################################
+###############################################################################
#
# test_default_toolset_requirements()
# -----------------------------------
#
-################################################################################
+###############################################################################
def test_default_toolset_requirements():
"""Test that default toolset's requirements get applied correctly.
@@ -190,18 +193,19 @@
t.run_build_system()
t.expect_output_line(configuring_default_toolset_message % toolset_name)
- t.expect_output_line("descriptions: /conditioned-requirement/ /target-requirement/ /toolset-requirement/")
+ t.expect_output_line("descriptions: /conditioned-requirement/ "
+ "/target-requirement/ /toolset-requirement/")
t.expect_output_line("toolset: /%s/" % toolset_name)
t.cleanup()
-################################################################################
+###############################################################################
#
# main()
# ------
#
-################################################################################
+###############################################################################
test_default_toolset_on_os("NT" , "msvc")
test_default_toolset_on_os("LINUX" , "gcc" )
Modified: trunk/tools/build/v2/test/dll_path.py
==============================================================================
--- trunk/tools/build/v2/test/dll_path.py (original)
+++ trunk/tools/build/v2/test/dll_path.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -1,9 +1,9 @@
#!/usr/bin/python
-# Copyright (C) Vladimir Prus 2003. Permission to copy, use, modify, sell and
-# distribute this software is granted provided this copyright notice appears in
-# all copies. This software is provided "as is" without express or implied
-# warranty, and with no claim as to its suitability for any purpose.
+# Copyright (C) 2003. Vladimir Prus
+# 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)
# Test that the <dll-path> property is correctly set when using
# <hardcode-dll-paths>true.
Modified: trunk/tools/build/v2/test/double_loading.py
==============================================================================
--- trunk/tools/build/v2/test/double_loading.py (original)
+++ trunk/tools/build/v2/test/double_loading.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -2,14 +2,15 @@
# Copyright 2003 Vladimir Prus
# 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)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
import BoostBuild
t = BoostBuild.Tester()
# Regression test for double loading of the same Jamfile.
-t.write("jamroot.jam", "" )
+t.write("jamroot.jam", "")
t.write("jamfile.jam", "build-project subdir ;")
t.write("subdir/jamfile.jam", 'ECHO "Loaded subdir" ;')
@@ -18,10 +19,10 @@
# Regression test for a more contrived case. The top-level Jamfile refers to
-# subdir via use-project, while subdir's Jamfile is being loaded. The motivation
-# why use-project referring to subprojects is useful can be found at
-# http://article.gmane.org/gmane.comp.lib.boost.build/3906/
-t.write("jamroot.jam", "" )
+# subdir via use-project, while subdir's Jamfile is being loaded. The
+# motivation why use-project referring to subprojects is useful can be found
+# at: http://article.gmane.org/gmane.comp.lib.boost.build/3906
+t.write("jamroot.jam", "")
t.write("jamfile.jam", "use-project /subdir : subdir ;")
t.write("subdir/jamfile.jam", "project subdir ;")
Modified: trunk/tools/build/v2/test/gcc_runtime.py
==============================================================================
--- trunk/tools/build/v2/test/gcc_runtime.py (original)
+++ trunk/tools/build/v2/test/gcc_runtime.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -2,7 +2,8 @@
# Copyright 2004 Vladimir Prus
# 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)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
# Tests that on gcc, we correctly report a problem when static runtime is
# requested for building a shared library.
Modified: trunk/tools/build/v2/test/generator_selection.py
==============================================================================
--- trunk/tools/build/v2/test/generator_selection.py (original)
+++ trunk/tools/build/v2/test/generator_selection.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -2,15 +2,16 @@
# Copyright 2008, 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)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
# Tests that generators get selected correctly.
#
# We do not use the internal C++-compiler CPP --> OBJ generator to avoid
# problems with specific compilers or their configurations, e.g. IBM's AIX test
-# runner 'AIX Version 5.3 TL7 SP5 (5300-07-05-0831)' using the 'IBM XL C/C++ for
-# AIX, V12.1 (Version: 12.01.0000.0000)' reporting errors when run with a source
-# file whose suffix is not '.cpp'.
+# runner 'AIX Version 5.3 TL7 SP5 (5300-07-05-0831)' using the 'IBM XL C/C++
+# for AIX, V12.1 (Version: 12.01.0000.0000)' reporting errors when run with a
+# source file whose suffix is not '.cpp'.
import BoostBuild
@@ -112,7 +113,7 @@
t.write("dummy.xxx", "Hello. My name is Peter Pan.\n")
- t.write("jamroot.jam", """
+ t.write("jamroot.jam", """\
import common ;
import generators ;
import type ;
@@ -128,7 +129,7 @@
t.write("Other/source.xxx2", "Hello. My name is Tinkerbell.\n")
- t.write("Other/jamfile.jam", """
+ t.write("Other/jamfile.jam", """\
import type ;
type.register XXX2 : xxx2 : XXX ;
# We are careful not to do anything between defining our new XXX2 target type
Modified: trunk/tools/build/v2/test/generators_test.py
==============================================================================
--- trunk/tools/build/v2/test/generators_test.py (original)
+++ trunk/tools/build/v2/test/generators_test.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -4,7 +4,8 @@
# Copyright 2002, 2003, 2004, 2005 Vladimir Prus
# 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)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
import BoostBuild
import re
@@ -225,9 +226,9 @@
t.expect_nothing_more()
folder = "bin/$toolset/debug"
- t.expect_content_line("%s/obj_1.my_obj" % folder, "Sources: 'z.cpp'")
- t.expect_content_line("%s/obj_2.my_obj" % folder, "Sources: 'z.cpp'")
- t.expect_content_line("%s/a.my_obj" % folder, "Sources: 'a.cpp'")
+ t.expect_content_line("%s/obj_1.my_obj" % folder, " Sources: 'z.cpp'")
+ t.expect_content_line("%s/obj_2.my_obj" % folder, " Sources: 'z.cpp'")
+ t.expect_content_line("%s/a.my_obj" % folder, " Sources: 'a.cpp'")
lines = t.stdout().splitlines()
source_lines = [x for x in lines if re.match("^ Sources: '", x)]
@@ -344,7 +345,8 @@
t.write(name,
r"""# 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)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
# Support for registering test generators that construct their targets by
# simply appending their given input data, e.g. list of sources & targets.
Modified: trunk/tools/build/v2/test/load_order.py
==============================================================================
--- trunk/tools/build/v2/test/load_order.py (original)
+++ trunk/tools/build/v2/test/load_order.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -1,31 +1,30 @@
#!/usr/bin/python
# Copyright 2004 Vladimir Prus.
-# Distributed under the Boost Software License, Version 1.0. (See
-# accompanying file LICENSE_1_0.txt or copy at
+# 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)
# Test that we load parent projects before loading children.
import BoostBuild
-import string
t = BoostBuild.Tester()
-t.write("jamroot.jam", """
+t.write("jamroot.jam", """\
use-project /child : child ;
ECHO "Setting parent requirements" ;
project : requirements <define>PASS_THE_TEST ;
alias x : child//main ;
""")
-t.write("child/jamfile.jam", """
+t.write("child/jamfile.jam", """\
ECHO "Setting child requirements" ;
project /child ;
exe main : main.cpp ;
""")
-t.write("child/main.cpp", """
+t.write("child/main.cpp", """\
#if defined(PASS_THE_TEST)
int main() {}
#endif
@@ -34,25 +33,16 @@
t.run_build_system()
t.expect_addition("child/bin/$toolset/debug/main.exe")
-t.fail_test(string.find(t.stdout(), "Setting child requirements") <
- string.find(t.stdout(), "Setting parent requirements"))
+t.fail_test(t.stdout().find("Setting child requirements") < t.stdout().find(
+ "Setting parent requirements"))
# Regression test: parent requirements were ignored in some cases.
t.rm(".")
-t.write("jamroot.jam", """
-build-project src ;
-""")
-
-t.write("src/jamfile.jam", """
-project : requirements <define>EVERYTHING_OK ;
-""")
-
-t.write("src/app/jamfile.jam", """
-exe test : test.cpp ;
-""")
-
-t.write("src/app/test.cpp", """
+t.write("jamroot.jam", "build-project src ;")
+t.write("src/jamfile.jam", "project : requirements <define>EVERYTHING_OK ;")
+t.write("src/app/jamfile.jam", "exe test : test.cpp ;")
+t.write("src/app/test.cpp", """\
#ifdef EVERYTHING_OK
int main() {}
#endif
@@ -61,26 +51,19 @@
t.run_build_system(subdir="src/app")
t.expect_addition("src/app/bin/$toolset/debug/test.exe")
+
# child/child2 used to be loaded before child
t.rm(".")
-t.write("jamroot.jam", """
+t.write("jamroot.jam", """\
use-project /child/child2 : child/child2 ;
rule parent-rule ( )
{
ECHO "Running parent-rule" ;
}
""")
-
-t.write("child/jamfile.jam", """
-""")
-
-t.write("child/child1/jamfile.jam", """
-""")
-
-t.write("child/child2/jamfile.jam", """
-parent-rule ;
-""")
-
+t.write("child/jamfile.jam", "")
+t.write("child/child1/jamfile.jam", "")
+t.write("child/child2/jamfile.jam", "parent-rule ;")
t.run_build_system(subdir="child/child1")
t.expect_output_line("Running parent-rule")
Modified: trunk/tools/build/v2/test/notfile.py
==============================================================================
--- trunk/tools/build/v2/test/notfile.py (original)
+++ trunk/tools/build/v2/test/notfile.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -1,14 +1,13 @@
#!/usr/bin/python
# Copyright (C) Vladimir Prus 2005.
-# Distributed under the Boost Software License, Version 1.0. (See
-# accompanying file LICENSE_1_0.txt or copy at
+# 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)
# Basic tests for the 'notfile' rule.
import BoostBuild
-import string
import os
t = BoostBuild.Tester()
@@ -16,14 +15,9 @@
t.write("jamroot.jam", """\
import notfile ;
notfile say : "echo hi" ;
-
exe hello : hello.cpp ;
notfile hello_valgrind : @valgrind : hello ;
-
-actions valgrind
-{
- valgrind $(>[1])
-}
+actions valgrind { valgrind $(>[1]) }
""")
t.write("hello.cpp", """\
@@ -33,10 +27,10 @@
t.run_build_system(["-n", "-d+2"])
-t.fail_test(string.find(t.stdout(), "echo hi") == -1)
+t.fail_test(t.stdout().find("echo hi") == -1)
name = t.adjust_names("bin/$toolset/debug/hello.exe")[0]
-name = apply(os.path.join, string.split(name, "/"));
-t.expect_output_line("valgrind *%s" % name)
+name = apply(os.path.join, name.split("/"));
+t.expect_output_line(" valgrind *%s " % name)
t.cleanup()
Modified: trunk/tools/build/v2/test/project_glob.py
==============================================================================
--- trunk/tools/build/v2/test/project_glob.py (original)
+++ trunk/tools/build/v2/test/project_glob.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -2,8 +2,8 @@
# Copyright (C) Vladimir Prus 2003.
# 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)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
# Test the 'glob' rule in Jamfile context.
@@ -12,35 +12,18 @@
# Create a temporary working directory.
t = BoostBuild.Tester()
-t.write("jamroot.jam", """
-""")
-
-t.write("d1/a.cpp", """
-int main() {}
-""")
-
-t.write("d1/jamfile.jam", """
-exe a : [ glob *.cpp ] ../d2/d//l ;
-""")
-
-t.write("d2/d/l.cpp", """
+t.write("jamroot.jam", "")
+t.write("d1/a.cpp", "int main() {}\n")
+t.write("d1/jamfile.jam", "exe a : [ glob *.cpp ] ../d2/d//l ;")
+t.write("d2/d/l.cpp", """\
#if defined(_WIN32)
__declspec(dllexport)
void force_import_lib_creation() {}
#endif
""")
-
-t.write("d2/d/jamfile.jam", """
-lib l : [ glob *.cpp ] ;
-""")
-
-t.write("d3/d/jamfile.jam", """
-exe a : [ glob ../*.cpp ] ;
-""")
-
-t.write("d3/a.cpp", """
-int main() {}
-""")
+t.write("d2/d/jamfile.jam", "lib l : [ glob *.cpp ] ;")
+t.write("d3/d/jamfile.jam", "exe a : [ glob ../*.cpp ] ;")
+t.write("d3/a.cpp", "int main() {}\n")
t.run_build_system(subdir="d1")
t.expect_addition("d1/bin/$toolset/debug/a.exe")
@@ -49,7 +32,6 @@
t.expect_addition("d3/d/bin/$toolset/debug/a.exe")
t.rm("d2/d/bin")
-
t.run_build_system(subdir="d2/d")
t.expect_addition("d2/d/bin/$toolset/debug/l.dll")
@@ -58,11 +40,8 @@
# to the source location.
t.rm("d1")
-t.write("d1/src/a.cpp", """
-int main() {}
-""")
-
-t.write("d1/jamfile.jam", """
+t.write("d1/src/a.cpp", "int main() {}\n")
+t.write("d1/jamfile.jam", """\
project : source-location src ;
exe a : [ glob *.cpp ] ../d2/d//l ;
""")
@@ -70,23 +49,17 @@
t.run_build_system(subdir="d1")
t.expect_addition("d1/bin/$toolset/debug/a.exe")
+
# Test that wildcards can include directories. Also test exclusion patterns.
t.rm("d1")
-t.write("d1/src/foo/a.cpp", """
+t.write("d1/src/foo/a.cpp", """\
void bar();
int main() { bar(); }
""")
-
-t.write("d1/src/bar/b.cpp", """
-void bar() {}
-""")
-
-t.write("d1/src/bar/bad.cpp", """
-very bad non-compilable file
-""")
-
-t.write("d1/jamfile.jam", """
+t.write("d1/src/bar/b.cpp", "void bar() {}\n")
+t.write("d1/src/bar/bad.cpp", "very bad non-compilable file\n")
+t.write("d1/jamfile.jam", """\
project : source-location src ;
exe a : [ glob foo/*.cpp bar/*.cpp : bar/bad* ] ../d2/d//l ;
""")
@@ -98,7 +71,7 @@
# Test that 'glob-tree' works.
t.rm("d1/bin/$toolset/debug/a.exe")
-t.write("d1/jamfile.jam", """
+t.write("d1/jamfile.jam", """\
project : source-location src ;
exe a : [ glob-tree *.cpp : bad* ] ../d2/d//l ;
""")
@@ -108,7 +81,7 @@
# Test that directory names in patterns for 'glob-tree' are rejected.
-t.write("d1/jamfile.jam", """
+t.write("d1/jamfile.jam", """\
project : source-location src ;
exe a : [ glob-tree foo/*.cpp bar/*.cpp : bad* ] ../d2/d//l ;
""")
@@ -117,15 +90,14 @@
t.expect_output_line("error: The patterns * may not include directory")
-t.rm("d1/src/bar/bad.cpp")
-
# Test that 'glob' works with absolute names.
+t.rm("d1/src/bar/bad.cpp")
t.rm("d1/bin")
-# Note that to get current dir, we use bjam's PWD, not Python's os.getcwd(),
-# because the former will always return long path while the latter might return
-# a short path, and that will confuse path.glob.
-t.write("d1/jamfile.jam", """
+# Note that to get the current dir, we use bjam's PWD, not Python's
+# os.getcwd(), because the former will always return a long path while the
+# latter might return a short path, which would confuse path.glob.
+t.write("d1/jamfile.jam", """\
project : source-location src ;
local pwd = [ PWD ] ; # Always absolute
exe a : [ glob $(pwd)/src/foo/*.cpp $(pwd)/src/bar/*.cpp ] ../d2/d//l ;
@@ -139,21 +111,10 @@
# subdirectory.
t.rm(".")
-t.write("jamroot.jam", """
-build-project p ;
-""")
-
-t.write("p/p.c", """
-int main() {}
-""")
-
-t.write("p/p_x.c", """
-int main() {}
-""")
-
-t.write("p/jamfile.jam", """
-exe p : [ glob *.c : p_x.c ] ;
-""")
+t.write("jamroot.jam", "build-project p ;")
+t.write("p/p.c", "int main() {}\n")
+t.write("p/p_x.c", "int main() {}\n")
+t.write("p/jamfile.jam", "exe p : [ glob *.c : p_x.c ] ;")
t.run_build_system(subdir="p")
t.expect_addition("p/bin/$toolset/debug/p.exe")
Modified: trunk/tools/build/v2/test/project_test3.py
==============================================================================
--- trunk/tools/build/v2/test/project_test3.py (original)
+++ trunk/tools/build/v2/test/project_test3.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -3,7 +3,8 @@
# Copyright 2002, 2003 Dave Abrahams
# Copyright 2002, 2003, 2004, 2006 Vladimir Prus
# 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)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
import BoostBuild
import os
@@ -122,12 +123,14 @@
# Test project ids in command line work as well.
t.set_tree("project-test3")
t.run_build_system(["/lib2"])
-t.expect_addition("lib2/bin/$toolset/debug/" * BoostBuild.List("c.obj d.obj l.exe"))
+t.expect_addition("lib2/bin/$toolset/debug/" *
+ BoostBuild.List("c.obj d.obj l.exe"))
t.expect_addition("bin/$toolset/debug/a.obj")
t.expect_nothing_more()
t.run_build_system(["lib"])
-t.expect_addition("lib/bin/$toolset/debug/" * BoostBuild.List("b.obj m.exe"))
+t.expect_addition("lib/bin/$toolset/debug/" *
+ BoostBuild.List("b.obj m.exe"))
t.expect_nothing_more()
t.cleanup()
Modified: trunk/tools/build/v2/test/sort_rule.py
==============================================================================
--- trunk/tools/build/v2/test/sort_rule.py (original)
+++ trunk/tools/build/v2/test/sort_rule.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -1,9 +1,9 @@
#!/usr/bin/python
-# Copyright (C) 2008. 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)
+# Copyright (C) 2008. 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 for the Boost Jam builtin SORT rule.
@@ -65,7 +65,7 @@
f = open(t.workpath("test.jam"), "w")
print >> f, "data = "
for i in range(0, 20000):
- if i % 2 != 0:
+ if i % 2:
print >> f, '"aaa"'
else:
print >> f, '"bbb"'
Modified: trunk/tools/build/v2/test/tag.py
==============================================================================
--- trunk/tools/build/v2/test/tag.py (original)
+++ trunk/tools/build/v2/test/tag.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -1,19 +1,19 @@
#!/usr/bin/python
-# Copyright (C) Pedro Ferreira 2003. Permission to copy, use, modify, sell and
-# distribute this software is granted provided this copyright notice appears in
-# all copies. This software is provided "as is" without express or implied
-# warranty, and with no claim as to its suitability for any purpose.
+# Copyright (C) 2003. Pedro Ferreira
+# 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)
import BoostBuild
-################################################################################
+###############################################################################
#
# test_folder_with_dot_in_name()
# ------------------------------
#
-################################################################################
+###############################################################################
def test_folder_with_dot_in_name(t):
"""
@@ -27,7 +27,7 @@
rule tag ( name : type ? : property-set )
{
# Do nothing, just make sure the rule is invoked OK.
- ECHO "The tag rule has been invoked." ;
+ ECHO The tag rule has been invoked. ;
}
exe a : a.cpp ;
""")
@@ -38,12 +38,12 @@
t.expect_output_line("The tag rule has been invoked.")
-################################################################################
+###############################################################################
#
# test_tag_property()
# -------------------
#
-################################################################################
+###############################################################################
def test_tag_property(t):
"""Basic tag property test."""
@@ -107,12 +107,12 @@
t.expect_removal(file_list)
-################################################################################
+###############################################################################
#
# main()
# ------
#
-################################################################################
+###############################################################################
t = BoostBuild.Tester()
Modified: trunk/tools/build/v2/test/test_rc.py
==============================================================================
--- trunk/tools/build/v2/test/test_rc.py (original)
+++ trunk/tools/build/v2/test/test_rc.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -2,7 +2,8 @@
# 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)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
# Tests rc toolset behaviour.
Modified: trunk/tools/build/v2/test/test_result_dumping.py
==============================================================================
--- trunk/tools/build/v2/test/test_result_dumping.py (original)
+++ trunk/tools/build/v2/test/test_result_dumping.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -2,7 +2,8 @@
# Copyright 2008 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)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
# Tests dumping Boost Build based testing results.
Modified: trunk/tools/build/v2/test/timedata.py
==============================================================================
--- trunk/tools/build/v2/test/timedata.py (original)
+++ trunk/tools/build/v2/test/timedata.py 2012-07-23 12:54:18 EDT (Mon, 23 Jul 2012)
@@ -3,7 +3,8 @@
# Copyright 2005 David Abrahams
# Copyright 2008, 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)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
# Tests the build step timing facilities.
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