mirror of
https://github.com/boostorg/build.git
synced 2026-02-15 13:02:11 +00:00
Updated Boost Build's internal testing system to allow for more detailed output and file content line testing - can now test for multiple lines in sequence, with or without having other lines in between.
[SVN r79701]
This commit is contained in:
@@ -722,32 +722,52 @@ class Tester(TestCmd.TestCmd):
|
||||
annotation("unexpected changes", output.getvalue())
|
||||
self.fail_test(1)
|
||||
|
||||
def __expect_line(self, content, expected, expected_to_exist):
|
||||
expected = expected.strip()
|
||||
lines = content.splitlines()
|
||||
found = False
|
||||
for line in lines:
|
||||
line = line.strip()
|
||||
if fnmatch.fnmatch(line, expected):
|
||||
found = True
|
||||
break
|
||||
def __expect_lines(self, data, lines, expected):
|
||||
# str.splitlines() trims at most one trailing newline while we want the
|
||||
# trailing newline to indicate that there should be an extra empty line
|
||||
# at the end.
|
||||
splitlines = lambda x : (x + "\n").splitlines()
|
||||
|
||||
if expected_to_exist and not found:
|
||||
annotation("failure",
|
||||
"Did not find expected line:\n%s\nin output:\n%s" %
|
||||
(expected, content))
|
||||
self.fail_test(1)
|
||||
if not expected_to_exist and found:
|
||||
annotation("failure",
|
||||
"Found an unexpected line:\n%s\nin output:\n%s" %
|
||||
(expected, content))
|
||||
if data is None:
|
||||
data = []
|
||||
elif data.__class__ is str:
|
||||
data = splitlines(data)
|
||||
|
||||
if lines.__class__ is str:
|
||||
lines = [splitlines(lines)]
|
||||
else:
|
||||
expanded = []
|
||||
for x in lines:
|
||||
if x.__class__ is str:
|
||||
expanded.extend(splitlines(x))
|
||||
else:
|
||||
expanded.append(x)
|
||||
lines = expanded
|
||||
|
||||
if _contains_lines(data, lines) != bool(expected):
|
||||
output = []
|
||||
if expected:
|
||||
output = ["Did not find expected lines:"]
|
||||
else:
|
||||
output = ["Found unexpected lines:"]
|
||||
first = True
|
||||
for line_sequence in lines:
|
||||
if line_sequence:
|
||||
if first:
|
||||
first = False
|
||||
else:
|
||||
output.append("...")
|
||||
output.extend(" > " + line for line in line_sequence)
|
||||
output.append("in output:")
|
||||
output.extend(" > " + line for line in data)
|
||||
annotation("failure", "\n".join(output))
|
||||
self.fail_test(1)
|
||||
|
||||
def expect_output_line(self, line, expected=True):
|
||||
self.__expect_line(self.stdout(), line, expected)
|
||||
def expect_output_lines(self, lines, expected=True):
|
||||
self.__expect_lines(self.stdout(), lines, expected)
|
||||
|
||||
def expect_content_line(self, filename, line, expected=True):
|
||||
self.__expect_line(self.__read_file(filename), line, expected)
|
||||
def expect_content_lines(self, filename, line, expected=True):
|
||||
self.__expect_lines(self.__read_file(filename), line, expected)
|
||||
|
||||
def __read_file(self, name, exact=False):
|
||||
name = self.adjust_names(name)[0]
|
||||
@@ -974,8 +994,80 @@ class List:
|
||||
return result
|
||||
|
||||
|
||||
def _contains_lines(data, lines):
|
||||
data_line_count = len(data)
|
||||
expected_line_count = reduce(lambda x, y: x + len(y), lines, 0)
|
||||
index = 0
|
||||
for expected in lines:
|
||||
if expected_line_count > data_line_count - index:
|
||||
return False
|
||||
expected_line_count -= len(expected)
|
||||
index = __match_line_sequence(data, index, data_line_count -
|
||||
expected_line_count, expected)
|
||||
if index < 0:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def __match_line_sequence(data, start, end, lines):
|
||||
if not lines:
|
||||
return start
|
||||
for index in xrange(start, end - len(lines) + 1):
|
||||
data_index = index
|
||||
for expected in lines:
|
||||
if not fnmatch.fnmatch(data[data_index], expected):
|
||||
break;
|
||||
data_index += 1
|
||||
else:
|
||||
return data_index
|
||||
return -1
|
||||
|
||||
|
||||
# Quickie tests. Should use doctest instead.
|
||||
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')"
|
||||
|
||||
assert _contains_lines([], [])
|
||||
assert _contains_lines([], [[]])
|
||||
assert _contains_lines([], [[], []])
|
||||
assert _contains_lines([], [[], [], []])
|
||||
assert not _contains_lines([], [[""]])
|
||||
assert not _contains_lines([], [["a"]])
|
||||
|
||||
assert _contains_lines([""], [])
|
||||
assert _contains_lines(["a"], [])
|
||||
assert _contains_lines(["a", "b"], [])
|
||||
assert _contains_lines(["a", "b"], [[], [], []])
|
||||
|
||||
assert _contains_lines([""], [[""]])
|
||||
assert not _contains_lines([""], [["a"]])
|
||||
assert not _contains_lines(["a"], [[""]])
|
||||
assert _contains_lines(["a", "", "b", ""], [["a"]])
|
||||
assert _contains_lines(["a", "", "b", ""], [[""]])
|
||||
assert _contains_lines(["a", "", "b"], [["b"]])
|
||||
assert not _contains_lines(["a", "b"], [[""]])
|
||||
assert not _contains_lines(["a", "", "b", ""], [["c"]])
|
||||
assert _contains_lines(["a", "", "b", "x"], [["x"]])
|
||||
|
||||
data = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
|
||||
assert _contains_lines(data, [["1", "2"]])
|
||||
assert not _contains_lines(data, [["2", "1"]])
|
||||
assert not _contains_lines(data, [["1", "3"]])
|
||||
assert not _contains_lines(data, [["1", "3"]])
|
||||
assert _contains_lines(data, [["1"], ["2"]])
|
||||
assert _contains_lines(data, [["1"], [], [], [], ["2"]])
|
||||
assert _contains_lines(data, [["1"], ["3"]])
|
||||
assert not _contains_lines(data, [["3"], ["1"]])
|
||||
assert _contains_lines(data, [["3"], ["7"], ["8"]])
|
||||
assert not _contains_lines(data, [["1"], ["3", "5"]])
|
||||
assert not _contains_lines(data, [["1"], [""], ["5"]])
|
||||
assert not _contains_lines(data, [["1"], ["5"], ["3"]])
|
||||
assert not _contains_lines(data, [["1"], ["5", "3"]])
|
||||
|
||||
assert not _contains_lines(data, [[" 3"]])
|
||||
assert not _contains_lines(data, [["3 "]])
|
||||
assert not _contains_lines(data, [["3", ""]])
|
||||
assert not _contains_lines(data, [["", "3"]])
|
||||
|
||||
print("tests passed")
|
||||
|
||||
@@ -36,7 +36,7 @@ exe sub : hello.cpp ;
|
||||
t.write("sub/hello.cpp", "int main() {}\n")
|
||||
|
||||
t.run_build_system(["sub", t.adjust_suffix("hello.obj")])
|
||||
t.expect_output_line("*depends on itself*", False)
|
||||
t.expect_output_lines("*depends on itself*", False)
|
||||
t.expect_addition("sub/bin/$toolset/debug/hello.obj")
|
||||
t.expect_nothing_more()
|
||||
|
||||
@@ -90,7 +90,7 @@ exe hello3 : hello3.cpp ;
|
||||
|
||||
obj = t.adjust_suffix("hello2.obj")
|
||||
t.run_build_system(["hello1", obj], status=1)
|
||||
t.expect_output_line("don't know how to make*" + obj)
|
||||
t.expect_output_lines("don't know how to make*" + obj)
|
||||
t.expect_nothing_more()
|
||||
|
||||
t.cleanup()
|
||||
@@ -148,7 +148,7 @@ exe sub : hello.cpp ;
|
||||
t.write("sub/hello.cpp", "int main() {}\n")
|
||||
|
||||
t.run_build_system([t.adjust_suffix("hello.obj")])
|
||||
t.expect_output_line("*depends on itself*", False)
|
||||
t.expect_output_lines("*depends on itself*", False)
|
||||
t.expect_addition("bin/$toolset/debug/hello.obj")
|
||||
t.expect_addition("sub/bin/$toolset/debug/hello.obj")
|
||||
t.expect_nothing_more()
|
||||
|
||||
@@ -13,7 +13,7 @@ def test_invalid(params, expected_error_line):
|
||||
t = BoostBuild.Tester(pass_toolset=0)
|
||||
t.write("file.jam", "SPLIT_BY_CHARACTERS %s ;" % params)
|
||||
t.run_build_system(["-ffile.jam"], status=1)
|
||||
t.expect_output_line("[*] %s" % expected_error_line)
|
||||
t.expect_output_lines("[*] %s" % expected_error_line)
|
||||
t.cleanup()
|
||||
|
||||
def test_valid():
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
import BoostBuild
|
||||
|
||||
|
||||
################################################################################
|
||||
###############################################################################
|
||||
#
|
||||
# test_multiple_conditions()
|
||||
# --------------------------
|
||||
#
|
||||
################################################################################
|
||||
###############################################################################
|
||||
|
||||
def test_multiple_conditions():
|
||||
"""Basic tests for properties conditioned on multiple other properties."""
|
||||
@@ -71,59 +71,59 @@ notfile testTarget1 : @buildRule : :
|
||||
""")
|
||||
|
||||
t.run_build_system(["aaa=1", "bbb=1", "ccc=1"])
|
||||
t.expect_output_line("description: /d/" )
|
||||
t.expect_output_line("description: /a0/" , False)
|
||||
t.expect_output_line("description: /a1/" )
|
||||
t.expect_output_line("description: /a0-b0/" , False)
|
||||
t.expect_output_line("description: /a0-b1/" , False)
|
||||
t.expect_output_line("description: /a1-b0/" , False)
|
||||
t.expect_output_line("description: /a1-b1/" )
|
||||
t.expect_output_line("description: /a0-b0-c0/", False)
|
||||
t.expect_output_line("description: /a0-b0-c1/", False)
|
||||
t.expect_output_line("description: /a0-b1-c1/", False)
|
||||
t.expect_output_line("description: /a1-b0-c1/", False)
|
||||
t.expect_output_line("description: /a1-b1-c0/", False)
|
||||
t.expect_output_line("description: /a1-b1-c1/" )
|
||||
t.expect_output_lines("description: /d/" )
|
||||
t.expect_output_lines("description: /a0/" , False)
|
||||
t.expect_output_lines("description: /a1/" )
|
||||
t.expect_output_lines("description: /a0-b0/" , False)
|
||||
t.expect_output_lines("description: /a0-b1/" , False)
|
||||
t.expect_output_lines("description: /a1-b0/" , False)
|
||||
t.expect_output_lines("description: /a1-b1/" )
|
||||
t.expect_output_lines("description: /a0-b0-c0/", False)
|
||||
t.expect_output_lines("description: /a0-b0-c1/", False)
|
||||
t.expect_output_lines("description: /a0-b1-c1/", False)
|
||||
t.expect_output_lines("description: /a1-b0-c1/", False)
|
||||
t.expect_output_lines("description: /a1-b1-c0/", False)
|
||||
t.expect_output_lines("description: /a1-b1-c1/" )
|
||||
|
||||
t.run_build_system(["aaa=0", "bbb=0", "ccc=1"])
|
||||
t.expect_output_line("description: /d/" )
|
||||
t.expect_output_line("description: /a0/" )
|
||||
t.expect_output_line("description: /a1/" , False)
|
||||
t.expect_output_line("description: /a0-b0/" )
|
||||
t.expect_output_line("description: /a0-b1/" , False)
|
||||
t.expect_output_line("description: /a1-b0/" , False)
|
||||
t.expect_output_line("description: /a1-b1/" , False)
|
||||
t.expect_output_line("description: /a0-b0-c0/", False)
|
||||
t.expect_output_line("description: /a0-b0-c1/" )
|
||||
t.expect_output_line("description: /a0-b1-c1/", False)
|
||||
t.expect_output_line("description: /a1-b0-c1/", False)
|
||||
t.expect_output_line("description: /a1-b1-c0/", False)
|
||||
t.expect_output_line("description: /a1-b1-c1/", False)
|
||||
t.expect_output_lines("description: /d/" )
|
||||
t.expect_output_lines("description: /a0/" )
|
||||
t.expect_output_lines("description: /a1/" , False)
|
||||
t.expect_output_lines("description: /a0-b0/" )
|
||||
t.expect_output_lines("description: /a0-b1/" , False)
|
||||
t.expect_output_lines("description: /a1-b0/" , False)
|
||||
t.expect_output_lines("description: /a1-b1/" , False)
|
||||
t.expect_output_lines("description: /a0-b0-c0/", False)
|
||||
t.expect_output_lines("description: /a0-b0-c1/" )
|
||||
t.expect_output_lines("description: /a0-b1-c1/", False)
|
||||
t.expect_output_lines("description: /a1-b0-c1/", False)
|
||||
t.expect_output_lines("description: /a1-b1-c0/", False)
|
||||
t.expect_output_lines("description: /a1-b1-c1/", False)
|
||||
|
||||
t.run_build_system(["aaa=0", "bbb=0", "ccc=0"])
|
||||
t.expect_output_line("description: /d/" )
|
||||
t.expect_output_line("description: /a0/" )
|
||||
t.expect_output_line("description: /a1/" , False)
|
||||
t.expect_output_line("description: /a0-b0/" )
|
||||
t.expect_output_line("description: /a0-b1/" , False)
|
||||
t.expect_output_line("description: /a1-b0/" , False)
|
||||
t.expect_output_line("description: /a1-b1/" , False)
|
||||
t.expect_output_line("description: /a0-b0-c0/" )
|
||||
t.expect_output_line("description: /a0-b0-c1/", False)
|
||||
t.expect_output_line("description: /a0-b1-c1/", False)
|
||||
t.expect_output_line("description: /a1-b0-c1/", False)
|
||||
t.expect_output_line("description: /a1-b1-c0/", False)
|
||||
t.expect_output_line("description: /a1-b1-c1/", False)
|
||||
t.expect_output_lines("description: /d/" )
|
||||
t.expect_output_lines("description: /a0/" )
|
||||
t.expect_output_lines("description: /a1/" , False)
|
||||
t.expect_output_lines("description: /a0-b0/" )
|
||||
t.expect_output_lines("description: /a0-b1/" , False)
|
||||
t.expect_output_lines("description: /a1-b0/" , False)
|
||||
t.expect_output_lines("description: /a1-b1/" , False)
|
||||
t.expect_output_lines("description: /a0-b0-c0/" )
|
||||
t.expect_output_lines("description: /a0-b0-c1/", False)
|
||||
t.expect_output_lines("description: /a0-b1-c1/", False)
|
||||
t.expect_output_lines("description: /a1-b0-c1/", False)
|
||||
t.expect_output_lines("description: /a1-b1-c0/", False)
|
||||
t.expect_output_lines("description: /a1-b1-c1/", False)
|
||||
|
||||
t.cleanup()
|
||||
|
||||
|
||||
################################################################################
|
||||
###############################################################################
|
||||
#
|
||||
# test_multiple_conditions_with_toolset_version()
|
||||
# -----------------------------------------------
|
||||
#
|
||||
################################################################################
|
||||
###############################################################################
|
||||
|
||||
def test_multiple_conditions_with_toolset_version():
|
||||
"""
|
||||
@@ -223,90 +223,90 @@ notfile testTarget1 : @buildRule : :
|
||||
""")
|
||||
|
||||
t.run_build_system(["aaa=1", "bbb=1", "ccc=1", "toolset=%s-0" % toolset])
|
||||
t.expect_output_line("description: /t-a0/" , False)
|
||||
t.expect_output_line("description: /t-a1/" )
|
||||
t.expect_output_line("description: /t0-a0/" , False)
|
||||
t.expect_output_line("description: /t0-a1/" )
|
||||
t.expect_output_line("description: /t1-a0/" , False)
|
||||
t.expect_output_line("description: /t1-a1/" , False)
|
||||
t.expect_output_line("description: /t-a0-b0/" , False)
|
||||
t.expect_output_line("description: /t-a0-b1/" , False)
|
||||
t.expect_output_line("description: /t-a1-b0/" , False)
|
||||
t.expect_output_line("description: /t-a1-b1/" )
|
||||
t.expect_output_line("description: /a0-t-b0/" , False)
|
||||
t.expect_output_line("description: /a0-t-b1/" , False)
|
||||
t.expect_output_line("description: /a1-t-b0/" , False)
|
||||
t.expect_output_line("description: /a1-t-b1/" )
|
||||
t.expect_output_line("description: /a0-b0-t/" , False)
|
||||
t.expect_output_line("description: /a0-b1-t/" , False)
|
||||
t.expect_output_line("description: /a1-b0-t/" , False)
|
||||
t.expect_output_line("description: /a1-b1-t/" )
|
||||
t.expect_output_line("description: /t0-a0-b0/", False)
|
||||
t.expect_output_line("description: /t0-a0-b1/", False)
|
||||
t.expect_output_line("description: /t0-a1-b0/", False)
|
||||
t.expect_output_line("description: /t0-a1-b1/" )
|
||||
t.expect_output_line("description: /t1-a0-b0/", False)
|
||||
t.expect_output_line("description: /t1-a0-b1/", False)
|
||||
t.expect_output_line("description: /t1-a1-b0/", False)
|
||||
t.expect_output_line("description: /t1-a1-b1/", False)
|
||||
t.expect_output_line("description: /a0-t1-b0/", False)
|
||||
t.expect_output_line("description: /a0-t1-b1/", False)
|
||||
t.expect_output_line("description: /a1-t0-b0/", False)
|
||||
t.expect_output_line("description: /a1-t0-b1/" )
|
||||
t.expect_output_line("description: /b0-a1-t0/", False)
|
||||
t.expect_output_line("description: /b0-a0-t1/", False)
|
||||
t.expect_output_line("description: /b0-a1-t1/", False)
|
||||
t.expect_output_line("description: /b1-a0-t1/", False)
|
||||
t.expect_output_line("description: /b1-a1-t0/" )
|
||||
t.expect_output_line("description: /b1-a1-t1/", False)
|
||||
t.expect_output_lines("description: /t-a0/" , False)
|
||||
t.expect_output_lines("description: /t-a1/" )
|
||||
t.expect_output_lines("description: /t0-a0/" , False)
|
||||
t.expect_output_lines("description: /t0-a1/" )
|
||||
t.expect_output_lines("description: /t1-a0/" , False)
|
||||
t.expect_output_lines("description: /t1-a1/" , False)
|
||||
t.expect_output_lines("description: /t-a0-b0/" , False)
|
||||
t.expect_output_lines("description: /t-a0-b1/" , False)
|
||||
t.expect_output_lines("description: /t-a1-b0/" , False)
|
||||
t.expect_output_lines("description: /t-a1-b1/" )
|
||||
t.expect_output_lines("description: /a0-t-b0/" , False)
|
||||
t.expect_output_lines("description: /a0-t-b1/" , False)
|
||||
t.expect_output_lines("description: /a1-t-b0/" , False)
|
||||
t.expect_output_lines("description: /a1-t-b1/" )
|
||||
t.expect_output_lines("description: /a0-b0-t/" , False)
|
||||
t.expect_output_lines("description: /a0-b1-t/" , False)
|
||||
t.expect_output_lines("description: /a1-b0-t/" , False)
|
||||
t.expect_output_lines("description: /a1-b1-t/" )
|
||||
t.expect_output_lines("description: /t0-a0-b0/", False)
|
||||
t.expect_output_lines("description: /t0-a0-b1/", False)
|
||||
t.expect_output_lines("description: /t0-a1-b0/", False)
|
||||
t.expect_output_lines("description: /t0-a1-b1/" )
|
||||
t.expect_output_lines("description: /t1-a0-b0/", False)
|
||||
t.expect_output_lines("description: /t1-a0-b1/", False)
|
||||
t.expect_output_lines("description: /t1-a1-b0/", False)
|
||||
t.expect_output_lines("description: /t1-a1-b1/", False)
|
||||
t.expect_output_lines("description: /a0-t1-b0/", False)
|
||||
t.expect_output_lines("description: /a0-t1-b1/", False)
|
||||
t.expect_output_lines("description: /a1-t0-b0/", False)
|
||||
t.expect_output_lines("description: /a1-t0-b1/" )
|
||||
t.expect_output_lines("description: /b0-a1-t0/", False)
|
||||
t.expect_output_lines("description: /b0-a0-t1/", False)
|
||||
t.expect_output_lines("description: /b0-a1-t1/", False)
|
||||
t.expect_output_lines("description: /b1-a0-t1/", False)
|
||||
t.expect_output_lines("description: /b1-a1-t0/" )
|
||||
t.expect_output_lines("description: /b1-a1-t1/", False)
|
||||
|
||||
t.run_build_system(["aaa=1", "bbb=1", "ccc=1", "toolset=%s-1" % toolset])
|
||||
t.expect_output_line("description: /t-a0/" , False)
|
||||
t.expect_output_line("description: /t-a1/" )
|
||||
t.expect_output_line("description: /t0-a0/" , False)
|
||||
t.expect_output_line("description: /t0-a1/" , False)
|
||||
t.expect_output_line("description: /t1-a0/" , False)
|
||||
t.expect_output_line("description: /t1-a1/" )
|
||||
t.expect_output_line("description: /t-a0-b0/" , False)
|
||||
t.expect_output_line("description: /t-a0-b1/" , False)
|
||||
t.expect_output_line("description: /t-a1-b0/" , False)
|
||||
t.expect_output_line("description: /t-a1-b1/" )
|
||||
t.expect_output_line("description: /a0-t-b0/" , False)
|
||||
t.expect_output_line("description: /a0-t-b1/" , False)
|
||||
t.expect_output_line("description: /a1-t-b0/" , False)
|
||||
t.expect_output_line("description: /a1-t-b1/" )
|
||||
t.expect_output_line("description: /a0-b0-t/" , False)
|
||||
t.expect_output_line("description: /a0-b1-t/" , False)
|
||||
t.expect_output_line("description: /a1-b0-t/" , False)
|
||||
t.expect_output_line("description: /a1-b1-t/" )
|
||||
t.expect_output_line("description: /t0-a0-b0/", False)
|
||||
t.expect_output_line("description: /t0-a0-b1/", False)
|
||||
t.expect_output_line("description: /t0-a1-b0/", False)
|
||||
t.expect_output_line("description: /t0-a1-b1/", False)
|
||||
t.expect_output_line("description: /t1-a0-b0/", False)
|
||||
t.expect_output_line("description: /t1-a0-b1/", False)
|
||||
t.expect_output_line("description: /t1-a1-b0/", False)
|
||||
t.expect_output_line("description: /t1-a1-b1/" )
|
||||
t.expect_output_line("description: /a0-t1-b0/", False)
|
||||
t.expect_output_line("description: /a0-t1-b1/", False)
|
||||
t.expect_output_line("description: /a1-t0-b0/", False)
|
||||
t.expect_output_line("description: /a1-t0-b1/", False)
|
||||
t.expect_output_line("description: /b0-a1-t0/", False)
|
||||
t.expect_output_line("description: /b0-a0-t1/", False)
|
||||
t.expect_output_line("description: /b0-a1-t1/", False)
|
||||
t.expect_output_line("description: /b1-a0-t1/", False)
|
||||
t.expect_output_line("description: /b1-a1-t0/", False)
|
||||
t.expect_output_line("description: /b1-a1-t1/" )
|
||||
t.expect_output_lines("description: /t-a0/" , False)
|
||||
t.expect_output_lines("description: /t-a1/" )
|
||||
t.expect_output_lines("description: /t0-a0/" , False)
|
||||
t.expect_output_lines("description: /t0-a1/" , False)
|
||||
t.expect_output_lines("description: /t1-a0/" , False)
|
||||
t.expect_output_lines("description: /t1-a1/" )
|
||||
t.expect_output_lines("description: /t-a0-b0/" , False)
|
||||
t.expect_output_lines("description: /t-a0-b1/" , False)
|
||||
t.expect_output_lines("description: /t-a1-b0/" , False)
|
||||
t.expect_output_lines("description: /t-a1-b1/" )
|
||||
t.expect_output_lines("description: /a0-t-b0/" , False)
|
||||
t.expect_output_lines("description: /a0-t-b1/" , False)
|
||||
t.expect_output_lines("description: /a1-t-b0/" , False)
|
||||
t.expect_output_lines("description: /a1-t-b1/" )
|
||||
t.expect_output_lines("description: /a0-b0-t/" , False)
|
||||
t.expect_output_lines("description: /a0-b1-t/" , False)
|
||||
t.expect_output_lines("description: /a1-b0-t/" , False)
|
||||
t.expect_output_lines("description: /a1-b1-t/" )
|
||||
t.expect_output_lines("description: /t0-a0-b0/", False)
|
||||
t.expect_output_lines("description: /t0-a0-b1/", False)
|
||||
t.expect_output_lines("description: /t0-a1-b0/", False)
|
||||
t.expect_output_lines("description: /t0-a1-b1/", False)
|
||||
t.expect_output_lines("description: /t1-a0-b0/", False)
|
||||
t.expect_output_lines("description: /t1-a0-b1/", False)
|
||||
t.expect_output_lines("description: /t1-a1-b0/", False)
|
||||
t.expect_output_lines("description: /t1-a1-b1/" )
|
||||
t.expect_output_lines("description: /a0-t1-b0/", False)
|
||||
t.expect_output_lines("description: /a0-t1-b1/", False)
|
||||
t.expect_output_lines("description: /a1-t0-b0/", False)
|
||||
t.expect_output_lines("description: /a1-t0-b1/", False)
|
||||
t.expect_output_lines("description: /b0-a1-t0/", False)
|
||||
t.expect_output_lines("description: /b0-a0-t1/", False)
|
||||
t.expect_output_lines("description: /b0-a1-t1/", False)
|
||||
t.expect_output_lines("description: /b1-a0-t1/", False)
|
||||
t.expect_output_lines("description: /b1-a1-t0/", False)
|
||||
t.expect_output_lines("description: /b1-a1-t1/" )
|
||||
|
||||
t.cleanup()
|
||||
|
||||
|
||||
################################################################################
|
||||
###############################################################################
|
||||
#
|
||||
# main()
|
||||
# ------
|
||||
#
|
||||
################################################################################
|
||||
###############################################################################
|
||||
|
||||
test_multiple_conditions()
|
||||
test_multiple_conditions_with_toolset_version()
|
||||
|
||||
@@ -104,125 +104,125 @@ ECHO test-index: $(test-index:E=(unknown)) ;
|
||||
test = LocalTester(t)
|
||||
|
||||
test(1, None)
|
||||
t.expect_output_line(explicitConfigLoadMessage, False)
|
||||
t.expect_output_line(disabledConfigLoadMessage, False)
|
||||
t.expect_output_line(testMessage % configFileNames[0], False)
|
||||
t.expect_output_line(testMessage % configFileNames[1], False)
|
||||
t.expect_output_line(testMessage % configFileNames[2], False)
|
||||
t.expect_output_lines(explicitConfigLoadMessage, False)
|
||||
t.expect_output_lines(disabledConfigLoadMessage, False)
|
||||
t.expect_output_lines(testMessage % configFileNames[0], False)
|
||||
t.expect_output_lines(testMessage % configFileNames[1], False)
|
||||
t.expect_output_lines(testMessage % configFileNames[2], False)
|
||||
|
||||
test(2, None, ["--user-config="])
|
||||
t.expect_output_line(implicitConfigLoadMessage, False)
|
||||
t.expect_output_line(explicitConfigLoadMessage, False)
|
||||
t.expect_output_line(disabledConfigLoadMessage)
|
||||
t.expect_output_line(testMessage % configFileNames[0], False)
|
||||
t.expect_output_line(testMessage % configFileNames[1], False)
|
||||
t.expect_output_line(testMessage % configFileNames[2], False)
|
||||
t.expect_output_lines(implicitConfigLoadMessage, False)
|
||||
t.expect_output_lines(explicitConfigLoadMessage, False)
|
||||
t.expect_output_lines(disabledConfigLoadMessage)
|
||||
t.expect_output_lines(testMessage % configFileNames[0], False)
|
||||
t.expect_output_lines(testMessage % configFileNames[1], False)
|
||||
t.expect_output_lines(testMessage % configFileNames[2], False)
|
||||
|
||||
test(3, None, ['--user-config=""'])
|
||||
t.expect_output_line(implicitConfigLoadMessage, False)
|
||||
t.expect_output_line(explicitConfigLoadMessage, False)
|
||||
t.expect_output_line(disabledConfigLoadMessage)
|
||||
t.expect_output_line(testMessage % configFileNames[0], False)
|
||||
t.expect_output_line(testMessage % configFileNames[1], False)
|
||||
t.expect_output_line(testMessage % configFileNames[2], False)
|
||||
t.expect_output_lines(implicitConfigLoadMessage, False)
|
||||
t.expect_output_lines(explicitConfigLoadMessage, False)
|
||||
t.expect_output_lines(disabledConfigLoadMessage)
|
||||
t.expect_output_lines(testMessage % configFileNames[0], False)
|
||||
t.expect_output_lines(testMessage % configFileNames[1], False)
|
||||
t.expect_output_lines(testMessage % configFileNames[2], False)
|
||||
|
||||
test(4, None, ['--user-config="%s"' % configFileNames[0]])
|
||||
t.expect_output_line(implicitConfigLoadMessage, False)
|
||||
t.expect_output_line(explicitConfigLoadMessage)
|
||||
t.expect_output_line(disabledConfigLoadMessage, False)
|
||||
t.expect_output_line(testMessage % configFileNames[0])
|
||||
t.expect_output_line(testMessage % configFileNames[1], False)
|
||||
t.expect_output_line(testMessage % configFileNames[2], False)
|
||||
t.expect_output_lines(implicitConfigLoadMessage, False)
|
||||
t.expect_output_lines(explicitConfigLoadMessage)
|
||||
t.expect_output_lines(disabledConfigLoadMessage, False)
|
||||
t.expect_output_lines(testMessage % configFileNames[0])
|
||||
t.expect_output_lines(testMessage % configFileNames[1], False)
|
||||
t.expect_output_lines(testMessage % configFileNames[2], False)
|
||||
|
||||
test(5, None, ['--user-config="%s"' % configFileNames[2]])
|
||||
t.expect_output_line(implicitConfigLoadMessage, False)
|
||||
t.expect_output_line(explicitConfigLoadMessage)
|
||||
t.expect_output_line(disabledConfigLoadMessage, False)
|
||||
t.expect_output_line(testMessage % configFileNames[0], False)
|
||||
t.expect_output_line(testMessage % configFileNames[1], False)
|
||||
t.expect_output_line(testMessage % configFileNames[2])
|
||||
t.expect_output_lines(implicitConfigLoadMessage, False)
|
||||
t.expect_output_lines(explicitConfigLoadMessage)
|
||||
t.expect_output_lines(disabledConfigLoadMessage, False)
|
||||
t.expect_output_lines(testMessage % configFileNames[0], False)
|
||||
t.expect_output_lines(testMessage % configFileNames[1], False)
|
||||
t.expect_output_lines(testMessage % configFileNames[2])
|
||||
|
||||
test(6, None, ['--user-config="%s"' % os.path.abspath(configFileNames[1])])
|
||||
t.expect_output_line(implicitConfigLoadMessage, False)
|
||||
t.expect_output_line(explicitConfigLoadMessage)
|
||||
t.expect_output_line(disabledConfigLoadMessage, False)
|
||||
t.expect_output_line(testMessage % configFileNames[0], False)
|
||||
t.expect_output_line(testMessage % configFileNames[1])
|
||||
t.expect_output_line(testMessage % configFileNames[2], False)
|
||||
t.expect_output_lines(implicitConfigLoadMessage, False)
|
||||
t.expect_output_lines(explicitConfigLoadMessage)
|
||||
t.expect_output_lines(disabledConfigLoadMessage, False)
|
||||
t.expect_output_lines(testMessage % configFileNames[0], False)
|
||||
t.expect_output_lines(testMessage % configFileNames[1])
|
||||
t.expect_output_lines(testMessage % configFileNames[2], False)
|
||||
|
||||
test(7, None, ['--user-config="%s"' % os.path.abspath(configFileNames[2])])
|
||||
t.expect_output_line(implicitConfigLoadMessage, False)
|
||||
t.expect_output_line(explicitConfigLoadMessage)
|
||||
t.expect_output_line(disabledConfigLoadMessage, False)
|
||||
t.expect_output_line(testMessage % configFileNames[0], False)
|
||||
t.expect_output_line(testMessage % configFileNames[1], False)
|
||||
t.expect_output_line(testMessage % configFileNames[2])
|
||||
t.expect_output_lines(implicitConfigLoadMessage, False)
|
||||
t.expect_output_lines(explicitConfigLoadMessage)
|
||||
t.expect_output_lines(disabledConfigLoadMessage, False)
|
||||
t.expect_output_lines(testMessage % configFileNames[0], False)
|
||||
t.expect_output_lines(testMessage % configFileNames[1], False)
|
||||
t.expect_output_lines(testMessage % configFileNames[2])
|
||||
|
||||
if canSetEmptyEnvironmentVariable:
|
||||
test(8, "")
|
||||
t.expect_output_line(implicitConfigLoadMessage, False)
|
||||
t.expect_output_line(explicitConfigLoadMessage, False)
|
||||
t.expect_output_line(disabledConfigLoadMessage, True)
|
||||
t.expect_output_line(testMessage % configFileNames[0], False)
|
||||
t.expect_output_line(testMessage % configFileNames[1], False)
|
||||
t.expect_output_line(testMessage % configFileNames[2], False)
|
||||
t.expect_output_lines(implicitConfigLoadMessage, False)
|
||||
t.expect_output_lines(explicitConfigLoadMessage, False)
|
||||
t.expect_output_lines(disabledConfigLoadMessage, True)
|
||||
t.expect_output_lines(testMessage % configFileNames[0], False)
|
||||
t.expect_output_lines(testMessage % configFileNames[1], False)
|
||||
t.expect_output_lines(testMessage % configFileNames[2], False)
|
||||
|
||||
test(9, '""')
|
||||
t.expect_output_line(implicitConfigLoadMessage, False)
|
||||
t.expect_output_line(explicitConfigLoadMessage, False)
|
||||
t.expect_output_line(disabledConfigLoadMessage)
|
||||
t.expect_output_line(testMessage % configFileNames[0], False)
|
||||
t.expect_output_line(testMessage % configFileNames[1], False)
|
||||
t.expect_output_line(testMessage % configFileNames[2], False)
|
||||
t.expect_output_lines(implicitConfigLoadMessage, False)
|
||||
t.expect_output_lines(explicitConfigLoadMessage, False)
|
||||
t.expect_output_lines(disabledConfigLoadMessage)
|
||||
t.expect_output_lines(testMessage % configFileNames[0], False)
|
||||
t.expect_output_lines(testMessage % configFileNames[1], False)
|
||||
t.expect_output_lines(testMessage % configFileNames[2], False)
|
||||
|
||||
test(10, configFileNames[1])
|
||||
t.expect_output_line(implicitConfigLoadMessage, False)
|
||||
t.expect_output_line(explicitConfigLoadMessage)
|
||||
t.expect_output_line(disabledConfigLoadMessage, False)
|
||||
t.expect_output_line(testMessage % configFileNames[0], False)
|
||||
t.expect_output_line(testMessage % configFileNames[1])
|
||||
t.expect_output_line(testMessage % configFileNames[2], False)
|
||||
t.expect_output_lines(implicitConfigLoadMessage, False)
|
||||
t.expect_output_lines(explicitConfigLoadMessage)
|
||||
t.expect_output_lines(disabledConfigLoadMessage, False)
|
||||
t.expect_output_lines(testMessage % configFileNames[0], False)
|
||||
t.expect_output_lines(testMessage % configFileNames[1])
|
||||
t.expect_output_lines(testMessage % configFileNames[2], False)
|
||||
|
||||
test(11, configFileNames[1], ['--user-config=""'])
|
||||
t.expect_output_line(implicitConfigLoadMessage, False)
|
||||
t.expect_output_line(explicitConfigLoadMessage, False)
|
||||
t.expect_output_line(disabledConfigLoadMessage)
|
||||
t.expect_output_line(testMessage % configFileNames[0], False)
|
||||
t.expect_output_line(testMessage % configFileNames[1], False)
|
||||
t.expect_output_line(testMessage % configFileNames[2], False)
|
||||
t.expect_output_lines(implicitConfigLoadMessage, False)
|
||||
t.expect_output_lines(explicitConfigLoadMessage, False)
|
||||
t.expect_output_lines(disabledConfigLoadMessage)
|
||||
t.expect_output_lines(testMessage % configFileNames[0], False)
|
||||
t.expect_output_lines(testMessage % configFileNames[1], False)
|
||||
t.expect_output_lines(testMessage % configFileNames[2], False)
|
||||
|
||||
test(12, configFileNames[1], ['--user-config="%s"' % configFileNames[0]])
|
||||
t.expect_output_line(implicitConfigLoadMessage, False)
|
||||
t.expect_output_line(explicitConfigLoadMessage)
|
||||
t.expect_output_line(disabledConfigLoadMessage, False)
|
||||
t.expect_output_line(testMessage % configFileNames[0])
|
||||
t.expect_output_line(testMessage % configFileNames[1], False)
|
||||
t.expect_output_line(testMessage % configFileNames[2], False)
|
||||
t.expect_output_lines(implicitConfigLoadMessage, False)
|
||||
t.expect_output_lines(explicitConfigLoadMessage)
|
||||
t.expect_output_lines(disabledConfigLoadMessage, False)
|
||||
t.expect_output_lines(testMessage % configFileNames[0])
|
||||
t.expect_output_lines(testMessage % configFileNames[1], False)
|
||||
t.expect_output_lines(testMessage % configFileNames[2], False)
|
||||
|
||||
if canSetEmptyEnvironmentVariable:
|
||||
test(13, "", ['--user-config="%s"' % configFileNames[0]])
|
||||
t.expect_output_line(implicitConfigLoadMessage, False)
|
||||
t.expect_output_line(explicitConfigLoadMessage)
|
||||
t.expect_output_line(disabledConfigLoadMessage, False)
|
||||
t.expect_output_line(testMessage % configFileNames[0])
|
||||
t.expect_output_line(testMessage % configFileNames[1], False)
|
||||
t.expect_output_line(testMessage % configFileNames[2], False)
|
||||
t.expect_output_lines(implicitConfigLoadMessage, False)
|
||||
t.expect_output_lines(explicitConfigLoadMessage)
|
||||
t.expect_output_lines(disabledConfigLoadMessage, False)
|
||||
t.expect_output_lines(testMessage % configFileNames[0])
|
||||
t.expect_output_lines(testMessage % configFileNames[1], False)
|
||||
t.expect_output_lines(testMessage % configFileNames[2], False)
|
||||
|
||||
test(14, '""', ['--user-config="%s"' % configFileNames[0]])
|
||||
t.expect_output_line(implicitConfigLoadMessage, False)
|
||||
t.expect_output_line(explicitConfigLoadMessage)
|
||||
t.expect_output_line(disabledConfigLoadMessage, False)
|
||||
t.expect_output_line(testMessage % configFileNames[0])
|
||||
t.expect_output_line(testMessage % configFileNames[1], False)
|
||||
t.expect_output_line(testMessage % configFileNames[2], False)
|
||||
t.expect_output_lines(implicitConfigLoadMessage, False)
|
||||
t.expect_output_lines(explicitConfigLoadMessage)
|
||||
t.expect_output_lines(disabledConfigLoadMessage, False)
|
||||
t.expect_output_lines(testMessage % configFileNames[0])
|
||||
t.expect_output_lines(testMessage % configFileNames[1], False)
|
||||
t.expect_output_lines(testMessage % configFileNames[2], False)
|
||||
|
||||
test(15, "invalid", ['--user-config="%s"' % configFileNames[0]])
|
||||
t.expect_output_line(implicitConfigLoadMessage, False)
|
||||
t.expect_output_line(explicitConfigLoadMessage)
|
||||
t.expect_output_line(disabledConfigLoadMessage, False)
|
||||
t.expect_output_line(testMessage % configFileNames[0])
|
||||
t.expect_output_line(testMessage % configFileNames[1], False)
|
||||
t.expect_output_line(testMessage % configFileNames[2], False)
|
||||
t.expect_output_lines(implicitConfigLoadMessage, False)
|
||||
t.expect_output_lines(explicitConfigLoadMessage)
|
||||
t.expect_output_lines(disabledConfigLoadMessage, False)
|
||||
t.expect_output_lines(testMessage % configFileNames[0])
|
||||
t.expect_output_lines(testMessage % configFileNames[1], False)
|
||||
t.expect_output_lines(testMessage % configFileNames[2], False)
|
||||
|
||||
t.cleanup()
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ if test2src != test2dest:
|
||||
tester.fail_test(1)
|
||||
|
||||
tester.run_build_system(["-d1"])
|
||||
tester.expect_output_line("common.copy*", False)
|
||||
tester.expect_output_lines("common.copy*", False)
|
||||
tester.expect_nothing_more()
|
||||
|
||||
tester.cleanup()
|
||||
|
||||
@@ -30,33 +30,33 @@ go all ;
|
||||
""")
|
||||
|
||||
t.run_build_system(["-ffile.jam", "-sXXX=1"], stderr="")
|
||||
t.expect_output_line("{{{ 1 }}}")
|
||||
t.expect_output_line("stdout")
|
||||
t.expect_output_line("stderr")
|
||||
t.expect_output_lines("{{{ 1 }}}")
|
||||
t.expect_output_lines("stdout")
|
||||
t.expect_output_lines("stderr")
|
||||
t.expect_nothing_more()
|
||||
|
||||
t.run_build_system(["-ffile.jam", "-sXXX=2", "-p0"], stderr="")
|
||||
t.expect_output_line("{{{ 2 }}}")
|
||||
t.expect_output_line("stdout")
|
||||
t.expect_output_line("stderr")
|
||||
t.expect_output_lines("{{{ 2 }}}")
|
||||
t.expect_output_lines("stdout")
|
||||
t.expect_output_lines("stderr")
|
||||
t.expect_nothing_more()
|
||||
|
||||
t.run_build_system(["-ffile.jam", "-sXXX=3", "-p1"], stderr="")
|
||||
t.expect_output_line("{{{ 3 }}}")
|
||||
t.expect_output_line("stdout")
|
||||
t.expect_output_line("stderr*", False)
|
||||
t.expect_output_lines("{{{ 3 }}}")
|
||||
t.expect_output_lines("stdout")
|
||||
t.expect_output_lines("stderr*", False)
|
||||
t.expect_nothing_more()
|
||||
|
||||
t.run_build_system(["-ffile.jam", "-sXXX=4", "-p2"], stderr="stderr\n")
|
||||
t.expect_output_line("{{{ 4 }}}")
|
||||
t.expect_output_line("stdout*", False)
|
||||
t.expect_output_line("stderr*", False)
|
||||
t.expect_output_lines("{{{ 4 }}}")
|
||||
t.expect_output_lines("stdout*", False)
|
||||
t.expect_output_lines("stderr*", False)
|
||||
t.expect_nothing_more()
|
||||
|
||||
t.run_build_system(["-ffile.jam", "-sXXX=5", "-p3"], stderr="stderr\n")
|
||||
t.expect_output_line("{{{ 5 }}}")
|
||||
t.expect_output_line("stdout")
|
||||
t.expect_output_line("stderr", False)
|
||||
t.expect_output_lines("{{{ 5 }}}")
|
||||
t.expect_output_lines("stdout")
|
||||
t.expect_output_lines("stderr", False)
|
||||
t.expect_nothing_more()
|
||||
|
||||
t.cleanup()
|
||||
|
||||
@@ -19,7 +19,7 @@ def test(t, type, input, output, status=0):
|
||||
code.append(";")
|
||||
t.write("file.jam", " ".join(code))
|
||||
t.run_build_system(["-ffile.jam"], status=status)
|
||||
t.expect_output_line(output);
|
||||
t.expect_output_lines(output);
|
||||
|
||||
|
||||
def test_args(t, *args, **kwargs):
|
||||
|
||||
@@ -17,7 +17,7 @@ EXIT file: "@(o$(name) .txt:E= test -D$(contents))" : 0 ;
|
||||
""")
|
||||
|
||||
t.run_build_system()
|
||||
t.expect_output_line("file: on1 on2 .txt");
|
||||
t.expect_output_lines("file: on1 on2 .txt");
|
||||
t.expect_addition("on1 on2 .txt")
|
||||
t.expect_content("on1 on2 .txt", " test -DM1 -DM2", True)
|
||||
|
||||
@@ -31,7 +31,7 @@ run all ;
|
||||
""")
|
||||
|
||||
t.run_build_system(["-d2"])
|
||||
t.expect_output_line(' echo file: "on1 on2 .txt" ');
|
||||
t.expect_output_lines(' echo file: "on1 on2 .txt" ');
|
||||
t.expect_addition("on1 on2 .txt")
|
||||
t.expect_content("on1 on2 .txt", " test -DM1 -DM2", True)
|
||||
|
||||
@@ -46,7 +46,7 @@ run all ;
|
||||
""")
|
||||
|
||||
t.run_build_system(["-d1"])
|
||||
t.expect_output_line(" test -DM1 -DM2")
|
||||
t.expect_output_lines(" test -DM1 -DM2")
|
||||
|
||||
t.rm(".")
|
||||
|
||||
@@ -58,6 +58,6 @@ run all ;
|
||||
""")
|
||||
|
||||
t.run_build_system(["-d1"])
|
||||
t.expect_output_line(" test -DM1 -DM2")
|
||||
t.expect_output_lines(" test -DM1 -DM2")
|
||||
|
||||
t.cleanup()
|
||||
|
||||
@@ -22,11 +22,11 @@ b all ;
|
||||
t.run_build_system(["-d0"], stdout="")
|
||||
|
||||
t.run_build_system(["-d1"])
|
||||
t.expect_output_line("a all")
|
||||
t.expect_output_line("b all", False)
|
||||
t.expect_output_lines("a all")
|
||||
t.expect_output_lines("b all", False)
|
||||
|
||||
t.run_build_system(["-d2"])
|
||||
t.expect_output_line("a all")
|
||||
t.expect_output_line("b all")
|
||||
t.expect_output_lines("a all")
|
||||
t.expect_output_lines("b all")
|
||||
|
||||
t.cleanup()
|
||||
|
||||
@@ -57,8 +57,8 @@ JAMSHELL = %% ;
|
||||
do_empty all ;
|
||||
""" % (whitespace_in))
|
||||
t.run_build_system(["-ffile.jam"], universal_newlines=False)
|
||||
t.expect_output_line("do_empty all")
|
||||
t.expect_output_line("Executing raw command directly", False)
|
||||
t.expect_output_lines("do_empty all")
|
||||
t.expect_output_lines("Executing raw command directly", False)
|
||||
if "\r\n%s\r\n" % whitespace_out not in t.stdout():
|
||||
BoostBuild.annotation("failure", "Whitespace action content not found "
|
||||
"on stdout.")
|
||||
@@ -112,12 +112,13 @@ do_echo all ;
|
||||
expected_status = 0
|
||||
t.run_build_system(["-ffile.jam"], status=expected_status)
|
||||
if error:
|
||||
t.expect_output_line("Executing raw command directly", False)
|
||||
t.expect_output_line("do_echo action is too long (%d, max 32766):" % n)
|
||||
t.expect_output_line("XXX: *", False)
|
||||
t.expect_output_lines("Executing raw command directly", False)
|
||||
t.expect_output_lines("do_echo action is too long (%d, max 32766):" % n
|
||||
)
|
||||
t.expect_output_lines("XXX: *", False)
|
||||
else:
|
||||
t.expect_output_line("Executing raw command directly")
|
||||
t.expect_output_line("do_echo action is too long*", False)
|
||||
t.expect_output_lines("Executing raw command directly")
|
||||
t.expect_output_lines("do_echo action is too long*", False)
|
||||
|
||||
m = re.search("^XXX: (.*)$", t.stdout(), re.MULTILINE)
|
||||
if not m:
|
||||
@@ -152,11 +153,11 @@ JAMSHELL = % ;
|
||||
do_multiline all ;
|
||||
""")
|
||||
t.run_build_system(["-ffile_multiline.jam"])
|
||||
t.expect_output_line("do_multiline all")
|
||||
t.expect_output_line("one")
|
||||
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: "
|
||||
t.expect_output_lines("do_multiline all")
|
||||
t.expect_output_lines("one")
|
||||
t.expect_output_lines("two")
|
||||
t.expect_output_lines("Executing raw command directly", False)
|
||||
t.expect_output_lines("Executing using a command file and the shell: "
|
||||
"cmd.exe /Q/C")
|
||||
|
||||
t.write("file_redirect.jam", """\
|
||||
@@ -165,10 +166,10 @@ JAMSHELL = % ;
|
||||
do_redirect all ;
|
||||
""")
|
||||
t.run_build_system(["-ffile_redirect.jam"])
|
||||
t.expect_output_line("do_redirect all")
|
||||
t.expect_output_line("one", False)
|
||||
t.expect_output_line("Executing raw command directly", False)
|
||||
t.expect_output_line("Executing using a command file and the shell: "
|
||||
t.expect_output_lines("do_redirect all")
|
||||
t.expect_output_lines("one", False)
|
||||
t.expect_output_lines("Executing raw command directly", False)
|
||||
t.expect_output_lines("Executing using a command file and the shell: "
|
||||
"cmd.exe /Q/C")
|
||||
t.expect_addition("two.txt")
|
||||
|
||||
@@ -181,11 +182,11 @@ 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("two")
|
||||
t.expect_output_line("Executing raw command directly", False)
|
||||
t.expect_output_line("Executing using a command file and the shell: "
|
||||
t.expect_output_lines("do_pipe all")
|
||||
t.expect_output_lines("one*", False)
|
||||
t.expect_output_lines("two")
|
||||
t.expect_output_lines("Executing raw command directly", False)
|
||||
t.expect_output_lines("Executing using a command file and the shell: "
|
||||
"cmd.exe /Q/C")
|
||||
|
||||
t.write("file_single_quoted.jam", """\
|
||||
@@ -194,10 +195,10 @@ JAMSHELL = %% ;
|
||||
do_single_quoted all ;
|
||||
""" % (cmd_prefix, cmd_suffix))
|
||||
t.run_build_system(["-ffile_single_quoted.jam"])
|
||||
t.expect_output_line("do_single_quoted all")
|
||||
t.expect_output_line("5>10")
|
||||
t.expect_output_line("Executing raw command directly")
|
||||
t.expect_output_line("Executing using a command file and the shell: "
|
||||
t.expect_output_lines("do_single_quoted all")
|
||||
t.expect_output_lines("5>10")
|
||||
t.expect_output_lines("Executing raw command directly")
|
||||
t.expect_output_lines("Executing using a command file and the shell: "
|
||||
"cmd.exe /Q/C", False)
|
||||
t.expect_nothing_more()
|
||||
|
||||
@@ -207,13 +208,13 @@ JAMSHELL = %% ;
|
||||
do_double_quoted all ;
|
||||
""" % (cmd_prefix, cmd_suffix))
|
||||
t.run_build_system(["-ffile_double_quoted.jam"])
|
||||
t.expect_output_line("do_double_quoted all")
|
||||
t.expect_output_lines("do_double_quoted all")
|
||||
# The difference between this example and the similar previous one using
|
||||
# single instead of double quotes stems from how the used Python executable
|
||||
# parses the command-line string received from Windows.
|
||||
t.expect_output_line("False")
|
||||
t.expect_output_line("Executing raw command directly")
|
||||
t.expect_output_line("Executing using a command file and the shell: "
|
||||
t.expect_output_lines("False")
|
||||
t.expect_output_lines("Executing raw command directly")
|
||||
t.expect_output_lines("Executing using a command file and the shell: "
|
||||
"cmd.exe /Q/C", False)
|
||||
t.expect_nothing_more()
|
||||
|
||||
@@ -223,10 +224,10 @@ JAMSHELL = %% ;
|
||||
do_escaped_quote all ;
|
||||
""" % (cmd_prefix, cmd_suffix))
|
||||
t.run_build_system(["-ffile_escaped_quote.jam"])
|
||||
t.expect_output_line("do_escaped_quote all")
|
||||
t.expect_output_line("5>10")
|
||||
t.expect_output_line("Executing raw command directly", False)
|
||||
t.expect_output_line("Executing using a command file and the shell: "
|
||||
t.expect_output_lines("do_escaped_quote all")
|
||||
t.expect_output_lines("5>10")
|
||||
t.expect_output_lines("Executing raw command directly", False)
|
||||
t.expect_output_lines("Executing using a command file and the shell: "
|
||||
"cmd.exe /Q/C")
|
||||
t.expect_nothing_more()
|
||||
|
||||
|
||||
@@ -39,6 +39,6 @@ DEPENDS all : sleeper ;
|
||||
""")
|
||||
|
||||
t.run_build_system(["-ffile.jam", "-d1", "-l2"], status=1)
|
||||
t.expect_output_line("2 second time limit exceeded")
|
||||
t.expect_output_lines("2 second time limit exceeded")
|
||||
|
||||
t.cleanup()
|
||||
|
||||
@@ -14,8 +14,8 @@ def test_eof_in_string():
|
||||
t = BoostBuild.Tester(pass_toolset=False)
|
||||
t.write("file.jam", '\n\n\naaa = "\n\n\n\n\n\n')
|
||||
t.run_build_system(["-ffile.jam"], status=1)
|
||||
t.expect_output_line('file.jam:4: unmatched " in string at keyword =')
|
||||
t.expect_output_line("file.jam:4: syntax error at EOF")
|
||||
t.expect_output_lines('file.jam:4: unmatched " in string at keyword =')
|
||||
t.expect_output_lines("file.jam:4: syntax error at EOF")
|
||||
t.cleanup()
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@ def test_error_missing_argument(eof):
|
||||
rule f ( param ) { }
|
||||
f ;%s""" % __trailing_newline(eof))
|
||||
t.run_build_system(["-ffile.jam"], status=1)
|
||||
t.expect_output_line("file.jam:2: in module scope")
|
||||
t.expect_output_line("file.jam:1:see definition of rule 'f' being called")
|
||||
t.expect_output_lines("file.jam:2: in module scope")
|
||||
t.expect_output_lines("file.jam:1:see definition of rule 'f' being called")
|
||||
t.cleanup()
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ def test_error_syntax(eof):
|
||||
t = BoostBuild.Tester(pass_toolset=False)
|
||||
t.write("file.jam", "ECHO%s" % __trailing_newline(eof))
|
||||
t.run_build_system(["-ffile.jam"], status=1)
|
||||
t.expect_output_line("file.jam:1: syntax error at EOF")
|
||||
t.expect_output_lines("file.jam:1: syntax error at EOF")
|
||||
t.cleanup()
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ def test_traceback():
|
||||
NOTFILE all ;
|
||||
ECHO [ BACKTRACE ] ;""")
|
||||
t.run_build_system(["-ffile.jam"])
|
||||
t.expect_output_line("file.jam 2 module scope")
|
||||
t.expect_output_lines("file.jam 2 module scope")
|
||||
t.cleanup()
|
||||
|
||||
|
||||
|
||||
@@ -34,6 +34,6 @@ actions dummy
|
||||
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.expect_output_lines("From rule: 1 seconds 2 seconds 3 seconds")
|
||||
t.expect_output_lines('*From action: 1" 2" 3" seconds"*')
|
||||
t.cleanup()
|
||||
|
||||
@@ -94,13 +94,13 @@ notfile testTarget
|
||||
'toolset_version_unused': toolset_version_unused})
|
||||
|
||||
t.run_build_system()
|
||||
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/ "
|
||||
t.expect_output_lines(configuring_default_toolset_message % toolset_name)
|
||||
t.expect_output_lines(message_loaded)
|
||||
t.expect_output_lines(message_initialized)
|
||||
t.expect_output_lines("descriptions: /stand-alone/ /toolset/ "
|
||||
"/toolset-version/")
|
||||
t.expect_output_line("toolset: /%s/" % toolset_name)
|
||||
t.expect_output_line("toolset-version: /%s/" % toolset_version)
|
||||
t.expect_output_lines("toolset: /%s/" % toolset_name)
|
||||
t.expect_output_lines("toolset-version: /%s/" % toolset_version)
|
||||
|
||||
t.cleanup()
|
||||
|
||||
@@ -129,7 +129,7 @@ def test_default_toolset_on_os( os, expected_toolset ):
|
||||
# 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 %
|
||||
t.expect_output_lines(configuring_default_toolset_message %
|
||||
expected_toolset)
|
||||
|
||||
t.cleanup()
|
||||
@@ -192,10 +192,10 @@ notfile testTarget
|
||||
""" % {'toolset_name': toolset_name})
|
||||
|
||||
t.run_build_system()
|
||||
t.expect_output_line(configuring_default_toolset_message % toolset_name)
|
||||
t.expect_output_line("descriptions: /conditioned-requirement/ "
|
||||
t.expect_output_lines(configuring_default_toolset_message % toolset_name)
|
||||
t.expect_output_lines("descriptions: /conditioned-requirement/ "
|
||||
"/target-requirement/ /toolset-requirement/")
|
||||
t.expect_output_line("toolset: /%s/" % toolset_name)
|
||||
t.expect_output_lines("toolset: /%s/" % toolset_name)
|
||||
|
||||
t.cleanup()
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ t.expect_addition("bin/$toolset/debug/mp.pathlist")
|
||||
es1 = t.adjust_names("a/bin/$toolset/debug")[0]
|
||||
es2 = t.adjust_names("b/bin/$toolset/debug")[0]
|
||||
|
||||
t.expect_content_line("bin/$toolset/debug/mp.pathlist", "*" + es1);
|
||||
t.expect_content_line("bin/$toolset/debug/mp.pathlist", "*" + es2);
|
||||
t.expect_content_lines("bin/$toolset/debug/mp.pathlist", "*" + es1);
|
||||
t.expect_content_lines("bin/$toolset/debug/mp.pathlist", "*" + es2);
|
||||
|
||||
t.cleanup()
|
||||
|
||||
@@ -15,7 +15,7 @@ t.write("jamfile.jam", "build-project subdir ;")
|
||||
t.write("subdir/jamfile.jam", 'ECHO "Loaded subdir" ;')
|
||||
|
||||
t.run_build_system(subdir="subdir")
|
||||
t.expect_output_line("Loaded subdir")
|
||||
t.expect_output_lines("Loaded subdir")
|
||||
|
||||
|
||||
# Regression test for a more contrived case. The top-level Jamfile refers to
|
||||
|
||||
@@ -15,7 +15,7 @@ t.write("jamroot.jam", "lib hello : hello.cpp ;")
|
||||
t.write("hello.cpp", "int main() {}\n")
|
||||
|
||||
t.run_build_system(["runtime-link=static"])
|
||||
t.expect_output_line("warning: On gcc, DLLs can not be built with "
|
||||
t.expect_output_lines("warning: On gcc, DLLs can not be built with "
|
||||
"'<runtime-link>static'.")
|
||||
t.expect_nothing_more()
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ my-obj other-obj : source.extension ;
|
||||
""")
|
||||
|
||||
t.run_build_system()
|
||||
t.expect_output_line("Generating a CPP file...")
|
||||
t.expect_output_lines("Generating a CPP file...")
|
||||
t.expect_addition("bin/$toolset/debug/dummy.my_obj")
|
||||
t.expect_addition("Other/bin/$toolset/debug/other-obj.cpp")
|
||||
t.expect_addition("Other/bin/$toolset/debug/other-obj.my_obj")
|
||||
|
||||
@@ -226,9 +226,9 @@ nm-exe e : e.cpp ;
|
||||
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_lines("%s/obj_1.my_obj" % folder, " Sources: 'z.cpp'")
|
||||
t.expect_content_lines("%s/obj_2.my_obj" % folder, " Sources: 'z.cpp'")
|
||||
t.expect_content_lines("%s/a.my_obj" % folder, " Sources: 'a.cpp'")
|
||||
|
||||
lines = t.stdout().splitlines()
|
||||
source_lines = [x for x in lines if re.match("^ Sources: '", x)]
|
||||
@@ -305,8 +305,8 @@ ddd _xxx : _xxx._a ;
|
||||
t.run_build_system(status=status)
|
||||
|
||||
if status:
|
||||
t.expect_output_line("*.bbX-to-ccc: source targets have different "
|
||||
"names: cannot determine target name")
|
||||
t.expect_output_lines("*.bbX-to-ccc: source targets have "
|
||||
"different names: cannot determine target name")
|
||||
else:
|
||||
def suffix(rename):
|
||||
if rename: return "_x"
|
||||
|
||||
@@ -66,6 +66,6 @@ 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")
|
||||
t.expect_output_lines("Running parent-rule")
|
||||
|
||||
t.cleanup()
|
||||
|
||||
@@ -31,6 +31,6 @@ t.fail_test(t.stdout().find("echo hi") == -1)
|
||||
|
||||
name = t.adjust_names("bin/$toolset/debug/hello.exe")[0]
|
||||
name = apply(os.path.join, name.split("/"));
|
||||
t.expect_output_line(" valgrind *%s " % name)
|
||||
t.expect_output_lines(" valgrind *%s " % name)
|
||||
|
||||
t.cleanup()
|
||||
|
||||
@@ -87,7 +87,7 @@ exe a : [ glob-tree foo/*.cpp bar/*.cpp : bad* ] ../d2/d//l ;
|
||||
""")
|
||||
|
||||
t.run_build_system(subdir="d1", status=1)
|
||||
t.expect_output_line("error: The patterns * may not include directory")
|
||||
t.expect_output_lines("error: The patterns * may not include directory")
|
||||
|
||||
|
||||
# Test that 'glob' works with absolute names.
|
||||
|
||||
@@ -39,9 +39,9 @@ if $(sorted-data) != $(target-data)
|
||||
""")
|
||||
|
||||
t.run_build_system()
|
||||
t.expect_output_line("starting up")
|
||||
t.expect_output_line("done")
|
||||
t.expect_output_line("SORT error", False)
|
||||
t.expect_output_lines("starting up")
|
||||
t.expect_output_lines("done")
|
||||
t.expect_output_lines("SORT error", False)
|
||||
|
||||
t.cleanup()
|
||||
|
||||
@@ -79,8 +79,8 @@ NOCARE all ;
|
||||
f.close()
|
||||
|
||||
t.run_build_system(expected_duration=1)
|
||||
t.expect_output_line("starting up")
|
||||
t.expect_output_line("done")
|
||||
t.expect_output_lines("starting up")
|
||||
t.expect_output_lines("done")
|
||||
|
||||
t.cleanup()
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ exe a : a.cpp ;
|
||||
|
||||
t.run_build_system(subdir="version-1.32.0")
|
||||
t.expect_addition("version-1.32.0/bin/$toolset/debug/a.exe")
|
||||
t.expect_output_line("The tag rule has been invoked.")
|
||||
t.expect_output_lines("The tag rule has been invoked.")
|
||||
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -87,9 +87,9 @@ obj xxx : xxx.rc ;
|
||||
params.append("-n")
|
||||
params.append("-sNOEXEC=NOEXEC")
|
||||
t.run_build_system(params)
|
||||
t.expect_output_line("*NOEXEC*", noexec)
|
||||
t.expect_output_lines("*NOEXEC*", noexec)
|
||||
obj_file = "xxx_res.obj"
|
||||
t.expect_output_line("compile.resource.dummy *%s" % obj_file, expect)
|
||||
t.expect_output_lines("compile.resource.dummy *%s" % obj_file, expect)
|
||||
if expect and not noexec:
|
||||
expect("bin/%s/debug/%s" % (toolsetName, obj_file))
|
||||
t.expect_nothing_more()
|
||||
|
||||
@@ -27,7 +27,7 @@ test-suite testit : [ run ../TestSource/test.cpp ] ;
|
||||
t.write("TestSource/test.cpp", "int main() {}\n")
|
||||
|
||||
t.run_build_system(subdir="TestBuild")
|
||||
t.expect_output_line('boost-test(RUN) "*/TestBuild/test" : '
|
||||
t.expect_output_lines('boost-test(RUN) "*/TestBuild/test" : '
|
||||
'"../TestSource/test.cpp"')
|
||||
|
||||
t.cleanup()
|
||||
|
||||
@@ -121,9 +121,9 @@ time my-time : my-exe ;
|
||||
t.expect_addition("bin/$toolset/debug/my-exe.exe")
|
||||
t.expect_addition("bin/$toolset/debug/my-time.time")
|
||||
|
||||
t.expect_content_line("bin/$toolset/debug/my-time.time",
|
||||
t.expect_content_lines("bin/$toolset/debug/my-time.time",
|
||||
"user: *[0-9] seconds")
|
||||
t.expect_content_line("bin/$toolset/debug/my-time.time",
|
||||
t.expect_content_lines("bin/$toolset/debug/my-time.time",
|
||||
"system: *[0-9] seconds")
|
||||
|
||||
t.cleanup()
|
||||
@@ -157,8 +157,8 @@ time "my time" : "my exe" ;
|
||||
t.expect_addition("bin/$toolset/debug/my exe.exe")
|
||||
t.expect_addition("bin/$toolset/debug/my time.time")
|
||||
|
||||
t.expect_content_line("bin/$toolset/debug/my time.time", "user: *")
|
||||
t.expect_content_line("bin/$toolset/debug/my time.time", "system: *")
|
||||
t.expect_content_lines("bin/$toolset/debug/my time.time", "user: *")
|
||||
t.expect_content_lines("bin/$toolset/debug/my time.time", "system: *")
|
||||
|
||||
t.cleanup()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user