This is an archive of the discontinued LLVM Phabricator instance.

[lit, lldbsuite] Update the lldbsuite to correctly run tests on windows and windows server
ClosedPublic

Authored by stella.stamenova on Apr 24 2018, 9:20 AM.

Details

Summary

The new script to run the lldbtests as part of lit invokes each test by calling dotest.py, however, we cannot rely on the system to always correctly interpret the script as python causing the tests to be unresolved on windows (at least). To fix this, we need to make sure that the first parameter in the command line is the python executable itself.

In Makefile.rules, there are a number of windows specific definitions that rely on the HOST_OS being set as Windows_NT but the logic detecting the OS currently does not detect server versions of windows correctly. This change updates the logic to detect windows server as well.

Diff Detail

Repository
rL LLVM

Event Timeline

JDevlieghere accepted this revision.Apr 24 2018, 9:23 AM

Thanks Stella, LGTM. Apologies for breaking all this Windows stuff! :(

This revision is now accepted and ready to land.Apr 24 2018, 9:23 AM
labath added inline comments.Apr 24 2018, 9:29 AM
lit/Suite/lldbtest.py
47

Do we need to worry about picking the correct python/python_d for release vs. debug builds?

zturner added inline comments.
lit/Suite/lldbtest.py
47

If it's a debug build, sys.executable should already be python_d.exe. So this should be correct.

My question though, is where does self.dotest_cmd come from? Would it ever be the case that this already has the python executable? Then you'd have an error because it would be specified twice.

lit/Suite/lldbtest.py
47

Currently, dotest_cmd is hardcoded in the lldb suite lit.cfg to point to dotest_path (+some arguments) and dotest_path itself is hardcoded in lldb-dotest.in to point to the dotest.py script.

I considered testing whether the command contained python before adding it, but since the command is currently hardcoded to point to dotest.py, it seemed wasteful.

zturner accepted this revision.Apr 24 2018, 9:46 AM
zturner added inline comments.
lit/Suite/lldbtest.py
47

This seems fine to me then. I have a mild preference for prepending sys.executable from inside of lit.cfg and then putting an assertion here that sys.executable is present as the first argument, but it's up to you, if you like that too you can do it, otherwise this is fine as is IMO.

labath added inline comments.Apr 24 2018, 9:47 AM
lit/Suite/lldbtest.py
47

If it's a debug build, sys.executable should already be python_d.exe. So this should be correct.

I was worried that the python executable we use to run lit may not be the same one as we need to use for lldb testing in a specific build configuration (I remember there being some confusion about that in the past). But If you think it fine, then I'm ok as well. (it only matters for VS builds anyway).

asmith closed this revision.Apr 24 2018, 10:11 AM