]> git.saurik.com Git - apple/xnu.git/blobdiff - tools/tests/xnu_quick_test/tests.h
xnu-2422.90.20.tar.gz
[apple/xnu.git] / tools / tests / xnu_quick_test / tests.h
index 6505466eaafcfa2dc7c8889abef93b77581df607..6edbaa9b66f101df0d4efa69c113841d671af034 100644 (file)
@@ -1,9 +1,6 @@
 #ifndef _TESTS_H_
 #define        _TESTS_H_
 
-#ifndef DEBUG
-#define DEBUG                          0
-#endif
 #ifndef CONFORMANCE_TESTS_IN_XNU
 #define CONFORMANCE_TESTS_IN_XNU       0
 #endif
@@ -19,6 +16,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <stdbool.h>
+#include <assert.h>
+#include <stdarg.h>            /* Used to support printf() in misc.c */
 #include <mach/machine.h>      /* Used to determine host properties */
 #include <mach/vm_inherit.h>
 #include <sys/acct.h>
 #include <sys/ucred.h>
 #include <sys/vnode.h>
 #include <sys/wait.h>
-        
+#include <TargetConditionals.h> /* for TARGET_OS_EMBEDDED */
+
 #define MY_BUFFER_SIZE (1024 * 10)
-#define POWERPC        238947
+#define ARM    100  /* I am not sure if the value really matters? */
 #define INTEL  38947                   /* 
                                         * Random values used by execve tests to 
                                         * determine architecture of machine.
                                         */
 
+#define FILE_NOTME "/private/tmp/notme"                /* file in /private/tmp not owned by the current user */
+#define FILE_ME "/private/tmp/me"              /* file in /private/tmp owned by the current user */
+
 typedef int (*test_rtn_t)(void *);
 
 int access_chmod_fchmod_test( void * the_argp );
@@ -69,6 +73,7 @@ int create_file_with_name( char *the_pathp, char *the_namep, int remove_existing
 int create_random_name( char *the_pathp, int do_open );
 int directory_tests( void * the_argp );
 int do_execve_test(char * path, char * argv[], void * envpi, int killwait);
+int do_spawn_test(int arch, int shouldfail);
 int dup_test( void * the_argp );
 int exchangedata_test( void * the_argp );
 int execve_kill_vfork_test( void * the_argp );
@@ -80,7 +85,7 @@ int get_bits(void);                                   /* 64 or 32 */
 int getlogin_setlogin_test( void * the_argp );
 int getpid_getppid_pipe_test( void * the_argp );
 int getpriority_setpriority_test( void * the_argp );
-int getrusage_profil_test( void * the_argp );
+int getrusage_test( void * the_argp );
 int groups_test( void * the_argp );
 int ioctl_test( void * the_argp );
 int kqueue_tests( void * the_argp );
@@ -108,6 +113,16 @@ int syscall_test( void * the_argp );
 int time_tests( void * the_argp );
 int uid_tests( void * the_argp );
 int xattr_tests( void * the_argp );
+int data_exec_tests( void * the_argp );
+int machvm_tests( void * the_argp );
+int getdirentries_test( void * the_argp );
+int statfs_32bit_inode_tests( void * the_argp );
+int commpage_data_tests( void * the_argp );
+int atomic_fifo_queue_test( void * the_argp );
+int sched_tests( void * the_argp );
+int content_protection_test( void * the_argp );
+int pipes_test( void * the_argp );
+int kaslr_test( void * the_argp );
 
 struct test_entry 
 {
@@ -118,4 +133,18 @@ struct test_entry
 };
 typedef struct test_entry * test_entryp;
 
+/* Special replacement printf with date/time stamp */
+int my_printf(const char * __restrict fmt, ...);
+#define printf my_printf
+
+/* 
+   If running xnu_quick_test under testbots, disable special 
+   printf defined in the previous step. This is done in order
+   to generate log messages in a format which testbots understands
+*/ 
+
+#if RUN_UNDER_TESTBOTS
+#undef printf
+#endif
+
 #endif /* !_TESTS_H_ */