HomePhabricator

[llvm-ar][test] Add tests failing on Darwin

Authored by gbreynoo on Jul 17 2019, 8:10 AM.

Description

[llvm-ar][test] Add tests failing on Darwin

These tests that failed on Darwin but passed on other machines due to the default archive format differing
on a Darwin machine, and what looks to be bugs in the output of this format.
I can not investigate these issue further so the tests are considered expected failures on Darwin.

Differential Revision: https://reviews.llvm.org/D64802

llvm-svn: 366334

Details

Committed
gbreynooJul 17 2019, 8:10 AM
Differential Revision
D64802: [llvm-ar][test] Add tests failing on Darwin
Parents
rG87886299b468: [lld] Add Visual Studio compatible diagnostics
Branches
Unknown
Tags
Unknown

Event Timeline

rogfer01 added inline comments.
/llvm/test/tools/llvm-ar/mri-utf8.test
19

This doesn't seem to work well if the en_US.UTF-8 locale is not installed (as Python then defaults to ASCII).

Explicitly encoding the text string as a bytes using utf-8 seems to work:

RUN: %python -c "assert open(u'\U000000A3.txt'.encode(\"utf-8\"), 'rb').read() == b'contents\n'"

Then the comment right above can be removed.

Mind to check if this works for you too? It seems to work fine for me both for python2 and python3.

gbreynoo marked an inline comment as done.Aug 7 2019, 7:11 AM
gbreynoo added inline comments.
/llvm/test/tools/llvm-ar/mri-utf8.test
19

Hi Roger,

You are correct that the locale is required to pass on linux. I had some trouble with this test as the behaviour of python in this area differs between linux / windows and python 2 / python 3. For example the solution you give above appears to be fine for linux but windows with python 2 fails:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
IOError: [Errno 2] No such file or directory: '\xc2\xa3.txt'

I do not like the reliance on the locale however the upstream buildbots all appear to have it installed. Maybe the test should be split into a windows test and a linux test?