summaryrefslogtreecommitdiff
path: root/QMTest
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-04-03 10:32:45 -0400
committerWilliam Deegan <bill@baddogconsulting.com>2017-04-03 10:32:45 -0400
commit7c4b5f645cf070148436e62110cb4ed891d28ce3 (patch)
treecbf0b80e17f8836f8fec0aca0829378020c5d657 /QMTest
parent9cc0868fc72a001bf028b196e9bf23fa114cac44 (diff)
downloadscons-7c4b5f645cf070148436e62110cb4ed891d28ce3.tar.gz
Create docstring for checkLogAndStdout. Add useful comments as well
Diffstat (limited to 'QMTest')
-rw-r--r--QMTest/TestSCons.py31
1 files changed, 30 insertions, 1 deletions
diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py
index b9d7377d..adc7db45 100644
--- a/QMTest/TestSCons.py
+++ b/QMTest/TestSCons.py
@@ -1031,7 +1031,24 @@ SConscript( sconscript )
def checkLogAndStdout(self, checks, results, cached,
logfile, sconf_dir, sconstruct,
- doCheckLog=1, doCheckStdout=1):
+ doCheckLog=True, doCheckStdout=True):
+ """
+
+ Parameters
+ ----------
+ checks
+ results
+ cached
+ logfile
+ sconf_dir
+ sconstruct
+ doCheckLog : check specified log file, defaults to true
+ doCheckStdout : Check stdout, defaults to true
+
+ Returns
+ -------
+
+ """
class NoMatch(Exception):
def __init__(self, p):
@@ -1043,6 +1060,13 @@ SConscript( sconscript )
raise NoMatch(lastEnd)
return m.end() + lastEnd
try:
+
+ # Build regexp for a character which is not
+ # a linesep, and in the case of CR/LF
+ # build it with both CR and CR/LF
+ # TODO: Not sure why this is a good idea. A static string
+ # could do the same since we only have two variations
+ # to do with?
ls = os.linesep
nols = "("
for i in range(len(ls)):
@@ -1054,6 +1078,8 @@ SConscript( sconscript )
nols = nols + "|"
nols = nols + ")"
lastEnd = 0
+
+ # Read the whole logfile
logfile = self.read(self.workpath(logfile), mode='r')
# Some debug code to keep around..
@@ -1063,13 +1089,16 @@ SConscript( sconscript )
logfile.find( "scons: warning: The stored build "
"information has an unexpected class." ) >= 0):
self.fail_test()
+
sconf_dir = sconf_dir
sconstruct = sconstruct
log = r'file\ \S*%s\,line \d+:' % re.escape(sconstruct) + ls
if doCheckLog: lastEnd = matchPart(log, logfile, lastEnd)
+
log = "\t" + re.escape("Configure(confdir = %s)" % sconf_dir) + ls
if doCheckLog: lastEnd = matchPart(log, logfile, lastEnd)
+
rdstr = ""
cnt = 0
for check,result,cache_desc in zip(checks, results, cached):