dylanmckay / lit

An integrated testing tool inspired from LLVM's 'lit' tool
MIT License
17 stars 9 forks source link

Add a RUN-FAIL command? #2

Closed sheredom closed 3 years ago

sheredom commented 5 years ago

First off - thanks for this awesome lib - so cool that someone already thought about bringing the power of lit to cargo!

One thing I'm using this for is to assert that when a command fails a specific error message is printed out (for a little compiler project I'm working on). At the minute I'm having to do:

// RUN: my_command_that_fails || echo xfail

Is there any chance we could add something like RUN-FAIL or RUN-XFAIL that didn't throw an error if the executable returned non-zero?

dylanmckay commented 5 years ago

Thanks! Yes, LLVM's lit is the best general purpose testing tool I've used.

How does LLVM do this?

If you want to mock something up, I'm happy to review/merge it.

sheredom commented 3 years ago

I totally forgot to do anything here sorry. Honestly in the end I just used bash's failing_exe | echo to ensure a 0 return, worked fine!