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