kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #44844
Re: Questions to the QA code
-
To:
kicad-developers@xxxxxxxxxxxxxxxxxxx
-
From:
Wayne Stambaugh <stambaughw@xxxxxxxxx>
-
Date:
Thu, 28 Jan 2021 11:02:56 -0500
-
Autocrypt:
addr=stambaughw@xxxxxxxxx; keydata= mQGiBEM0hxQRBAC2fNh3YOVLu1d5GZ0SbrTNldGiGnCJPLqzEnqFX9v6jmf33TMt6EmSLkl6 Wtfkoj0nVwKxcYmJkA8DX0QAokBkwNIzhSsBzQvthBLIk/5LnPVVKrEXOcL4mUyH1doKlkaE slgJozNa6Av+oavcvD02o1zJOloBbaHlNlyRt7fKswCgtIFlVjWggVH/15KfWk+Qo5JVPbME AIUBAQyL2OAx0n60AWec2WHnO9buHuG0ibtICgUMkE+2MRmYyKwYRdyVwGoIUemFuOyHp0AJ InX4T+vy2E7vkwODqjtMLfIoRkokW74Fi4nrvjlhOAw/vdq/twLbAmR9MOfPTpR4y7kQy1O2 /n+RkkRvh26vTzfbQmrH7cBJhk6aA/9Uwvu3E4zNJgHVZeS0HyWtmR1eOPPRbnkPgJTToX5O KMKzTJI/FX6kT7cFoCamitHrW3BJP4Dx+cMMsa47EGxqVTdbVJ4LjogsXTXxb+0Fn1u4zBdx x3Cer6O7+hqWy7zvpzeC6nSREjqDKa5CgHtv/GLm5uFPOmsjAsnHj2tlBrQmV2F5bmUgU3Rh bWJhdWdoIDxzdGFtYmF1Z2h3QGdtYWlsLmNvbT6IeAQTEQIAOBYhBOffs6CbblRzBkv33BtR cWlZ+CReBQJbFBS2AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEBtRcWlZ+CReMI8A nRbrLkzp7+c2f0vX7sfg4ICX8LAKAJ9uClo4uJajmZa5zZrL2nKdZlUwIrkCDQRDNIcxEAgA gCru+3/aOC6RCjpvYC72wY+d5SmHphC6yeiV2/mOumyt5MLo/Ps2GznZr11JspqFk5K/Zpvp MMLqqjDZ39+50a2iKRQFJ6NlK+hJWMmj6eJygQrCwYo3Gjc6CqfrqUv+8VSnf/i5sIZmtOVA 4ZjML18MuBvMSsNdVLFJd5HNnYb1iOECpvqdPVh/21LLCEw7MUUGGnHBhCrmk2aJe5hFmcSN g4ldBcXrgMQBwf7aMVoobXBMFDb/IENByXn0llB7Gr2IFMRmNS9/p8s/II1Yl2bTqyX4FSz8 cfn7C9KEz7faZ7wzAcpwHFC/zs3JoAjJ0IEKdNUpIwAlKMzT3CzctwADBQf/cxpG28MKyrqk nNmq/8LQLy+x6FSYXBLjxQz9BiBNYeesDZQ6J5UbL1mjpJzMa5tLZypPYo4bbGyR22hrbyDF K7m6AcVaMIJKl98g4ukMutFfAJyRDaREH5Zl/X1P4u1Z/yaAIy9mKaNbaK1/5djNJ5wCTFen TUgAp9xdc30kGkFDdLJFp5uxDY4P0vaZiZdjUCvDM3Zjv5IzpNOfxVqTUBQNUP/BnnKhkk0p DTD6s3X8S+D0rOtEBQ8K0cwERI/E8EFa8nj0TNw4e2MYGR8wg+SxqJ7z5f0zPY0bO6G9DDFB wYCqzzPWGqdAh9vA5971TAbPERtdFybhkurozp2SfYhJBBgRAgAJBQJDNIcxAhsMAAoJEBtR cWlZ+CResHUAniULLCWiT26ieRTl7N2vS6vBo/DuAJ4m7Ss/gyiW6ybTn1ctDXAUgm2QVQ==
-
In-reply-to:
<ad46edb9cf314012bbc9ab72d1b26883@grupawp.pl>
-
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0
Hi Sywester,
Turtle mocks looks like a better fit than gMock/gTest since it's based
on Boost which is already a dependency. At least it looks like the
project is still maintained. I don't know how it compares feature wise
to gMock so there may some things missing but are they significant
enough to warrant using it is unknown.
Cheers,
Wayne
On 1/26/21 5:38 PM, Sylwester Kocjan wrote:
> Hello,
>
> Here's a follow-up about mocks in the qa tests. I prepared example use
> of Turtle library. My observations below:
> - integrates easily with Boost.Test (HippoMocks didn't require any
> integration, gmock will be harder,
> https://gitlab.com/kicad/code/kicad/-/merge_requests/652/diffs?commit_id=5fa5d228204506de71b265594fdcba5740b43f3e)
> - looks similar in use to google mocks
> - it's maintained on GitHub: https://github.com/mat007/turtle
> - it forced me to create more mocks than HippoMocks and rework the code
> a bit
> (https://gitlab.com/kicad/code/kicad/-/merge_requests/652/diffs?commit_id=c5df86c208156facc66a95ef60bdeabb6e66efb5),
> so:
> - may require more work to create/maintain tests
> - but I believe that in exchange it will result in better quality (I
> found missing 'virtual' keyword before destructor of SCHEMATIC!)
>
> Best regards,
> Sylwester
>
> Dnia 21 stycznia 2021 16:38 Jeff Young <jeff@xxxxxxxxx> napisał(a):
>
> Good point. I have only used the Java one (which I guess is the
> original?).
>
> Cheers,
> Jeff.
>
>
>> On 20 Jan 2021, at 21:18, Sylwester Kocjan
>> <<mailto:s.kocjan@xxxxx>s.kocjan@xxxxx <mailto:s.kocjan@xxxxx>> wrote:
>>
>> Hi Jeff,
>>
>> Did you use https://github.com/tpounds/mockitopp or that one for
>> Java https://github.com/mockito/mockito ?
>> Mockitopp has it's last code update about ~1,5 year ago, so it
>> looks it has the same downside as HippoMocks.
>> There is also Mockpp, also not actively developed:
>> https://sourceforge.net/projects/mockpp/
>>
>> BR,
>> SK
>>
>> Dnia 17 stycznia 2021 16:45 Jeff Young
>> <<mailto:jeff@xxxxxxxxx>jeff@xxxxxxxxx <mailto:jeff@xxxxxxxxx>>
>> napisał(a):
>>
>> I’ve used Mockito. Can’t say I remember a thing about it,
>> though (which could be good?).
>>
>> Cheers,
>> Jeff.
>>
>>> On 17 Jan 2021, at 14:49, Sylwester Kocjan
>>> <<mailto:s.kocjan@xxxxx><mailto:s.kocjan@xxxxx>s.kocjan@xxxxx
>>> <mailto:s.kocjan@xxxxx>> wrote:
>>>
>>> Hello,
>>>
>>> On 17/01/2021 09:47, Alex wrote:
>>> > ...GTest, Doctest and Catch2, (...) they'll all get the job
>>> done
>>>
>>> They are all testing frameworks without mocking capability.
>>> We have already Boost.Test based tests and I find it
>>> unnecessary effort to migrate them, and alone
>>> they don't solve the problem.
>>>
>>>
>>> On 17/01/2021 09:47, Alex wrote:
>>> > I wasn't aware that GMock could operate separately from
>>> GTest, but if it can, that's pretty neat.
>>>
>>> On Sun, Jan 17, 2021, 12:15 AM Andrew Lutsenko
>>> <anlutsenko@xxxxxxxxx> <mailto:anlutsenko@xxxxxxxxx> wrote:
>>> > You can also use gmock separately from gtest.
>>>
>>> Since some time gmock is a part of gtest. Any search results
>>> in the topic of gmock with another testing frameworks are
>>> quite old. I think there is a risk that it will not work.
>>>
>>>
>>> On 17/01/2021 09:47, Alex wrote:
>>> > Catch is a single header
>>>
>>> I was instructed to avoid introducing new dependencies, hence
>>> my initial choice of single-header HippoMocks:
>>>
>>> https://gitlab.com/kicad/code/kicad/-/issues/4446#note_445185505
>>>
>>> On Sat, Jan 16, 2021 at 6:47 AM Seth Hillbrand
>>> <seth@xxxxxxxxxxxxx> <mailto:seth@xxxxxxxxxxxxx> wrote:
>>> > The downside of HippoMocks from what I can gather is that
>>> the project appears abandoned.
>>>
>>> Sadly, this is true. There are also other choices, but I
>>> don't have any hands-on experience with them and I don't know
>>> which one to choose:
>>> - http://turtle.sourceforge.net/
>>> - https://github.com/tpounds/mockitopp
>>> - https://github.com/rollbear/trompeloeil
>>>
>>> Best regards,
>>> Sylwester
>>>
>>>
>>> On 17/01/2021 09:47, Alex wrote:
>>>> I've used GTest, Doctest and Catch2, and they'll all get the
>>>> job done; Doctest is definitely the fastest to compile, but
>>>> also has the least of features; Catch and GTest have the
>>>> most features.
>>>>
>>>> I wasn't aware that GMock could operate separately from
>>>> GTest, but if it can, that's pretty neat.
>>>>
>>>> I believe Doctest and Catch both are single header - I know
>>>> at least Catch is a single header; but I think it makes
>>>> sense to use a git submodule in this case.
>>>>
>>>>
>>>> On Sun, Jan 17, 2021, 12:15 AM Andrew Lutsenko
>>>> <<mailto:anlutsenko@xxxxxxxxx><mailto:anlutsenko@xxxxxxxxx>anlutsenko@xxxxxxxxx
>>>> <mailto:anlutsenko@xxxxxxxxx>> wrote:
>>>>
>>>> I would also suggest to look towards gtest/gmock.
>>>> It's widely adopted, works with cmake out of the box,
>>>> has integrations with popular IDEs and a good choice of
>>>> supporting tools like parallelized runners, GUI
>>>> inspectors etc.
>>>> You can also use gmock separately from gtest.
>>>>
>>>> Andrew
>>>>
>>>> On Sat, Jan 16, 2021 at 6:47 AM Seth Hillbrand
>>>> <<mailto:seth@xxxxxxxxxxxxx><mailto:seth@xxxxxxxxxxxxx>seth@xxxxxxxxxxxxx
>>>> <mailto:seth@xxxxxxxxxxxxx>> wrote:
>>>>
>>>> Hi Sylwester-
>>>>
>>>> I haven't used HippoMocks but in general, adding QA
>>>> tests is always welcome as long as they run as
>>>> expected under the Fedora docker we use for online
>>>> QA with GitLab.
>>>>
>>>> The downside of HippoMocks from what I can gather is
>>>> that the project appears abandoned. If I'm
>>>> incorrect here, can you link to the current
>>>> repository/documentation?
>>>>
>>>> Thanks-
>>>> Seth
>>>>
>>>> On Fri, Jan 15, 2021 at 2:49 PM Sylwester Kocjan
>>>> <<mailto:s.kocjan@xxxxx><mailto:s.kocjan@xxxxx>s.kocjan@xxxxx
>>>> <mailto:s.kocjan@xxxxx>> wrote:
>>>>
>>>> Hello,
>>>>
>>>> I have two questions regarding QA code for KiCad
>>>> and I'd like to ask for your comments about them:
>>>>
>>>> 1. I reviewed contents of qa directory in KiCad
>>>> repo and I saw some issues that can be fixed.
>>>> Could you please take a look at the summary
>>>> and let me know if they are valid:
>>>>
>>>> https://docs.google.com/spreadsheets/d/14QAy9rRIHqRr4YuXfQO2GicURAG1BgJmwKe7B1H6xXI/edit#gid=326687467
>>>>
>>>> 2. What do you think about adding mocking
>>>> library to the KiCad code? I found that PGM
>>>> object is mocked few times
>>>>
>>>>
>>>> https://gitlab.com/kicad/code/kicad/-/issues/4446#note_342766728
>>>>
>>>> A libary for creating mocks would simplify
>>>> creting the tests. In this MR and commit:
>>>>
>>>>
>>>> https://gitlab.com/kicad/code/kicad/-/merge_requests/542
>>>>
>>>> https://gitlab.com/kicad/code/kicad/-/merge_requests/542/diffs?commit_id=b7b401d7128057831c049a723ffc895453d65a0e
>>>>
>>>> there is added HippoMocks, a single-header
>>>> mocking tool and it does it's job.
>>>> If that's ok, it could help to get rid of
>>>> these duplicated mocks (maybe even hand-written
>>>> mocks at all).
>>>>
>>>> Best regards,
>>>> Sylwester
>>>> _______________________________________________
>>>> Mailing list:
>>>> https://launchpad.net/~kicad-developers
>>>> Post to :
>>>> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx><mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>kicad-developers@xxxxxxxxxxxxxxxxxxx
>>>> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
>>>> Unsubscribe :
>>>> https://launchpad.net/~kicad-developers
>>>> More help : https://help.launchpad.net/ListHelp
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> KiCad Services Corporation Logo
>>>>
>>>> Seth Hillbrand
>>>> *Lead Developer*
>>>> +1-530-302-5483
>>>> Long Beach, CA
>>>> www.kipro-pcb.com <https://www.kipro-pcb.com/>
>>>> <mailto:info@xxxxxxxxxxxxx><mailto:info@xxxxxxxxxxxxx>info@xxxxxxxxxxxxx
>>>> <mailto:info@xxxxxxxxxxxxx>
>>>>
>>>> _______________________________________________
>>>> Mailing list: https://launchpad.net/~kicad-developers
>>>> Post to :
>>>> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx><mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>kicad-developers@xxxxxxxxxxxxxxxxxxx
>>>> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
>>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>>> More help : https://help.launchpad.net/ListHelp
>>>>
>>>> _______________________________________________
>>>> Mailing list: https://launchpad.net/~kicad-developers
>>>> Post to :
>>>> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx><mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>kicad-developers@xxxxxxxxxxxxxxxxxxx
>>>> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
>>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>>> More help : https://help.launchpad.net/ListHelp
>>>>
>>>>
>>>> _______________________________________________
>>>> Mailing list: https://launchpad.net/~kicad-developers
>>>> Post to : <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>kicad-developers@xxxxxxxxxxxxxxxxxxx <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
>>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>>> More help : https://help.launchpad.net/ListHelp
>>>>
>>>
>>> _______________________________________________
>>> Mailing list: https://launchpad.net/~kicad-developers
>>> Post to :
>>> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx><mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>kicad-developers@xxxxxxxxxxxxxxxxxxx
>>> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>> More help : https://help.launchpad.net/ListHelp
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to :
>> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>kicad-developers@xxxxxxxxxxxxxxxxxxx
>> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help : https://help.launchpad.net/ListHelp
>
>
>
> _______________________________________________
> 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