1630 Commits

Author SHA1 Message Date
Jon Evans
8b80853ad7 QA: Store SVGs, not PNGs
Different platforms/versions can result in very slight differences
when converting SVGs to PNGs for diffing them.
2025-06-14 16:56:47 -04:00
Seth Hillbrand
6f295db04a If we can't load the KiCad, don't crash
We already fail the test, so just continue instead of segfaulting the qa

(cherry picked from commit ed67d374803f905e3cf4982a1ee2c4a0d77ecdd0)
2025-06-05 11:41:27 -07:00
Jeff Young
b7a8da81a9 Better and more complete recursion guards.
(ie: ones that actually work.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20990

(cherry picked from commit ed1b4f6e5a48c4fccbaafab42e824acffb9cafe8)
2025-05-25 08:17:23 +01:00
Seth Hillbrand
d6607146c4 Fix silk board edge collision case
First, fix the error limit check in drc_test_provider_edge_clearance.
Then, we rotate the final point incorrectly in SHAPE_ARC::Collide (need
negative angle).  We were not checking this result in the QA, so add the
proper tests

(cherry picked from commit 9bedb6eedb8295ea309ff447c48cb53ac028ada5)
2025-05-19 17:49:18 -07:00
Wayne Stambaugh
8b44bc1344 Fix a cadre of symbol pin alternate issues.
Prevent the file formatter from writing and the file parser from loading
symbol pin alternates that have an empty name or when the alternate name
is the same as the default pin name.  Apparently at some point they were
able to be created and saved.

Do not allow SCH_PIN::SetAlt() to set an alternate name when the name
does not exist in the library symbol pin alternate list.  This required
fixing the associated QA test.

When updating or changing schematic symbols from library, reset the pin
alternate to the default when the alternate no longer exists in the
symbol.

Do not populate pin alternates context menu with duplicate default pin.

Clear orphaned pin alternates to the default when saving symbols from
symbol editor.

(cherry picked from commit d16d2f5a5b1897b0fa3f4e797ff9b9a3a246c09a)
2025-05-18 07:18:44 -04:00
Jeff Young
0dde037ab9 Update CLI gold files with higher arc definition. 2025-05-13 14:19:00 +01:00
Jeff Young
241959bca3 Slice() must also support aMaxError.
In some cases arcs are re-inserted.
2025-05-13 12:02:21 +01:00
Jeff Young
bfa61dc8ad Third go at fixing the kimath test.
(cherry picked from commit 7f4853b8a58c8553ef7e2d1776a2ca7f88db4a46)
2025-05-13 10:10:46 +01:00
Jeff Young
e4527bd1fe Another go at fixing the kimath test.
(cherry picked from commit acf1dca1e1136facb32c67d4e291ff9bd73726f6)
2025-05-13 10:10:43 +01:00
Jeff Young
1520883182 Formatting.
(cherry picked from commit a95f5172c9bc5138508a20623a86670c438549bd)
2025-05-13 10:10:41 +01:00
Jeff Young
427d4173b1 Allow math tests to run with their own precision.
(cherry picked from commit 32cd142c39f0180ac6de294291a062f672ae128f)
2025-05-13 10:10:34 +01:00
Jeff Young
19af8419b3 Update Cadstar gold file for increased precision.
(cherry picked from commit f54ae5246c8634f4c8416dfb3a3fb64b227183b3)
2025-05-13 10:10:31 +01:00
Wayne Stambaugh
4b009b0698 Fix ERC QA failures caused by hierarchical label root sheet test.
(cherry picked from commit bebc9669ad3913b07f33fa540558a80d1ccdfb1b)
2025-05-09 15:33:26 -04:00
Jeff Young
1808cef013 Fix test failure. 2025-05-07 17:24:21 +01:00
Jeff Young
8ac578c788 DRCEpsilon is generic. Zone knockouts need more specific values.
Each knockout can be approximated, and each knockout
will have m_ExtraClearance added.  If a neck is
between two knockouts, it will be 2X the above
values narrower than expected.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20361

(cherry picked from commit 96522c4113a8c799393fe057daa01fa86375793a)
2025-05-07 14:09:05 +01:00
Mark Roszko
8ccc548628 Add missing numpy requirement to tests/requirements.txt
(cherry picked from commit 83f9dc56d0ff0a932badcd7de454affe24ea5c4d)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2025-05-07 00:13:44 +00:00
John Beard
227c74f2ee PCB array tool: don't count array source pad as reserving its number
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20722
2025-04-27 21:49:21 +08:00
Wayne Stambaugh
5544a315bd Use arc mid point for footprint library parity DRC testing.
The arc center is a pseudo coordinate which is calculated for drawing
purposes.  This mid point is fixed unless the arc is modified which
should result in more reliable arc parity footprint library DRC testing.

Also change EDA_SHAPE::Compare() to use the arc mid point.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15917

(cherry picked from commit 11edaa6e4a256d69bc2f65240b9a7bc54daa481e)
2025-04-07 12:03:02 -04:00
Jon Evans
5b88f2509e Use stable sort ordering in ERC reports
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20333


(cherry picked from commit fe22166d9f0da180c8ac645397fe663759147d6a)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-03-16 11:22:06 -04:00
Seth Hillbrand
c4ad3456f4 Fix mistake in arc circle collision
Need to test nearest point from the circle center to the arc.  Add QA to
prevent regression

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20336

(cherry picked from commit de09403b10244d368fbe9a8f52f6b4c73abedc4e)
2025-03-14 18:06:54 -07:00
Eli Hughes
c521dabcf0 Seeding a simple python script to create a test server for http libs.
(cherry picked from commit e972fb42eede66b7ff8a089dc45206844511577d)
2025-03-14 16:55:49 -07:00
Jeff Young
f7eb925bfe An arbitrary layer flip can not be done without the board.
(User-defined layers can be sided or not.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20169

(cherry picked from commit 9856cb2210e49dbf84abbbc2e6f0272ce7ed8479)
2025-03-05 18:01:09 +00:00
jean-pierre charras
2504195e6e Fix a collision with a Windows define and our use of the same var name.
We use IN for INCH as units, but IN is defined in a Windows header

(cherry picked from commit b0fe4df3c565027801cbbac56c6ee0da254bd74a)
(cherry picked from commit 0acdabd1eb1a2d5ab9b6aa9f71df31c8cf088de8)
(cherry picked from commit eaa1e6d59464e8356d24afd1d29148335010f67a)
2025-03-02 16:13:11 +01:00
Jeff Young
203ddb7b47 Code brevity.
(cherry picked from commit f951497a4fdf47e7c839f71df7a1b06660540ec9)
2025-03-01 22:23:30 +00:00
Jon Evans
dcc09a9e77 Improvements to kicad-cli test repeatability
(cherry picked from commit ca21a35bfca693abf8bca8080c0f107913fe2b09)
2025-02-22 14:08:55 -05:00
Jeff Young
a60307340f Finish eradication of visibility flag on text items.
Import/read previously-hidden symbol/footprint
text items as hidden fields.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19875

(cherry picked from commit 5edae8250d0bebb08ea4fd71a392f889895d6f7d)
2025-02-20 13:18:23 +00:00
Jeff Young
58b8e9736d Fix bugs in library existence checking, and add for symbol libs.
(cherry picked from commit 2a1b93a254a480d73bfb0dabe7823be1f3b0b05d)
2025-02-20 13:17:37 +00:00
Seth Hillbrand
9e4204340f Fixup net-tie caching and add QA for netties
When building a net tie, all elements in the footprint that belong to
the net tie can be arbitrarily close to one another.  outside of the
footprint, connected items can be arbitrarily close to the tie element
but must respect the clearance values for elements that have nets
assigned to them

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19933

(cherry picked from commit bff819edb08e3d303c695b79f990374d259e4d0a)
2025-02-13 14:45:40 -08:00
Tomasz Wlostowski
849e3d2f18 qa: fix setting of router mode (single/diff) in pns_log_viewer 2025-02-03 13:24:27 +01:00
John Beard
30affcd7a1 QA: side-step wxSize printer not working for some
Not sure what it is that caused it to break (reported by
Seth on Linux, but works for me and on the CI).

Rather than trying to be clever at this point, just do the dumb
thing (and remove the boost_test_print_type for wxSize to prevent
someone using it for the time being).
2025-02-01 00:35:13 +08:00
John Beard
636c6c4efb Eeschema/pcbnew: fix pasted image saving
The m_imageData buffer in the BITMAP_BASE is an
internal implementation - the public API to persist the
data to a stream appears to be SaveImageData - so use that,
which hides the implementation (and generates the image data
"live" when needed).

Remove the public access to the m_imageData buffer as it isn't
needed for public use, and also is misleading.

Also break out the formatting of the data into KICAD_FORMAT,
as it's currently replicated in eeschema/pcb/pagelayout
formatting code.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19772
2025-01-31 23:01:07 +08:00
Ian McInerney
088e0e80a1 Fix layer writing/reading for copper zones
* Always enumerate layers - never use the wildcards
* Keep fills on layers the zone is actually on when loading

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19775
2025-01-29 00:31:28 +00:00
Seth Hillbrand
6c2a559cbe Set base user layer count
Default colors cycle through repetition for unknown layers.  Allows
importing from complex Altium/CADSTAR boards with more than 10
documentation layers
2025-01-28 12:22:39 -08:00
jean-pierre charras
e487f19260 QA api test: ensure the "C" locale is used in tests.
Fix also a compatibility with current code in drc_proto.cpp
2025-01-26 11:47:18 +01:00
Jon Evans
9cf4dd05b3 Fixes to build with wxWidgets 3.3 2025-01-24 22:33:00 -05:00
John Beard
d9a243d98c QA: Use data-driven tests in a few places
This means that you can run just a single case from the command line,
for example:

   `qa_pcbnew -t DRCCopperSliver/_0`

The case is also automatically printed as context.

This means that when isolating a specific defect in one case,
you can run only that one case, which is useful under debuggers
and also when using slow tools like valgrind.

Not all possibe tests are doing this, but they're easy to do
when needed (i.e. when you want to run just one case)
2025-01-24 20:13:19 +08:00
JamesJCode
09bbaa5813 Attempt to fix broken Windows build 2025-01-24 02:40:21 +00:00
John Beard
954ef70a8a QA: add a library-mode footprint load/test/save test
This is not only a useful place to hang regression tests,
but also allows to catch defects specific to loading or
saving footprints.

For example, it would catch:

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/19713
2025-01-24 02:11:06 +08:00
Jeff Young
e19bce2f93 Reduce reliance on MANDATORY_FIELDS and their implied order. 2025-01-22 17:51:57 +00:00
Jeff Young
a0dd0485e9 Pull a little harder on the MANDATORY_FIELDs string.
We still conflate the fieldID, the position in the
array of fields, and whether or not that means the
field is mandatory.  But this attempts to clean up
*some* of that, without introducing too much risk.
2025-01-21 16:48:13 +00:00
Jeff Young
d50b69f1ae Reconcile divergence of MANDATORY_FIELDS between symbols and footprints.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19697
2025-01-21 13:28:28 +00:00
Jon Evans
975fe32fa7 Add a mechanism for using a mock config dir for QA tests 2025-01-18 13:40:38 -05:00
jean-pierre charras
7243281756 QA test: ensure qa_common uses the "C" locale to convert doubles to strings. 2025-01-17 15:44:04 +01:00
JamesJCode
baa0beec4d Update some pcbnew QA files to remove warning messages 2025-01-14 22:49:21 +00:00
Seth Hillbrand
bfb3875a68 Add additional handling for arc collisions
Provides nearest point calculation for circles, segments and rects

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18203
2025-01-14 13:08:45 -08:00
Seth Hillbrand
b73481dd49 Update SHAPE_ARC::IntersectionPoints()
Force it to handle a number of edge cases from Arc-Arc collision test.
Unify and simplify the Collide Arc-Arc.  Add additional arc collision
QA test
2025-01-14 13:08:45 -08:00
JamesJCode
c80a71f64a Make netclass name methods clearer, and improve doc strings
There are two netclass name methods, which previously were not
obvious in their uses. These have been renamed to now have:

GetName() : Used for internal or tooling (e.g. netlist export) usage
GetHumanReadableName() : Used for display to users (e.g. in infobars)

Fixing the previous unclear naming will result in fewer bugs
when users start using the multiple netclass functionality, as
the incorrect usage had started creeping in to new code. Also this
will help authors of new code select the correct name method.
2025-01-14 20:44:09 +00:00
Jeff Young
9c757a4417 Naming conventions. 2025-01-14 12:24:24 +00:00
Seth Hillbrand
3e8791b88d Fixup multiple issues with DP checks
Handle arcs properly even when not exactly concentric.  Properly check
for interfering elements that would prevent coupling.  Avoiding those
that are directly connected

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17967
2025-01-13 16:11:16 -08:00
Seth Hillbrand
79419ef2f0 Update QA check for 8883
This actually has a redundant track that was not caught before
2025-01-09 14:28:34 -08:00