Files
kicad-source-mirror/qa/tests/cli
Seth Hillbrand 5a9d351400 Accept bare generated-field names in CLI BOM export
The CLI BOM export requires generated field names like ${QUANTITY}
and ${DNP} to be wrapped in ${} delimiters. When users pass these
on the command line inside double quotes, the shell expands ${VAR}
to an empty string, silently dropping the field from the output.

Normalize field names in the job handler so that bare tokens like
QUANTITY, DNP, ITEM_NUMBER, EXCLUDE_FROM_BOM, EXCLUDE_FROM_BOARD,
and EXCLUDE_FROM_SIM are accepted alongside the canonical ${} form.
Update the default --fields value and help text to use the shell-safe
bare form.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/22613
2026-02-23 18:03:52 -08:00
..
2026-02-11 15:33:37 +08:00

To run these tests manually, you may need to set some or all of
the following environment variables:

# Replace with the path to kicad-cli in your build environment
KICAD_CLI=/path/to/kicad/cmake-build-debug/kicad/KiCad.app/Contents/MacOS/kicad-cli
KICAD_RUN_FROM_BUILD_DIR=1

On macOS you will also need to take the following steps if you want to
test kicad-cli from the build dir:

1) Symlink the contents of the folder:

    /path/to/kicad-mac-builder/build/python-dest/Library/Frameworks/Python.framework/Versions/3.9/

   from your kicad-mac-builder folder into the folder:

   /path/to/kicad/cmake-build-debug/kicad/KiCad.app/Contents/Frameworks/Python.framework/Versions/3.9/

   inside your KiCad build directory.

2) Set the following environment variable so that the Python dll is found:

   DYLD_LIBRARY_PATH=/path/to/kicad-mac-builder/build/python-dest/