[lldb-dev] test decorator working on linux, but not on windows
Ted Woodward via lldb-dev
lldb-dev at lists.llvm.org
Fri Jan 6 13:41:26 PST 2017
Bottom line: lldbutil.is_exe() does not think “foo” is an exe on windows when “foo.exe” is.
print("***compiler is:", self.getCompiler(), file=sys.stderr)
***compiler is: C:\lldb\8.0\llvm\tools\lldb\packages\Python\lldbsuite\test\lang\c\typedef
self.getCompiler() is returning the test directory.
So, _decorateTest’s line:
skip_for_compiler = _match_decorator_property(compiler, self.getCompiler()) and self.expectedCompilerVersion(compiler_version)
is trying to match with the test directory.
On Linux I get this:
***compiler is: /prj/dsp/qdsp6/release/internal/branch-8.0/linux64/toolset-4199/Tools/bin/clang-3.9
The path to the compiler (hexagon-clang is a symlink to clang-3.9).
Builder_base.getCompiler is:
def getCompiler():
"""Returns the compiler in effect the test suite is running with."""
compiler = os.environ.get("CC", "clang")
compiler = lldbutil.which(compiler)
return os.path.realpath(compiler)
os.environ.get returns r:/internal/branch-8.0/windows/latest/Tools/bin/hexagon-clang, but lldbutil.which returns None.
def which(program):
"""Returns the full path to a program; None otherwise."""
fpath, fname = os.path.split(program)
if fpath:
if is_exe(program):
return program
else:
for path in os.environ["PATH"].split(os.pathsep):
exe_file = os.path.join(path, program)
if is_exe(exe_file):
return exe_file
return None
The problem is the compiler – I specified hexagon-clang, not hexagon-clang.exe, so is_exe returns false.
def is_exe(fpath):
"""Returns True if fpath is an executable."""
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
My run line:
c:\lldb\8.0\35\Debug\libexec\python_d dotest.py -A v60 -C r:/internal/branch-8.0/windows/latest/Tools/bin/hexagon-clang --executable c:\lldb\8.0\35\Debug\bin\lldb.exe -t -v -p Testtypedef.py
Changing it to hexagon-clang.exe solved the problem.
--
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
From: Zachary Turner [mailto:zturner at google.com]
Sent: Friday, January 06, 2017 12:17 PM
To: Ted Woodward <ted.woodward at codeaurora.org>; LLDB <lldb-dev at lists.llvm.org>
Subject: Re: [lldb-dev] test decorator working on linux, but not on windows
You will probably need to debug the python code to figure out why this is happening. Start with this line in lldb/packages/Python/lldbsuite/test/decorators.py
def _decorateTest(mode,
bugnumber=None, oslist=None, hostoslist=None,
compiler=None, compiler_version=None,
archs=None, triple=None,
debug_info=None,
swig_version=None, py_version=None,
macos_version=None,
remote=None):
...
skip_for_compiler = _match_decorator_property(
compiler, self.getCompiler()) and self.expectedCompilerVersion(compiler_version)
On Fri, Jan 6, 2017 at 10:11 AM Ted Woodward via lldb-dev <lldb-dev at lists.llvm.org <mailto:lldb-dev at lists.llvm.org> > wrote:
packages/Python/lldbsuite/test/lang/c/typedef/Testtypedef.py has this decorator:
@expectedFailureAll(compiler="clang", bugnumber="llvm.org/pr19238 <http://llvm.org/pr19238> ")
On Linux, I’m building with hexagon-clang, and this decorator fires, so the test is xfailed.
On Windows, I’m building with hexagon-clang.exe, and this decorator is evidently not firing, because the test fails instead of being xfailed.
Linux is using Python 2.7.8. Windows is using Python 3.5.1.
--
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
_______________________________________________
lldb-dev mailing list
lldb-dev at lists.llvm.org <mailto:lldb-dev at lists.llvm.org>
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20170106/7538fbda/attachment.html>
More information about the lldb-dev
mailing list