Eigenstate: myrddin-dev mailing list

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

Re: Rudimentary testing in mbld: Done.


So far, I know of three variants of unit testing:

- Those that go macro happy but are really hands-off.
- Those that go macro happy for no reason because they're just as painful
as the other ones.
- Those that have no macros but are still nice.
- Those that have no macros but make you shove every stupid detail in a
required argument.
- Those that are language-intergrated and make reading source kind of
weird...

I might toy with porting my libcut <https://github.com/kirbyfan64/libcut> to
Myrddin; since traits work, it shouldn't be too painful.

On Sat, Feb 21, 2015 at 1:03 AM, Ori Bernstein <ori@xxxxxxxxxxxxxx> wrote:

> 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.
>
>
>


-- 
Ryan
If anybody ever asks me why I prefer C++ to C, my answer will be simple:
"It's becauseslejfp23(@#Q*(E*EIdc-SEGFAULT. Wait, I don't think that was
nul-terminated."
Personal reality distortion fields are immune to contradictory evidence. -
srean
Check out my website: http://kirbyfan64.github.io/

References:
Rudimentary testing in mbld: Done.Ori Bernstein <ori@xxxxxxxxxxxxxx>