diff --git a/v2/test/BoostBuild.py b/v2/test/BoostBuild.py index 209ab0219..1779455e9 100644 --- a/v2/test/BoostBuild.py +++ b/v2/test/BoostBuild.py @@ -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 diff --git a/v2/test/dll_path.py b/v2/test/dll_path.py index 4e37363a0..cdf640e20 100644 --- a/v2/test/dll_path.py +++ b/v2/test/dll_path.py @@ -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() diff --git a/v2/test/library_chain.py b/v2/test/library_chain.py index e211b9baf..958609027 100644 --- a/v2/test/library_chain.py +++ b/v2/test/library_chain.py @@ -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 ;