Menu

#3 provide tearDown with test case data

open
nobody
None
5
2006-08-05
2006-08-05
No

If a test case fails, our tearDown methods write a
bunch of information to the console in order to assist
diagnose the problem. In order to do this, we have
modified function runTest to add two additional
attributes to the unit test case object.

this.status:
undefined = test case did not start
true = test case passed
false = test case failed

this.duration:
duration of the test case without setUp or tearDown
costs.

Discussion

  • John Vandenberg

    John Vandenberg - 2006-08-05

    tearDown_attributes.diff

     
  • Anonymous

    Anonymous - 2006-08-07

    Logged In: YES
    user_id=621533

    This patch changes the duration to exclude
    the time spent on setUp() and tearDown() of a test case.

    This is a significant change of the logics. Logically,
    we so far consider setUp() and tearDown()
    part of the test case. This semantic allows us freely move
    code between setUp(), test() and tearDown() to share code.

    I don't think we should change this
    semantic at this point. If we really want capture the
    the time spent only on test "Execution" code, we should
    add a new member variable while keeping the old one intact.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.