Boost logo

Boost-Commit :

From: jurko.gospodnetic_at_[hidden]
Date: 2008-01-06 02:26:46


Author: jurko
Date: 2008-01-06 02:26:46 EST (Sun, 06 Jan 2008)
New Revision: 42513
URL: http://svn.boost.org/trac/boost/changeset/42513

Log:
Upgraded the tool for testing that a certain line exists in the given output support so that it now also knows how to test that a certain line does not exist in the given output.
Text files modified:
   trunk/tools/build/v2/test/BoostBuild.py | 17 +++++++++++------
   1 files changed, 11 insertions(+), 6 deletions(-)

Modified: trunk/tools/build/v2/test/BoostBuild.py
==============================================================================
--- trunk/tools/build/v2/test/BoostBuild.py (original)
+++ trunk/tools/build/v2/test/BoostBuild.py 2008-01-06 02:26:46 EST (Sun, 06 Jan 2008)
@@ -611,7 +611,7 @@
             self.unexpected_difference.pprint()
             self.fail_test(1)
 
- def _expect_line(self, content, expected):
+ def _expect_line(self, content, expected, expected_to_exist):
         expected = expected.strip()
         lines = content.splitlines()
         found = 0
@@ -621,18 +621,23 @@
                 found = 1
                 break
 
- if not found:
+ 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))
+ self.fail_test(1)
 
- def expect_output_line(self, line):
- self._expect_line(self.stdout(), line)
+ def expect_output_line(self, line, expected_to_exist=True):
+ self._expect_line(self.stdout(), line, expected_to_exist)
 
- def expect_content_line(self, name, line):
+ def expect_content_line(self, name, line, expected_to_exist=True):
         content = self._read_file(name)
- self._expect_line(content, line)
+ self._expect_line(content, line, expected_to_exist)
 
     def _read_file(self, name, exact=0):
         name = self.adjust_names(name)[0]


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