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
Unknown Object (File)
Dec 20 2023, 4:20 AM
Unknown Object (File)
Oct 27 2023, 1:56 AM
Unknown Object (File)
May 3 2023, 9:47 PM
Unknown Object (File)
Mar 2 2023, 4:19 PM
Unknown Object (File)
Feb 16 2023, 12:17 PM
Unknown Object (File)
Feb 14 2023, 9:17 AM
Unknown Object (File)
Dec 14 2022, 9:52 PM
Unknown Object (File)
Dec 14 2022, 6:17 PM
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.