Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Would be good to have some unittests #11

Open
mithro opened this issue Jul 3, 2016 · 8 comments
Open

Would be good to have some unittests #11

mithro opened this issue Jul 3, 2016 · 8 comments

Comments

@mithro
Copy link
Contributor

mithro commented Jul 3, 2016

The guess_layer function in gerber.py is pretty complicated, it would be nice to have some tests which check additions don't break existing use cases.

@mithro
Copy link
Contributor Author

mithro commented Jul 3, 2016

(Adding this because I'm about to send a pull request which includes tests :)

mithro added a commit to mithro/GerbLook that referenced this issue Jul 3, 2016
By default KiCad doesn't use the Protel names, instead all the files end in
`.gbr` and it uses 'B.Cu' and similar. (Fixes hadleyrich#12.)

This also adds tests for both the KiCad and Protel file name format.
(Part of hadleyrich#11.)
mithro added a commit to mithro/GerbLook that referenced this issue Jul 3, 2016
@mithro
Copy link
Contributor Author

mithro commented Jul 3, 2016

@kasbah
Copy link
Contributor

kasbah commented Jul 3, 2016

Maybe we could make that available as JSON and use the exact same data?

@hadleyrich
Copy link
Owner

Hi guys. Thanks for the contribution @mithro that's great. Excellent idea @kasbah that was my first thought too - it would be a great idea to make it JSON and load it up. No point duplicating effort.

@mcous
Copy link

mcous commented Jul 6, 2016

For providing the whats-that-gerber test cases as JSON, we have a couple options:

  1. Convert the existing filenames-by-cad.js to a JSON file and leave it where it is
  2. Spin out the test case JSON file into its own node module hosted on npm and wherever else (GitHub releases would be easy)

What would be the easiest way for you guys to get and consume this JSON file?

@hadleyrich
Copy link
Owner

Either way works fine, we can just grab it directly over HTTP from where ever it is. If it stays where is is it might be a good idea to add a note that it's used externally so that fact doesn't get forgotten sometime in the future.

@kasbah
Copy link
Contributor

kasbah commented Jul 6, 2016

I would suggest you use a URL pointing to a specific version, either through npmcdn or Github (or both?)

https://npmcdn.com/[email protected]/test/filenames-by-cad.js
https://raw.githubusercontent.com/tracespace/whats-that-gerber/v2.0.3/test/filenames-by-cad.js

With the npmcdn one you can also put in @^2.0.3 which will grab newer minor or patch versions (i.e. 2.x.x but not 3.x.x) or @~2.0.3 which will get newer patch versions (i.e. 2.0.x). I believe whats-that-gerber follows semantic versioning so moving the JSON file should only happen with a major version bump then.

@kasbah
Copy link
Contributor

kasbah commented Aug 18, 2016

Whats-that-gerber 2.1.0 has been released with the test cases as JSON. I would suggest you use this source: https://npmcdn.com/whats-that-gerber@^2.1.0/test/filenames-by-cad.json

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants