summaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2018-11-05 18:41:05 (GMT)
committerMats Wichmann <mats@linux.com>2018-11-05 18:41:05 (GMT)
commit218cee62225eb816258a76063fc2c62cdbf42be5 (patch)
treefc345e536b36a1b05b557d81ed5ac62baa8b4b4d /testing
parentd5e8a048c87eac0361f14911a2d224bfb94884f0 (diff)
downloadSCons-218cee62225eb816258a76063fc2c62cdbf42be5.zip
SCons-218cee62225eb816258a76063fc2c62cdbf42be5.tar.gz
SCons-218cee62225eb816258a76063fc2c62cdbf42be5.tar.bz2
For PR #3231, update some docstrings per review
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'testing')
-rw-r--r--testing/framework/TestCmd.py17
-rw-r--r--testing/framework/TestSCons.py23
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: