diff options
-rw-r--r-- | testing/framework/TestCmd.py | 17 | ||||
-rw-r--r-- | testing/framework/TestSCons.py | 23 |
2 files changed, 28 insertions, 12 deletions
diff --git a/testing/framework/TestCmd.py b/testing/framework/TestCmd.py index 6699d88..cccbccb 100644 --- a/testing/framework/TestCmd.py +++ b/testing/framework/TestCmd.py @@ -1579,11 +1579,18 @@ class TestCmd(object): return self._stderr[run] def stdout(self, run=None): - """Returns the standard output from the specified run number. - If there is no specified run number, then returns the standard - output of the last run. If the run number is less than zero, - then returns the standard output from that many runs back from - the current run. + """ + Returns the stored standard output from a given run. + + Args: + run: run number to select. If run number is omitted, + return the standard output of the most recent run. + If negative, use as a relative offset, so that -2 + means the run two prior to the most recent. + + Returns: + selected stdout string or None if there are no + stored runs. """ if not run: run = len(self._stdout) diff --git a/testing/framework/TestSCons.py b/testing/framework/TestSCons.py index 69d4bd5..c3018f0 100644 --- a/testing/framework/TestSCons.py +++ b/testing/framework/TestSCons.py @@ -293,16 +293,25 @@ class TestSCons(TestCommon): def detect(self, var, prog=None, ENV=None, norm=None): """ - Detect a program named 'prog' by first checking the construction - variable named 'var' and finally searching the path used by - SCons. If either method fails to detect the program, then false - is returned, otherwise the full path to prog is returned. If - prog is None, then the value of the environment variable will be - used as prog. + Return the detected path to a tool program. + + Searches first the named construction variable, then + the SCons path. + + Args: + var: name of construction variable to check for tool name. + prog: tool program to check for. + ENV: if present, kwargs to initialize an environment that + will be created to perform the lookup. + norm: if true, normalize any returned path looked up in + the environment to use UNIX-style path separators. + + Returns: full path to the tool, or None. + """ env = self.Environment(ENV) if env: - v = env.subst('$'+var) + v = env.subst('$' + var) if not v: return None if prog is None: |