<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Thanks for the fast review!<div><br></div><div>Here are your proposed changes:</div><div><br></div><div><br></div><div><div>diff --git a/lnt/testing/util/commands.py b/lnt/testing/util/commands.py</div><div>index 39d12ea198791a58aeed230193bc5404580465de..4f0d2e8f489659905f9098e201415c4b83b97de6 100644</div><div>--- a/lnt/testing/util/commands.py</div><div>+++ b/lnt/testing/util/commands.py</div><div>@@ -94,3 +94,29 @@ def which(command, paths = None):</div><div>                 return p</div><div> </div><div>     return None</div><div>+</div><div>+def resolve_command_path(name):</div><div>+    """Try to make the name/path given into an absolute path to an</div><div>+    executable.</div><div>+</div><div>+    """</div><div>+    # If the given name exists (or is a path), make it absolute.</div><div>+    if os.path.exists(name):</div><div>+        return os.path.abspath(name)</div><div>+</div><div>+    # Otherwise we most likely have a command name, try to look it up.</div><div>+    path = which(name)</div><div>+    if path is not None:</div><div>+        note("resolved command %r to path %r" % (name, path))</div><div>+        return path</div><div>+</div><div>+    # If that failed just return the original name.</div><div>+    return name</div><div>+</div><div>+def isexecfile(path):</div><div>+    """Does this path point to a valid executable?</div><div>+</div><div>+    """</div><div>+    return os.path.isfile(path) and os.access(path, os.X_OK)</div><div>+</div><div>+</div><div>diff --git a/lnt/tests/compile.py b/lnt/tests/compile.py</div><div>index 77a235da7fcfb55b558ef246ef71acf5d1531d94..69a7cc5db122b260d5e9f634a8caaa3dffaaed54 100644</div><div>--- a/lnt/tests/compile.py</div><div>+++ b/lnt/tests/compile.py</div><div>@@ -15,7 +15,9 @@ from datetime import datetime</div><div> </div><div> import lnt.testing</div><div> import lnt.testing.util.compilers</div><div>-from lnt.testing.util.commands import note, warning, error, fatal</div><div>+from lnt.testing.util.commands import note, warning, error, fatal, \</div><div>+    resolve_command_path, isexecfile</div><div>+</div><div> from lnt.testing.util.misc import TeeStream, timestamp</div><div> from lnt.testing.util import commands, machineinfo</div><div> from lnt.util import stats</div><div>@@ -750,6 +752,13 @@ class CompileTest(builtintest.BuiltinTest):</div><div>         if len(args) != 0:</div><div>             parser.error("invalid number of arguments")</div><div> </div><div>+        # Resolve the cc_under_test path.</div><div>+        <a href="http://opts.cc">opts.cc</a> = resolve_command_path(<a href="http://opts.cc">opts.cc</a>)</div><div>+</div><div>+        if not isexecfile(<a href="http://opts.cc">opts.cc</a>):</div><div>+            parser.error('--cc does not point to a valid executable.')</div><div>+</div><div>+</div><div>         # Attempt to infer the cxx compiler if not given.</div><div>         if <a href="http://opts.cc">opts.cc</a> and opts.cxx is None:</div><div>             opts.cxx = lnt.testing.util.compilers.infer_cxx_compiler(<a href="http://opts.cc">opts.cc</a>)</div><div>diff --git a/lnt/tests/nt.py b/lnt/tests/nt.py</div><div>index cefb38c42c7c05cc24df76bc263e93cb50b7b09b..cb138cb51d235af73f5df4d516532cd05de7e5b0 100644</div><div>--- a/lnt/tests/nt.py</div><div>+++ b/lnt/tests/nt.py</div><div>@@ -14,8 +14,8 @@ from datetime import datetime</div><div> import lnt.testing</div><div> import lnt.testing.util.compilers</div><div> </div><div>-from lnt.testing.util.commands import note, warning, error, fatal</div><div>-from lnt.testing.util.commands import capture, mkdir_p, which</div><div>+from lnt.testing.util.commands import note, warning, error, fatal, \</div><div>+    capture, mkdir_p, resolve_command_path, isexecfile</div><div> from lnt.testing.util.rcs import get_source_version</div><div> from lnt.testing.util.misc import timestamp</div><div> </div><div>@@ -387,20 +387,6 @@ class TestConfiguration(object):</div><div>         </div><div> ###</div><div> </div><div>-def resolve_command_path(name):</div><div>-    # If the given name exists (or is a path), make it absolute.</div><div>-    if os.path.exists(name):</div><div>-        return os.path.abspath(name)</div><div>-</div><div>-    # Otherwise we most likely have a command name, try to look it up.</div><div>-    path = which(name)</div><div>-    if path is not None:</div><div>-        note("resolved command %r to path %r" % (name, path))</div><div>-        return path</div><div>-</div><div>-    # If that failed just return the original name.</div><div>-    return name</div><div>-</div><div> def scan_for_test_modules(config):</div><div>     base_modules_path = os.path.join(config.test_suite_root, 'LNTBased')</div><div>     if config.only_test is None:</div><div>@@ -1339,6 +1325,9 @@ class NTTest(builtintest.BuiltinTest):</div><div>         # Resolve the cc_under_test path.</div><div>         <a href="http://opts.cc">opts.cc</a>_under_test = resolve_command_path(<a href="http://opts.cc">opts.cc</a>_under_test)</div><div> </div><div>+        if not isexecfile(<a href="http://opts.cc">opts.cc</a>_under_test):</div><div>+            parser.error('--cc does not point to a valid executable.')</div><div>+</div><div>         # If there was no --cxx given, attempt to infer it from the --cc.</div><div>         if opts.cxx_under_test is None:</div><div>             opts.cxx_under_test = lnt.testing.util.compilers.infer_cxx_compiler(</div><div><br></div><div><br></div><div> </div><div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"></div></div></div></div></div></div></body></html>