prog::testUnit – xUnit-style extensions to the MuPAD test framework

prog::testUnit provides xUnit-style extensions to the MuPAD test framework.

Details:

export(prog::testUnit, Alias):

 

////////////////////////////////////////////////////////////

testinit("trac"):

 

// Global setup for all the tests

export(tric, Alias, trac):

export(combinat, Alias, partitions):

 

////////////////////////////////////////////////////////////

testfunc(tric::trac::f):

 

test(f(1), 2):

test(f(2), 2):

test(f(3), 2):

 

////////////////////////////////////////////////////////////

testfunc("tric::trac::f with option Bla"):

 

test(f(1, Bla), 2):

...

 

////////////////////////////////////////////////////////////

testfunc(tric::trac::g):

 

// extra setup for the tests in this section

...

 

test(g(1), 2):

...

 

// extra cleanup for the tests in this section

...

 

////////////////////////////////////////////////////////////

testexit():

prog::check(tric::trac, 3):

// Clean up common to all the tests

 

  // runs all the tests:

  prog::testUnit::runTests(tric::trac);

 

  // runs all the tests concerning f, while

  // skipping the execution of all code in the setup,

  // test, or tear_down calls of other sections:

  prog::testUnit::runTests(tric::trac::f);

 

   // runs only the tests in the section "tric::trac::f"

  prog::testUnit::runTests("tric::trac::f");

 

   // runs only the tests in the section "tric::trac::f with option Bla":

  prog::testUnit::runTests("tric::trac::f with option Bla");

 

   // runs the setup code required for section "tric::trac::g"

  prog::testUnit::setupTest("tric::trac::g")

  // execute some tests of this section manually

  debug(g(1))

 

runTests – runs the test

prog::testUnit::runTests(x)

Try to runs the tests corresponding to the MuPAD object x.

sourceDir – directory containing the source code

prog::testUnit::sourceDir(x)

Try to guess the directory containing the source code defining the MuPAD object x.

Changes in MuPAD 4.0

New Function.