This is an archive of the discontinued LLVM Phabricator instance.

[lit] Port googletest lit tests to Windows
ClosedPublic

Authored by rnk on Jul 26 2017, 12:00 PM.

Details

Summary

The technique of directly calling subprocess.Popen on a python script
doesn't work on Windows. The executable path of the command must refer
to a valid win32 executable.

Instead, rename all the python scripts masquerading as gtest executables
to have .py extensions, so we can easily detect then and call the python
executable for them. Do this on Linux as well as Windows for
consistency.

Fixes PR33933

Diff Detail

Repository
rL LLVM

Event Timeline

rnk created this revision.Jul 26 2017, 12:00 PM
modocache requested changes to this revision.Jul 26 2017, 12:19 PM

LGTM, but I want to double-check this passes for me locally. Also, I think you may have left some debugging code in here.

llvm/utils/lit/lit/formats/googletest.py
92 ↗(On Diff #108340)

My guess is that you may have added this for your own debugging? Or is this intentional?

llvm/utils/lit/tests/googletest-format.py
9 ↗(On Diff #108340)

This is interesting, why do we need to handle upper- and lower-case here? Could you explain this in the commit message?

This revision now requires changes to proceed.Jul 26 2017, 12:19 PM
rnk marked an inline comment as done.Jul 26 2017, 2:36 PM
rnk added inline comments.
llvm/utils/lit/lit/formats/googletest.py
92 ↗(On Diff #108340)

Yep, removed.

llvm/utils/lit/tests/googletest-format.py
9 ↗(On Diff #108340)

Because of this code:

class GoogleTest(TestFormat):
    def __init__(self, test_sub_dirs, test_suffix):
        self.test_sub_dirs = os.path.normcase(str(test_sub_dirs)).split(';')

Maybe we don't need it?

rnk updated this revision to Diff 108363.Jul 26 2017, 2:39 PM
rnk edited edge metadata.
rnk marked an inline comment as done.
  • remove debugging print
rnk added a comment.Jul 27 2017, 10:31 AM

LGTM, but I want to double-check this passes for me locally. Also, I think you may have left some debugging code in here.

Should I land the updated patch?

Yup! Sorry for the wait. This works for me! :)

modocache accepted this revision.Jul 27 2017, 12:33 PM
This revision is now accepted and ready to land.Jul 27 2017, 12:33 PM
This revision was automatically updated to reflect the committed changes.
llvm/trunk/utils/lit/tests/Inputs/googletest-timeout/DummySubDir/OneTest.py