xref: /minix3/minix/tests/common.h (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1433d6423SLionel Sambuc 
2433d6423SLionel Sambuc #include <errno.h>
3433d6423SLionel Sambuc #include <stdlib.h>
4433d6423SLionel Sambuc #include <string.h>
5433d6423SLionel Sambuc #include <unistd.h>
6c4182e08SErik van der Kouwe #include <stdint.h>
7433d6423SLionel Sambuc #include <stdio.h>
8433d6423SLionel Sambuc #include <time.h>
9433d6423SLionel Sambuc #include <sys/statvfs.h>
10433d6423SLionel Sambuc 
11433d6423SLionel Sambuc #define e(errn) e_f(__FILE__, __LINE__, (errn))
12433d6423SLionel Sambuc #define em(errn,msg) do { fprintf(stderr, "%s\n", msg); e(errn); } while(0)
1317fbdaf5SErik van der Kouwe #define efmt(...) fail_printf(__FILE__, __FUNCTION__, __LINE__, __VA_ARGS__)
14433d6423SLionel Sambuc 
15433d6423SLionel Sambuc #define BIGVARNAME "BIGTEST"
16433d6423SLionel Sambuc 
17433d6423SLionel Sambuc void printprogress(char *msg, int i, int max);
18433d6423SLionel Sambuc void cleanup(void);
19433d6423SLionel Sambuc int does_fs_truncate(void);
20433d6423SLionel Sambuc void e_f(char *file, int lineno, int n);
2117fbdaf5SErik van der Kouwe void fail_printf(const char *file, const char *func, int line,
2217fbdaf5SErik van der Kouwe 	const char *fmt, ...) __attribute__ ((format(printf, 4, 5)));
23433d6423SLionel Sambuc int name_max(char *path);
24433d6423SLionel Sambuc void quit(void);
25433d6423SLionel Sambuc void rm_rf_dir(int test_nr);
26433d6423SLionel Sambuc void rm_rf_ppdir(int test_nr);
27433d6423SLionel Sambuc void start(int test_nr);
28c4182e08SErik van der Kouwe void getmem(uint32_t *total, uint32_t *free, uint32_t *cached);
293433559cSErik van der Kouwe int get_setting_use_network(void);
30433d6423SLionel Sambuc 
31433d6423SLionel Sambuc extern int common_test_nr, errct, subtest;
32*0a6a1f1dSLionel Sambuc int system_p(const char *command);
33