Page MenuHomePhabricator

[libc][NFC] add macro for fuchsia to switch test backend to zxtest
ClosedPublic

Authored by michaelrj on Wed, Jan 13, 11:41 AM.

Details

Summary

This moves utils/UnitTest/Test.[h/cpp] to LibcTest.[h/cpp] and adds a
new Test.h that acts as a switcher so that Fuchsia can use the zxtest
backend for running our tests as part of their build.

FuchsiaTest.h is for including fuchsia's zxtest library and anything
else needed to make the tests work under fuchsia (currently just
undefining the isascii macro for the test).

Downstream users, please fix your build instead of reverting.

Diff Detail

Event Timeline

michaelrj created this revision.Wed, Jan 13, 11:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptWed, Jan 13, 11:41 AM
michaelrj requested review of this revision.Wed, Jan 13, 11:41 AM

add headerguards to the new Test.h and FuchsiaTest.h

sivachandra added inline comments.Wed, Jan 13, 12:06 PM
libc/utils/UnitTest/FuchsiaTest.h
1

I think this description is incorrect.

10

Can you add comments here explaining why you need these?

libc/utils/UnitTest/LibcTest.h
9–10

As the clang-tidy warning is saying, I think we should make it:

LLVM_LIBC_UTILS_UNITTEST_LIBCTEST_H

Same for other header files as well. It wasn't correct to begin with, so lets fix them as we are touching them.

michaelrj marked 3 inline comments as done.

fix the headerguards and add a comment explaining the undef in FuchsiaTest.h

libc/utils/UnitTest/FuchsiaTest.h
1

oops, forgot to change that when copy/pasting

michaelrj updated this revision to Diff 316500.Wed, Jan 13, 1:04 PM

fixed phrasing in comment

sivachandra accepted this revision.Wed, Jan 13, 1:10 PM
This revision is now accepted and ready to land.Wed, Jan 13, 1:10 PM
michaelrj updated this revision to Diff 316503.Wed, Jan 13, 1:26 PM

fix phrasing in commit message

michaelrj edited the summary of this revision. (Show Details)Wed, Jan 13, 1:26 PM
This revision was landed with ongoing or failed builds.Wed, Jan 13, 1:28 PM
This revision was automatically updated to reflect the committed changes.