I think I can write it myself as
unrollme-dev-dan:~ Dan$ echo 'exit $@' > fail
unrollme-dev-dan:~ Dan$ chmod +x fail
unrollme-dev-dan:~ Dan$ ./fail 42
unrollme-dev-dan:~ Dan$ echo $?
42
Is there a built-in module that does this? exit, of course, will not work, because it will exit the current process, and will not create a child process and exit it. test- This is the easiest way to find 0or as the return code 1.
Like http://httpstat.us/ I need unit test specific error codes. This was incredibly difficult for Google, since most of the results were to handle errors, not cause them.
source
share