shunit icon indicating copy to clipboard operation
shunit copied to clipboard

Add a simpler frontend for specifying a reporting format & making testcases

Open akesterson opened this issue 11 years ago • 0 comments

shunit leaves a lot to be desired in terms of its interface. Here's how I'd like to call it:

  • Specify what reporting format I want
  • For all of the testcases I have, call a gateway function that takes:
    • The kind of testcase I'm running (the test type)
    • The type of failure this will count as if it fails
    • A canned failure message to use if it fails
    • A function that represents the testcase, which the gateway function should use as a callback

Essentially:

shunit_start junit
shunit_testcase 'my_testcase_function' 'test_type' 'type_failure'
shunit_finish

... The assumption would be that the testcase function would return nonzero on failure, and would print out error information to stderr. This is a much easier way to handle reporting tests than the current methods (either call the header/testcase/footer functions yourself, or try to make a bunch of 'shunittest_' functions and magic them through the shunit tester).

akesterson avatar Apr 07 '14 18:04 akesterson