Meson build system user learning D.

Johannes Loher johannes.loher at fg4f.de
Sun May 19 07:46:11 UTC 2019


Am 18.05.19 um 08:20 schrieb Mike Brockus:
> Hello there this is your hometown Meson build system user here just
> happen to have a
> question related to unit testing in D.
> 
> So is there a way to run the unit-test in the test main as a costume
> test runner in
> "test/test.d", and run the executable program in "src/main.d", with this
> resulting in two
> executable binaries one for test and one for the program?
> 
> I was considering using Unity test framework so I would know that if I
> was running the test runner that it was definitely the custom test
> runner returning the value of all test cases ran and not a mistake of
> running the main executable program.  But I am not sure if that would
> insulate the D programming community by not using the provided unit
> testing functionality in D.
> 
> I am mostly trying to make a version based on an existing C template but
> with D language
> syntax using whatever tools D provides along side Meson build system.  I
> would give you
> the link(s) but I haven't figured out how to add links here on the D
> forum, and I just
> registered.
> 
> Thanks...

Hey there,

I already tried to answer your questions on reddit.

You can post links here by simply pasting the URL (the link will not be
highlighted in the editor, but it will be when it is posted).

Regarding your problem: Could you please describe what you are actually
trying to do? Are you trying to use D in an exisiting Meson project (as
an addition to the existing code)? Why are you trying to use the Unity
test framework (I only had a quick look at it, but from what I saw it
uses a lot of preprocessor macros which will make it difficult to get it
wotk work properly with D). Why not use the built-in unittests or one of
the many already existing unit testing frameworks for D ([1], [2], [3],
[4], [5])?

[1] https://code.dlang.org/packages/unit-threaded
[2] https://code.dlang.org/packages/dunit
[3] https://code.dlang.org/packages/d-unit
[4] https://code.dlang.org/packages/fluent-asserts
[5] https://code.dlang.org/packages/trial


More information about the Digitalmars-d-learn mailing list