on master help sign in
Merge pull request #3975 from bonds/master

Add support for running tests on OpenBSD, fixes #3964

commita5ff76d9d1f6f9ee45ffb449f13643113c836ae6 authorNiklas Larsson <metaniklas@gmail.com> dateSat 5 Aug 2017, 02:13 (9 years ago) parentc0c6665bd1aef3
3 files changed+10−1
test/TestRun.hs+2−1 test/base001/exit1.c+4 test/base001/sys.c+4
test/TestRun.hs+2−1
@@ -65,7 +65,8 @@ test testName path = goldenVsFileDiff testName diff ref output
6565 where
6666 ref = path </> "expected"
6767 output = path </> "output"
68− diff ref new = ["diff", "--strip-trailing-cr", "-u", new, ref]
68+ diff ref new | os == "openbsd" = ["diff", "-u", new, ref]
69+ | otherwise = ["diff", "--strip-trailing-cr", "-u", new, ref]
6970
7071-- Should always output a 3-charater string from a postive Int
7172indexToString :: Int -> String
test/base001/exit1.c+4
@@ -1,6 +1,10 @@
11#include <stdio.h>
22#include <stdlib.h>
33
4+#ifdef __OpenBSD__
5+#include <sys/wait.h>
6+#endif
7+
48void doSystem(const char cmd[]) {
59 printf("exit1: Executing cmd '%s'\n", cmd);
610 int exitStatus = system(cmd);
test/base001/sys.c+4
@@ -2,6 +2,10 @@
22
33#include <stdlib.h>
44
5+#ifdef __OpenBSD__
6+#include <sys/wait.h>
7+#endif
8+
59int WIFEXITED_(int status) {
610 return WIFEXITED(status);
711}