9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Inverting exit status in mk recipes
@ 2015-07-20 20:56 Håkon Robbestad Gylterud
  0 siblings, 0 replies; only message in thread
From: Håkon Robbestad Gylterud @ 2015-07-20 20:56 UTC (permalink / raw)
  To: 9fans

Hello 9fans,

I am trying to write a test target in an mkfile which checks a few
negative tests.

My intuition was that this would be written as

test:QV:
  ! command1
  ! command2
  …

However, such a recipe always fails since mk will fail if command1 has a
non-empty exit status.

Thus I wonder: What the idiomatic way of doing this?

The best solution I have found thus far is to write:

test:QVE:
   ! command1 && ! command2 && …

But this makes it rather less intelligible.

Best regards,
 Håkon





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-07-20 20:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-20 20:56 [9fans] Inverting exit status in mk recipes Håkon Robbestad Gylterud

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).