Skip to content

Commit

Permalink
Merge pull request #3231 from mwichmann/mdw-no-cl-syntax
Browse files Browse the repository at this point in the history
Fix some problems found if no MS compiler at all
  • Loading branch information
bdbaddog committed Nov 7, 2018
2 parents 9685d23 + 218cee6 commit fd0ee66
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 14 deletions.
1 change: 1 addition & 0 deletions src/CHANGES.txt
Expand Up @@ -166,6 +166,7 @@ RELEASE 3.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE
Three uses of variables not defined are changed.
- Some script changes in trying to find scons engine
- Update (pep8) configure-cache script, add a --show option.
- Fix for a couple of "what if tool not found" exceptions in framework.

From Bernhard M. Wiedemann:
- Update SCons' internal scons build logic to allow overriding build date
Expand Down
22 changes: 16 additions & 6 deletions testing/framework/TestCmd.py
Expand Up @@ -1579,18 +1579,28 @@ def stderr(self, run=None):
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)
elif run < 0:
run = len(self._stdout) + run
run = run - 1
return self._stdout[run]
try:
return self._stdout[run]
except IndexError:
return None

def subdir(self, *subdirs):
"""Create new subdirectories under the temporary working
Expand Down
25 changes: 17 additions & 8 deletions testing/framework/TestSCons.py
Expand Up @@ -293,24 +293,33 @@ def Environment(self, ENV=None, *args, **kw):

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:
prog = v
if v != prog:
return None
result = env.WhereIs(prog)
if norm and os.sep != '/':
if result and norm and os.sep != '/':
result = result.replace(os.sep, '/')
return result

Expand Down

0 comments on commit fd0ee66

Please sign in to comment.