Open AnthonyYoManz opened 1 week ago
Maybe I've missed it but I could not find where tests for other ExportConfig fields are, so I took the path of least resistance and simply wrote none for this - although I did test 'manually' by writing a separate crate and making sure behaviour was as described in my PR description. With some guidance on where exactly to put such a test I am happy to write it myself, although it might be a little awkward as I am on Windows and the entire test-suite very much does not function on this platform.
Adds a field
whitelist
toExportConfig
, allowing users to specify an exclusive list of items they wish to include in the generated header file. If the field is left empty it is ignored.If excludes or includes are specified, they override the whitelist. For example in the case where we have functions
foo
,bar
, andbaz
and our whitelist specifiesfoo
andbar
, then onlyfoo
andbar
will be included in the output header file. If they add an includebaz
, all three functions will be included in the output. If they then add an excludefoo
, onlybar
andbaz
will be included in the output.Closes https://github.com/mozilla/cbindgen/issues/484