Files
textmate/bin
Allan Odgaard 01417054cb Add test system supporting grand central dispatch
The motivation for introducing a new test generator is that CxxTest cannot be used with tests that (indirectly) schedule code to run in the main queue.

There are a few other advantages of breaking with CxxTest:

 1. Less boilerplate: A test file need only contain a
    function named with a ‘test_’ prefix. No classes,
    inheritance, or similar. If you need fixtures, use the
    multitude of ways that C/C++ allows that (constructor
    functions or non-POD types with static storage).

 2. Concurrent tests: Test functions are scheduled with
    ‘dispatch_apply’ and will thus run concurrently. If
    you need serial execution you can wrap your tests in a
    block and schedule that to run in the main queue.
    Though you should catch exceptions and re-throw these
    in the test’s original queue, as the test assertions
    are using exceptions.

 3. Easier output of custom types: The assertion macros
    will call ‘to_s’ on the arguments given, so the only
    thing required to make these output nicely is to
    provide a ‘to_s’ overload for your custom type /
    enumeration. I know that the standard way to do this
    is overloading operator<< for a stream, but the
    TextMate code-base already uses the ‘to_s’
    convention.

Long-term I can see a few other advantages, like calling preprocessor on the input files to support #if/#else/#endif to disable tests, better support for Cocoa code (NSRunLoop), and introducing test timeouts.
2013-02-21 15:54:37 +01:00
..
2012-11-12 13:28:34 +07:00
2012-08-09 16:25:56 +02:00