Meson build system user learning D.
Mike Brockus
michaelbrockus at icloud.com
Sun May 19 16:47:39 UTC 2019
On Sunday, 19 May 2019 at 07:46:11 UTC, Johannes Loher wrote:
> 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
I am trying to do two things one being able to turn a pure C
project into a pure D project without destroying the existing
file structure.
The project (https://github.com/squidfarts/c-project.git)
The other is to make a new Arduino UNO board project that
leverages existing C and C++ code so I can spend small amounts of
time writing new D code as I update all of my Arduino
applications.
I would like to use the Unity test framework for that Arduino UNO
based project that uses D, C, C++ and both Meson build system and
Conan package manager. The part with C and C++ are just for
linking with the Arduino libraries, including exiting classes
while I write new D code to replace the existing C and C++ code
where ever it makes since. Conan is used to get both the Unity
and CMock from GitHub.
For the pure D project I would like to use whatever D provides
me. Since you provided this list I would start with
unit-threaded and see if it can help with this main function
problem.
More information about the Digitalmars-d-learn
mailing list