Page MenuHomeFreeBSD

atf-check: Add shortcut for not-exit:0
Needs ReviewPublic

Authored by des on Wed, Jul 8, 7:17 AM.
Tags
None
Referenced Files
F162633105: D58099.id.diff
Wed, Jul 15, 6:56 AM
F162618652: D58099.id181517.diff
Wed, Jul 15, 3:27 AM
F162618393: D58099.id181517.diff
Wed, Jul 15, 3:23 AM
F162596054: D58099.diff
Tue, Jul 14, 9:55 PM
F162596032: D58099.diff
Tue, Jul 14, 9:54 PM
F162575600: D58099.id181517.diff
Tue, Jul 14, 5:13 PM
Unknown Object (File)
Mon, Jul 13, 11:26 AM
Unknown Object (File)
Mon, Jul 13, 12:12 AM
Subscribers

Details

Reviewers
None
Group Reviewers
tests
Summary

Allow the command to be preceded by an exclamation point, which changes
the default expected result to a clean exit with a non-zero exit code.

MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 74609
Build 71492: arc lint + arc unit

Event Timeline

des requested review of this revision.Wed, Jul 8, 7:17 AM

This is a really nice, simple feature request -- I love it!

The concern I have about this change is that ! is a shell builtin operator and this could cause confusion/result in bugs if someone tries to fun the command on the command line in certain shells where ! has special meanings in different contexts (we can't always assume atf-sh is running /bin/sh, unfortunately..).

How about atf_check -s '!0' false instead? If things were done that way the negation operator could be extended to -e and -o without any sort of ambiguity/confusion.

The concern I have about this change is that ! is a shell builtin operator and this could cause confusion/result in bugs if someone tries to fun the command on the command line in certain shells where ! has special meanings in different contexts (we can't always assume atf-sh is running /bin/sh, unfortunately..).

Can you provide an example?

How about atf_check -s '!0' false instead? If things were done that way the negation operator could be extended to -e and -o without any sort of ambiguity/confusion.

No, that completely negates the point of the patch.