1 #include <darwintest.h> 2 #include <sys/sysctl.h> 3 4 T_GLOBAL_META( 5 T_META_NAMESPACE("xnu.arm"), 6 T_META_RADAR_COMPONENT_NAME("xnu"), 7 T_META_RADAR_COMPONENT_VERSION("arm"), 8 T_META_OWNER("mwm") 9 ); 10 11 T_DECL(ptrauth_data_tests, "invoke the PAC unit tests", T_META_ASROOT(true)) 12 { 13 #if __has_feature(ptrauth_calls) 14 int ret, dummy = 1; 15 ret = sysctlbyname("kern.run_ptrauth_data_tests", NULL, NULL, &dummy, sizeof(dummy)); 16 T_ASSERT_POSIX_SUCCESS(ret, "run ptrauth data tests"); 17 #else 18 T_SKIP("Running on non-ptrauth system. Skipping..."); 19 #endif //__has_feature(ptrauth_calls) 20 } 21