xref: /xnu-10002.41.9/tests/test_utils.h (revision 699cd48037512bf4380799317ca44ca453c82f57)
1*699cd480SApple OSS Distributions #ifndef XNU_DARWINTEST_UTILS_H
2*699cd480SApple OSS Distributions #define XNU_DARWINTEST_UTILS_H
3*699cd480SApple OSS Distributions 
4*699cd480SApple OSS Distributions #include <stdbool.h>
5*699cd480SApple OSS Distributions 
6*699cd480SApple OSS Distributions /* Misc. utility functions for writing darwintests. */
7*699cd480SApple OSS Distributions bool is_development_kernel(void);
8*699cd480SApple OSS Distributions 
9*699cd480SApple OSS Distributions /* Launches the given helper variant as a managed process. */
10*699cd480SApple OSS Distributions pid_t launch_background_helper(
11*699cd480SApple OSS Distributions 	const char* variant,
12*699cd480SApple OSS Distributions 	bool start_suspended,
13*699cd480SApple OSS Distributions 	bool memorystatus_managed);
14*699cd480SApple OSS Distributions /*
15*699cd480SApple OSS Distributions  * Set the process's managed bit, so that the memorystatus subsystem treats
16*699cd480SApple OSS Distributions  * this process like an app instead of a sysproc.
17*699cd480SApple OSS Distributions  */
18*699cd480SApple OSS Distributions void set_process_memorystatus_managed(pid_t pid);
19*699cd480SApple OSS Distributions 
20*699cd480SApple OSS Distributions #define XNU_T_META_SOC_SPECIFIC T_META_TAG("SoCSpecific")
21*699cd480SApple OSS Distributions 
22*699cd480SApple OSS Distributions #define XNU_T_META_REQUIRES_DEVELOPMENT_KERNEL T_META_REQUIRES_SYSCTL_EQ("kern.development", 1)
23*699cd480SApple OSS Distributions #define XNU_T_META_REQUIRES_RELEASE_KERNEL T_META_REQUIRES_SYSCTL_EQ("kern.development", 0)
24*699cd480SApple OSS Distributions 
25*699cd480SApple OSS Distributions #endif /* XNU_DARWINTEST_UTILS_H */
26