This is an archive of the discontinued LLVM Phabricator instance.

[asan] Add support for running lit tests in the iOS Simulator
ClosedPublic

Authored by kubamracek on Mar 29 2017, 12:59 PM.

Details

Summary

Hi, this patch adds a basic support for running the ASan lit test suite against an iOS Simulator. This is done by generating more lit.site.cfg configurations into subdirectories such as IOSSimI386Config and IOSSimX86_64Config. These test suites are not added into "check-all" or into "check-asan" (and I don't even plan to add them there), and they have to be run manually, plus you need to specify which device to use (you usually have plenty of simulators installed):

$ SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER=BBE44C1C-8AAA-4000-8D06-91C89ED58172
$ ./bin/llvm-lit ./projects/compiler-rt/test/asan/IOSSimI386Config

There will be plenty of failing tests, but I'll work on those later.

Diff Detail

Repository
rL LLVM

Event Timeline

kubamracek created this revision.Mar 29 2017, 12:59 PM
filcab edited edge metadata.Mar 30 2017, 6:06 AM

We should probably mention what the SANITIZER_IOS_TEST_DEVICE_IDENTIFIER and SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER variables should contain, and how to get those values.

test/asan/lit.cfg
110 ↗(On Diff #93400)

Please split this cleanup into a separate change (or just commit it separately)

127 ↗(On Diff #93400)

Don't add the %run substitution only to remove it later, please.
It will make it harder to figure out what the actual %run substitution is. Adding a if config.host_os != 'Darwin' or not config.iossim should be enough.

test/asan/lit.site.cfg.in
11 ↗(On Diff #93400)

Please use pythonize_bool and the _PYBOOL versions of these.

filcab added inline comments.Mar 30 2017, 6:08 AM
test/asan/lit.cfg
138 ↗(On Diff #93400)

Please choose only one of these unless there's a very good reason to have different ones.

Actually: Please don't add features unless you need them (and add a test-case showing they're needed when you add them).

kubamracek updated this revision to Diff 93696.Mar 31 2017, 1:08 PM

Addressing review comments. Removed things that aren't immediately used. Using pythonize_bool.

We should probably mention what the SANITIZER_IOS_TEST_DEVICE_IDENTIFIER and SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER variables should contain, and how to get those values.

Each iOS device and simulator has a UUID, you can find it in Xcode in "Devices" window.

Is this okay to land?

eugenis accepted this revision.Apr 25 2017, 2:45 PM
This revision is now accepted and ready to land.Apr 25 2017, 2:45 PM
This revision was automatically updated to reflect the committed changes.