about summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-02-12 20:53:10 +0000
committerJames Booth <boothj5@gmail.com>2014-02-12 20:53:10 +0000
commit1dccce505678794cfa99e370573bf2e04919d1aa (patch)
treeebb1d78f96fc285e50618770aa9b36a31a5fad86 /tests
parent4cb302abda9e011e5f53db5767009f070d8f8378 (diff)
parent90d2cbff7bd3a5a34fa4dee9d8a42307606c84e9 (diff)
downloadprofani-tty-1dccce505678794cfa99e370573bf2e04919d1aa.tar.gz
Merge branch 'master' of github.com:boothj5/profanity
Diffstat (limited to 'tests')
-rw-r--r--tests/testsuite.c35
1 files changed, 1 insertions, 34 deletions
diff --git a/tests/testsuite.c b/tests/testsuite.c
index d4d2eb8b..5e246020 100644
--- a/tests/testsuite.c
+++ b/tests/testsuite.c
@@ -26,10 +26,6 @@
 #include "test_cmd_bookmark.h"
 #include "test_muc.h"
 
-#define PROF_RUN_TESTS(name) fprintf(stderr, "\n-> Running %s\n", #name); \
-    fflush(stderr); \
-    result += run_tests(name);
-
 int main(int argc, char* argv[]) {
     const UnitTest all_tests[] = {
         unit_test(replace_one_substr),
@@ -429,34 +425,5 @@ int main(int argc, char* argv[]) {
         unit_test(cmd_bookmark_remove_autojoin_shows_message_when_no_bookmark),
     };
 
-
-    int bak, bak2, new;
-    fflush(stdout);
-    fflush(stderr);
-    bak = dup(1);
-    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, 2);
-    close(new);
-
-    int result = 0;
-
-    PROF_RUN_TESTS(all_tests);
-
-    fflush(stdout);
-    dup2(bak, 1);
-    dup2(bak2, 2);
-    close(bak);
-    close(bak2);
-
-    if (result > 0) {
-        printf("\n\nFAILED TESTS, see ./testsuite.out\n\n");
-        return 1;
-    } else {
-        printf("\n\nAll tests passed\n\n");
-        return 0;
-    }
+    return run_tests(all_tests);
 }