2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-15 13:02:11 +00:00

Revive some more tests

[SVN r35968]
This commit is contained in:
Vladimir Prus
2006-11-10 07:40:42 +00:00
parent 197452b70f
commit b465fea87f
3 changed files with 25 additions and 11 deletions

View File

@@ -524,9 +524,9 @@ class Tester(TestCmd.TestCmd):
self.unexpected_difference.pprint()
self.fail_test(1)
def expect_output_line(self, expected):
def _expect_line(self, content, expected):
expected = expected.strip()
lines = self.stdout().splitlines()
lines = content.splitlines()
found = 0
for line in lines:
line = line.strip()
@@ -537,19 +537,33 @@ class Tester(TestCmd.TestCmd):
if not found:
print "Did not found expected line in output:"
print expected
print "The output was:"
print content
self.fail_test(1)
def expect_content(self, name, content, exact=0):
def expect_output_line(self, expected):
self._expect_line(self.stdout(), expected)
def expect_content_line(self, name, expected):
content = self._read_file(name)
self._expect_line(content, expected)
def _read_file(self, name, exact=0):
name = self.adjust_names(name)[0]
result = ""
try:
if exact:
actual = self.read(name)
result = self.read(name)
else:
actual = string.replace(self.read_and_strip(name), "\\", "/")
result = string.replace(self.read_and_strip(name), "\\", "/")
except IOError:
print "Note: could not open file", name
self.fail_test(1)
return result
def expect_content(self, name, content, exact=0):
actual = self._read_file(name, exact)
content = string.replace(content, "$toolset", self.toolset+"*")
matched = 0

View File

@@ -119,10 +119,9 @@ 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]
content = t.read("bin/$toolset/debug/mp.pathlist")
t.fail_test(find(content, es1) == -1)
t.fail_test(find(content, es2) == -1)
t.expect_content_line("bin/$toolset/debug/mp.pathlist", "*" + es1);
t.expect_content_line("bin/$toolset/debug/mp.pathlist", "*" + es2);
t.cleanup()

View File

@@ -114,6 +114,7 @@ t.rm(".")
t.write("Jamroot", "")
t.write("a/Jamfile", """
lib a : a.cpp ;
install dist : a ;
""")
t.write("a/a.cpp", """
#if defined(_WIN32)
@@ -122,12 +123,12 @@ __declspec(dllexport)
void a() {}
""")
t.run_build_system(subdir="a")
t.expect_addition("a/bin/$toolset/debug/a.dll")
t.expect_addition("a/dist/a.dll")
if (os.name == 'nt' or os.uname()[0].lower().startswith('cygwin')) and get_toolset() != 'gcc':
file = t.adjust_names(["a/bin/$toolset/debug/a.lib"])[0]
file = t.adjust_names(["a/dist/a.lib"])[0]
else:
file = t.adjust_names(["a/bin/$toolset/debug/a.dll"])[0]
file = t.adjust_names(["a/dist/a.dll"])[0]
t.write("b/Jamfile", """
lib b : b.cpp ../%s ;