This is an archive of the discontinued LLVM Phabricator instance.

[GWP-ASan] Port tests to Fuchsia
ClosedPublic

Authored by cryptoad on Nov 16 2020, 3:34 PM.

Details

Summary

This modifies the tests so that they can be run on Fuchsia:

  • add the necessary includes for set/vector etc
  • do the few modifications required to use zxtest instead og gtest

backtrace.cpp requires stacktrace support that Fuchsia doesn't have
yet, and enable_disable.cpp currently uses fork() which Fuchsia
doesn't support yet. I'll revisit this later.

I chose to use harness.h to hold my "platform-specific" include and
namespace, and using this header in tests rather than gtest.h,
which I am open to change if someone would rather go another direction.

Diff Detail

Event Timeline

cryptoad created this revision.Nov 16 2020, 3:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 16 2020, 3:34 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
cryptoad requested review of this revision.Nov 16 2020, 3:34 PM
hctim accepted this revision.Nov 17 2020, 2:15 PM

If we need to have more platform-specific code then we'll look at adding a platform-specific subfolder to tests, but I'm okay with this as is.

This revision is now accepted and ready to land.Nov 17 2020, 2:15 PM
This revision was landed with ongoing or failed builds.Nov 18 2020, 1:36 PM
This revision was automatically updated to reflect the committed changes.
phosek added inline comments.Nov 18 2020, 1:42 PM
compiler-rt/lib/gwp_asan/tests/harness.h
15

Not an immediate concern, but when we start running compiler-rt tests on Fuchsia, this may become an issue because we don't ship zxtest in our SDK. We might need to come up with a different solution then, for example have a dedicated define to control which test framework is being used.