Page MenuHomeFreeBSD

Expose <sys/types.h> kernel decls to sysunit tests
AbandonedPublic

Authored by rstone on Jan 25 2022, 9:36 PM.
Tags
None
Referenced Files
F104300763: D34033.diff
Fri, Dec 6, 1:54 AM
Unknown Object (File)
Sep 12 2024, 6:03 PM
Unknown Object (File)
Sep 10 2024, 8:13 PM
Unknown Object (File)
Sep 8 2024, 2:09 PM
Unknown Object (File)
Sep 4 2024, 6:49 PM
Unknown Object (File)
Aug 16 2024, 12:35 PM
Unknown Object (File)
Jul 12 2024, 8:12 AM
Unknown Object (File)
Jul 5 2024, 7:04 AM
Subscribers

Details

Reviewers
vangyzen
imp
Summary

In order to write unit tests for kernel code, unit tests require
access to certain kernel declarations in our header files. They
can't just get them by defining _KERNEL as that causes unwanted
behaviour for userland code (for example, <sys/errno.h> will not
define errno if _KERNEL is defined).

Add a new macro that unit tests can define to request that
kernel declarations be exposed. Support for this define
can be faulted in to additional headers as unit tests are written
and require access to particular declarations.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 44090
Build 40978: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Jan 25 2022, 9:58 PM

glebius@ has requested a different approach where unit tests define _KERNEL and opt out of the KPI symbols that they don't want, rather than opting into the symbols that they do want.