marmistrz
marmistrz

Reputation: 6404

Is there any usage of `test_ctxt` in oUnit

I'm playing around with oUnit2 and I'm wondering: is there any usage for the test_ctxt parameter, as here:

let test1 test_ctxt = assert_equal "x" (Foo.unity "x");;

Is seems superfluous to me. Is there any way to omit it while defining tests as variables?

Upvotes: 2

Views: 258

Answers (1)

ivg
ivg

Reputation: 35270

A value of type test_ctxt is accepted as an optional parameter in assert_command and assert_equal functions, that are main basic blocks for building tests. The test context contains, in particular, a references to loggers, that allows to run tests in parallel. Using your example a correct invocation would be:

 let test1 ctxt = assert_equal ~ctxt "x" (Foo.unit "x)

Upvotes: 1

Related Questions