This is an archive of the discontinued LLVM Phabricator instance.

[docs] Add tips on writing test constraints
ClosedPublic

Authored by probinson on Dec 21 2022, 7:12 AM.

Details

Reviewers
ldionne
dblaikie
Summary

Guidance on using REQUIRES, UNSUPPORTED, XFAIL, and the target=... feature.

Things I thought of while updating lots and lots of lit tests.

Diff Detail

Event Timeline

probinson created this revision.Dec 21 2022, 7:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 21 2022, 7:12 AM
probinson requested review of this revision.Dec 21 2022, 7:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 21 2022, 7:12 AM

Thanks for writing this! This LGTM but I would suggest dumbing down your target example even more.

llvm/docs/TestingGuide.rst
571–573

I might even suggest doing target={{.+}}-freebsd-{{.+}} || target={{.+}}-netbsd-{{.+}}. Characters are cheap and IMO this is clearer than trying to cram more logic into something smaller.

ldionne accepted this revision.Dec 21 2022, 7:49 AM
This revision is now accepted and ready to land.Dec 21 2022, 7:49 AM
probinson added inline comments.Dec 21 2022, 8:37 AM
llvm/docs/TestingGuide.rst
571–573

Oh, didn't see this comment before I pushed. Yeah... separating them entirely might be a better example.
I'm still inclined to use freebsd{{.*}} though, because there isn't guaranteed to be a -suffix and there might be a version number (I remember seeing -freebsd9 years ago).

Example updated.

ldionne closed this revision.Sep 8 2023, 8:02 AM

This landed as 2549b8bdae67ab8c1a6ecd974b17b3e3413ae622, closing to clear the review queue.