diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 042adc0cfdc3c49b85b2b8a92fa334ead3515f26..7f5b2b1f109fd02c645856deffb87be7fb31f689 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,7 +7,9 @@ before_script: - apt update && apt install -y jq - python -V - jq --version + - git clone --depth=1 https://gitlab.com/kicad/libraries/kicad-library-utils test: script: - ./tests/inventory.sh ./fab.kicad_sym ./tests/whitelist.txt + - ./tests/symbols.sh diff --git a/tests/README.md b/tests/README.md index 437a80502a338ade61b61e6c6d028a2687cfc348..9dff87c2098bec5d7219a43be7e02ad0f63bb3f0 100644 --- a/tests/README.md +++ b/tests/README.md @@ -11,4 +11,19 @@ Usage: ./inventory.sh ../fab.kicad_sym ./whitelist.txt ``` -The `whitelist.txt` file is there for the script to skip certain parts that are not electronic components, such as [Amphenol ICC (FCI) 71600-104LF](https://www.digikey.fi/en/products/detail/amphenol-cs-fci/71600-104LF/1523943) ribbon cable connector, for example. \ No newline at end of file +The `whitelist.txt` file is there for the script to skip certain parts that are not electronic components, such as [Amphenol ICC (FCI) 71600-104LF](https://www.digikey.fi/en/products/detail/amphenol-cs-fci/71600-104LF/1523943) ribbon cable connector, for example. + +## Symbols Test + +The symbols test uses the [KiCad Library Utilities](https://gitlab.com/kicad/libraries/kicad-library-utils) to test library symbols according to KLC rules. + +Usage: +``` +git clone --depth=1 https://gitlab.com/kicad/libraries/kicad-library-utils +cd kicad-library-utils/klc-check +./check_symbol.py ../../fab.kicad_sym -p '^(?!.*PWR_FLAG).*$' -vv +``` + +The `-p '^(?!.*PWR_FLAG).*$'` is a pattern that excludes the PWR_FLAG symbol. In a similar way other symbols or groups of symbols can be excluded to exclude specific tests. + +TODO: Check each component category differently. For example KiCad connectors are not always centered beacuse they have to be on a 2.54mm grid always. It would make it easier if each symbol group would be its separate library. \ No newline at end of file diff --git a/tests/klc-check-detail.sh b/tests/klc-check-detail.sh deleted file mode 100755 index 513450a5bdd08f328adf8b41ce7a6945c9527775..0000000000000000000000000000000000000000 --- a/tests/klc-check-detail.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -cd kicad-library-utils/klc-check -python3 check_symbol.py -vv ../../fab.kicad_sym -FPS=$(ls ../../fab.pretty/*.kicad_mod) -for FP in ${FPS} -do - python3 check_footprint.py ${FP} -done diff --git a/tests/symbols.sh b/tests/symbols.sh new file mode 100755 index 0000000000000000000000000000000000000000..27ae676225475afadaeb53a24b18dc7aeb087504 --- /dev/null +++ b/tests/symbols.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +cd kicad-library-utils/klc-check +./check_symbol.py ../../fab.kicad_sym -p '^(?!.*PWR_FLAG).*$' -vv