tester.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2007 Martin Decky
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  *
00009  * - Redistributions of source code must retain the above copyright
00010  *   notice, this list of conditions and the following disclaimer.
00011  * - Redistributions in binary form must reproduce the above copyright
00012  *   notice, this list of conditions and the following disclaimer in the
00013  *   documentation and/or other materials provided with the distribution.
00014  * - The name of the author may not be used to endorse or promote products
00015  *   derived from this software without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
00018  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00019  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00020  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
00021  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
00022  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00023  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00024  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00025  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00026  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00027  */
00028 
00035 #ifndef TESTER_H_
00036 #define TESTER_H_
00037 
00038 #include <sys/types.h>
00039 #include <bool.h>
00040 #include <stacktrace.h>
00041 
00042 #define IPC_TEST_SERVICE  10240
00043 #define IPC_TEST_METHOD   2000
00044 
00045 extern bool test_quiet;
00046 extern int test_argc;
00047 extern char **test_argv;
00048 
00055 #define sizeof_array(array) \
00056         (sizeof(array) / sizeof((array)[0]))
00057 
00058 #define TPRINTF(format, ...) \
00059         do { \
00060                 if (!test_quiet) { \
00061                         fprintf(stderr, (format), ##__VA_ARGS__); \
00062                 } \
00063         } while (0)
00064 
00065 #define TSTACKTRACE() \
00066         do { \
00067                 if (!test_quiet) { \
00068                         stacktrace_print(); \
00069                 } \
00070         } while (0)
00071 
00072 typedef const char *(*test_entry_t)(void);
00073 
00074 typedef struct {
00075         const char *name;
00076         const char *desc;
00077         test_entry_t entry;
00078         bool safe;
00079 } test_t;
00080 
00081 extern const char *test_thread1(void);
00082 extern const char *test_print1(void);
00083 extern const char *test_print2(void);
00084 extern const char *test_print3(void);
00085 extern const char *test_print4(void);
00086 extern const char *test_print5(void);
00087 extern const char *test_console1(void);
00088 extern const char *test_stdio1(void);
00089 extern const char *test_stdio2(void);
00090 extern const char *test_fault1(void);
00091 extern const char *test_fault2(void);
00092 extern const char *test_fault3(void);
00093 extern const char *test_vfs1(void);
00094 extern const char *test_ping_pong(void);
00095 extern const char *test_loop1(void);
00096 extern const char *test_malloc1(void);
00097 extern const char *test_malloc2(void);
00098 extern const char *test_malloc3(void);
00099 extern const char *test_mapping1(void);
00100 extern const char *test_serial1(void);
00101 extern const char *test_virtchar1(void);
00102 extern const char *test_devman1(void);
00103 extern const char *test_devman2(void);
00104 
00105 extern test_t tests[];
00106 
00107 #endif
00108 

Generated on Thu Jun 2 07:45:43 2011 for HelenOS/USB by  doxygen 1.4.7