kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #37806
Re: [PATCH]/Question TITLE_BLOCK tests
-
To:
John Beard <john.j.beard@xxxxxxxxx>, Kicad Developers <kicad-developers@xxxxxxxxxxxxxxxxxxx>
-
From:
Wayne Stambaugh <stambaughw@xxxxxxxxx>
-
Date:
Sat, 6 Oct 2018 16:03:55 -0400
-
Autocrypt:
addr=stambaughw@xxxxxxxxx; prefer-encrypt=mutual; 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:
<CAG1r56J5pGEAuVVE73zMewSdvh1WqhxiZtGrt2__XXF5Aeap=w@mail.gmail.com>
-
Openpgp:
preference=signencrypt
-
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1
On 10/06/2018 03:48 PM, John Beard wrote:
> Hi Wayne,
>
> On Sat, Oct 6, 2018 at 5:29 PM Wayne Stambaugh <stambaughw@xxxxxxxxx> wrote:
>> No problem. I will test your patch once you post it.
>
> Patch attached. Indeed, it was a missing include in the header that
> probably worked until now due to serendipitous include ordering in the
> existing CPPs.
>
> This actually illustrates one nice thing about having unit tests CPPs
> that include only a single KiCad header - they make sure that header
> and any transitive includes are compilable even when the test CPP only
> includes that one header (i.e. as recommended by the code guidelines:
> 6.2 Headers Without Unsatisfied Dependencies [1]).
This is why there is a section for this in the coding guidelines. Some
of the issues have been around for a long time but there are many others
that have been introduced with new code. We really need to do a better
job at this. We really shouldn't have to right unit tests to ferret out
all of the invalid headers.
>
> Another way this can improved is when you have a .cpp/.h pair for a
> self-contained class, the .cpp should include the corresponding .h
> first before any other include. This ensures the header is compilable
> by itself, and has no implicit inclusion criteria for use. This is
> sometimes, but not always true in KiCad. (In this case, there is no
> .cpp anyway, so the unit test was the first CPP to attempt to include
> by itself).
>
>> The problem is all of the inline functions defined in convert_to_biu.h.
>> Until they are replaced with per application equivalents, we will
>> continue to have to compile every common source file multiple times that
>> use anything in this file.
>
> Right, but in the case of dialog_page_settings.cpp in particular, the
> only definition actually needed from here was IU_PER_MILS,
> which can be equivalently retrieved, via the virtual BASE_SCREEN
> interface, from the derived class, where IU_PER_MILS is properly set
> for each compiled target (eeschema, pl_editor, pcbnew).
>
>> This is odd as they are both in the COMMON_SRCS list. Actually,
>> color.cpp is included twice. Once in KICAD_SRCS and once in COMMON_SRCS
>> which includes KICAD_SRCS. We should remove color.cpp from either
>> KICAD_SRCS or COMMON_SRCS. I see no need to build it twice.
>
> Even more odd. Removing one of the colors.cpp from the
> common/CMakeLists.cpp didn't stop qa_common having to specifiy it
> again, though.
>
> For colors.cpp specifically, this is an issue which will be resolved
> when, as promised in colors.h, the removal of legacy support will make
> the global colour table obsolete. So it's perhaps more of a curiosity
> than an issue?
>
> Regardless, if anyone can shed light on this, I'd appreciate it, as it
> probably indicates something fishy somewhere?
>
> Cheers,
>
> John
>
> [1]: http://docs.kicad-pcb.org/doxygen/md_Documentation_development_coding-style-policy.html#header_depends
>
References