1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Merge branch 'master' into plugins

This commit is contained in:
James Booth 2014-01-29 00:31:35 +00:00
commit f970d2d582
2 changed files with 13 additions and 2 deletions

1
.gitignore vendored
View File

@ -47,3 +47,4 @@ runvalgrind.sh
src/prof_config.h src/prof_config.h
clean.sh clean.sh
valgrind.out.old valgrind.out.old
testsuite.out

View File

@ -5,6 +5,7 @@
#include <stddef.h> #include <stddef.h>
#include <setjmp.h> #include <setjmp.h>
#include <cmocka.h> #include <cmocka.h>
#include <sys/stat.h>
#include "config/helpers.h" #include "config/helpers.h"
#include "test_autocomplete.h" #include "test_autocomplete.h"
@ -421,11 +422,16 @@ int main(int argc, char* argv[]) {
close_preferences), close_preferences),
}; };
int bak, new; int bak, bak2, new;
fflush(stdout); fflush(stdout);
fflush(stderr);
bak = dup(1); bak = dup(1);
new = open("/dev/null", O_WRONLY); bak2 = dup(2);
remove("./testsuite.out");
new = open("./testsuite.out", O_WRONLY | O_CREAT);
chmod("./testsuite.out", S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
dup2(new, 1); dup2(new, 1);
dup2(new, 2);
close(new); close(new);
int result = 0; int result = 0;
@ -448,11 +454,15 @@ int main(int argc, char* argv[]) {
fflush(stdout); fflush(stdout);
dup2(bak, 1); dup2(bak, 1);
dup2(bak2, 2);
close(bak); close(bak);
close(bak2);
if (result > 0) { if (result > 0) {
printf("\n\nFAILED TESTS, see ./testsuite.out\n\n");
return 1; return 1;
} else { } else {
printf("\n\nAll tests passed\n\n");
return 0; return 0;
} }
} }