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