🔊 zlog set up
This commit is contained in:
parent
0e7a1f5623
commit
fc736642b2
21 changed files with 302 additions and 157 deletions
|
|
@ -9,6 +9,7 @@ char display_name[5];
|
|||
int aswm_pid;
|
||||
Display* test_display;
|
||||
Window test_root;
|
||||
zlog_category_t *test_log;
|
||||
|
||||
// Local variables
|
||||
unsigned int display_count = 100;
|
||||
|
|
@ -25,6 +26,24 @@ void run_xephyr() {
|
|||
execvp(args[0], args);
|
||||
}
|
||||
|
||||
void set_up_test_logger(void) {
|
||||
int rc;
|
||||
|
||||
rc = zlog_init(ASWM_TEST_DIR "/log.conf");
|
||||
if (rc) {
|
||||
printf("Init test zlog failed\n");
|
||||
}
|
||||
|
||||
test_log = zlog_get_category("test_log");
|
||||
if (!test_log) {
|
||||
printf("Get zlog test_log category failed\n");
|
||||
}
|
||||
}
|
||||
|
||||
void tear_down_test_logger(void) {
|
||||
zlog_fini();
|
||||
}
|
||||
|
||||
void setUp(void) {
|
||||
tmpnam(display_fd); // Creates a temporary file name
|
||||
sprintf(display_name, ":%u", display_count); // Loads initial display count
|
||||
|
|
@ -34,7 +53,7 @@ void setUp(void) {
|
|||
if(xephyr_pid == 0) {
|
||||
run_xephyr();
|
||||
} else {
|
||||
printf("Trying to run Xephyr instance on :%u...\n", display_count);
|
||||
zlog_info(test_log, "Trying to run Xephyr instance on :%u...", display_count);
|
||||
}
|
||||
|
||||
// The following loop waits for one of those two things:
|
||||
|
|
@ -60,7 +79,7 @@ void setUp(void) {
|
|||
if(xephyr_pid == 0) {
|
||||
run_xephyr();
|
||||
} else {
|
||||
printf("Trying to run Xephyr instance on :%u...\n", display_count);
|
||||
zlog_info(test_log, "Trying to run Xephyr instance on :%u...", display_count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -68,8 +87,8 @@ void setUp(void) {
|
|||
|
||||
aswm_pid = fork();
|
||||
if(aswm_pid == 0) {
|
||||
printf("Running aswm instance on %s...\n", display_name);
|
||||
char* args[] = {"./aswm", NULL};
|
||||
zlog_info(test_log, "Running aswm instance on %s...", display_name);
|
||||
char* args[] = {"./aswm", "--log", ASWM_TEST_DIR "/aswm_log.conf", NULL};
|
||||
char display_env[256];
|
||||
sprintf(display_env, "DISPLAY=%s", display_name);
|
||||
char* envp[] = {display_env, NULL};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue