diff options
author | Robert Managan <ramanagan@att.net> | 2012-12-18 23:09:21 (GMT) |
---|---|---|
committer | Robert Managan <ramanagan@att.net> | 2012-12-18 23:09:21 (GMT) |
commit | b91167a75ea49620ea587482df0efd30d9a9cf16 (patch) | |
tree | 5767433bfda9d36e134af9b09446db20ddd34f0b /QMTest/TestSCons.py | |
parent | 5758e27903c4e584b08ad2d69fa80884894e140e (diff) | |
parent | 02cae725ed116ae6cd996fe3bf5888f7f8f61b97 (diff) | |
download | SCons-b91167a75ea49620ea587482df0efd30d9a9cf16.zip SCons-b91167a75ea49620ea587482df0efd30d9a9cf16.tar.gz SCons-b91167a75ea49620ea587482df0efd30d9a9cf16.tar.bz2 |
update to latest SCons commits
Diffstat (limited to 'QMTest/TestSCons.py')
-rw-r--r-- | QMTest/TestSCons.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py index 296af67..ea18757 100644 --- a/QMTest/TestSCons.py +++ b/QMTest/TestSCons.py @@ -108,7 +108,35 @@ def re_escape(str): str = str.replace(c, '\\' + c) return str +# +# Helper functions that we use as a replacement to the default re.match +# when searching for special strings in stdout/stderr. +# +def search_re(out, l): + """ Search the regular expression 'l' in the output 'out' + and return the start index when successful. + """ + m = re.search(l, out) + if m: + return m.start() + + return None + +def search_re_in_list(out, l): + """ Search the regular expression 'l' in each line of + the given string list 'out' and return the line's index + when successful. + """ + for idx, o in enumerate(out): + m = re.search(l, o) + if m: + return idx + + return None +# +# Helpers for handling Python version numbers +# def python_version_string(): return sys.version.split()[0] |