kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #38320
Re: [PATCH] Add some testing utils and COLOR4D tests
-
To:
kicad-developers@xxxxxxxxxxxxxxxxxxx
-
From:
Wayne Stambaugh <stambaughw@xxxxxxxxx>
-
Date:
Thu, 8 Nov 2018 15:07:04 -0500
-
In-reply-to:
<CAG1r56Kdjgs-1zbgE63WzN=m3Z+hUB24qSf+HpE8MpjH1-HXZQ@mail.gmail.com>
-
User-agent:
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0
John,
I merged these patches.
Thanks,
Wayne
On 11/8/2018 12:01 PM, John Beard wrote:
> Hi,
>
> Here are some more patches for unit tests.
>
> The first introduces some generic utils for unit tests as a library,
> which simplifies the making of a unit test executable slightly and
> makes a place for handy generic unit test constructs and compiler
> options.
>
> One of these is a way to define "expected failures", which should be
> done inside a protective #ifdef for Boosts < 1.59. This allows to flag
> up a bug (and demonstrate that the test actually covers that bug)
> before fixing, but does *not* break `make test`. Without this, the
> only way to avoid a commit that fails `make test` is squashing the
> flag-up and the fix together, which deletes this information from the
> Git history (all you see is the fixed code and a new, passing, test).
>
> On old Boosts, these tests are simply skipped. I think this is an
> acceptable trade-off against a more complex method of supporting two
> Boost APIs for expected failures. Expected failures should be fixed
> ASAP, so there should be very few, if any, legacy Boost builds of
> commits with "missing" tests like this.
>
> Then, some tests are added for COLOR4D. One of these tests exposes a
> bug in COLOR4D::ToColour(), which is then marked with expected failure
> and fixed in a follow-up commit.
>
> Fun fact: making the implicit double->unsigned char casts explicit in
> this same function saves around 800kB of compiler spew on MSVC -
> around 10% of the total output.
>
> Both patches Jenkins'd on MSVC and Msys2.
>
> Cheers,
>
> John
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp
>
References