lehmannro / assert.sh

bash unit testing framework
GNU Lesser General Public License v3.0
487 stars 57 forks source link

Can the test number be available as a variable? #15

Open bexelbie opened 9 years ago

bexelbie commented 9 years ago

This way I could have info messages like:

echo "$TEST_NUMBER: testing foo" assert something something

echo "$TEST_NUMBER: testing bar" assert something something

lehmannro commented 9 years ago

Sure, and inofficially the test number is already available as $tests_ran. From what I can tell it seems like you actually want some support for test descriptions though. I'd favor adding a test_desc function or some such to assert.sh so that it could be properly hidden when running tests in non-verbose mode.

bexelbie commented 9 years ago

test_desc would be nice, but at a minimum having a $test_number that corresponded to the outputs test number would be nice. I am trying to avoid having to carry a private variable for this or continually having to calculate $tests_ran +1