This is an archive of the discontinued LLVM Phabricator instance.

[lit] Fix several tests that fail when using Python 3 or on Windows
ClosedPublic

Authored by stella.stamenova on May 11 2018, 1:45 PM.

Details

Summary
  1. In logtest.cpp, the name of the file that is reported is not always capitalized, so split the comparison to validate the file (case insensitive) and function (case sensitive) separately
  2. Update the gdb remote client tests to work with Python 3. In Python 3, socket sends/receives data as bytes rather than byte strings. This also updates the usage of .hex() - this is no longer available in Python 3, so use hexlify instead

Diff Detail

Repository
rL LLVM

Event Timeline

zturner added inline comments.May 11 2018, 2:53 PM
packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py
281–285 ↗(On Diff #146405)

It's a shame that we're not using lit here. lit has a nice function lit.util.to_string which handles this (and one other strange edge case) correctly.

389–392 ↗(On Diff #146405)

Similarly here.

labath accepted this revision.May 14 2018, 1:35 AM
This revision is now accepted and ready to land.May 14 2018, 1:35 AM
packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py
281–285 ↗(On Diff #146405)

I looked into using it - but currently none of the lldb tests use functionality from lit and I don't think there's a good way to do so. Let me know if you have a suggestion, but otherwise, I think this is the least impactful change that fixes the tests.

No it's fine, I was just thinking out loud.

This revision was automatically updated to reflect the committed changes.