Eigenstate: myrddin-dev mailing list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Rudimentary testing in mbld: Done.


The Myrddin build system, mbld, now supports rudimentary testing. Just run
'mbld test' to build and run all of the tests. Two kinds of testing are
supported: Implicit tests, and explicit tests.

Implicit tests are tests that are built and run without any declaration.
These tests correspond 1:1 with source files, and live in test/srcfile.myr.

Explicit tests are named explicitly, with a similar syntax to binary targets,
however, with 'bin' replaced with 'test'. As with implicit tests, they are only
built and run when running 'mbld test'

So, eg, if you have the following project structure:

foo/
    main.myr
    frob.myr
    blort.myr
    testfoo.myr
    test/
        frob.myr
        blort.myr

with the following contents in your bldfile:

    bin foo = main.myr frob.myr blort.myr ;;
    test testfoo = testfoo.myr frob.myr blort.myr ;;

Then 'mbld test' will build and run the following
targets:

    test/frob
    test/blort
    testfoo

If they exit with status 0 ("" on plan 9), they will be considered to have run
successfully. Any other status will be considered to be a failure.

As far as getting a sane unit testing framework to fit with this -- ideas,
references, and suggestions welcome.


Follow-Ups:
Re: Rudimentary testing in mbld: Done.Ryan Gonzalez <rymg19@xxxxxxxxx>