summaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2016-05-22 14:41:48 +0200
committerThomas Miedema <thomasmiedema@gmail.com>2016-05-22 20:51:51 +0200
commit2230c8822233d6d68f930170cd51d96169649056 (patch)
treea61ea6537a9b480b823016d450e2b8659b1f2919 /libraries
parentfa58710feef38337230bf9d69670dcad2d3c1fb1 (diff)
downloadhaskell-2230c8822233d6d68f930170cd51d96169649056.tar.gz
Testsuite: fix T12010 for real
* Use `extra_files` instead of (the deprecated) `extra_clean` (#11980). * Don't depend on generated files from build tree (libraries/base/include/HsBaseConfig.h). Running 'make test TEST=T12010' should work, even without building GHC first (it will use the system installed ghc). Test Plan: 'make test TEST=T12010' on Linux and Windows. Reviewed by: Phyx Differential Revision: https://phabricator.haskell.org/D2256 GHC Trac Issues: #12010
Diffstat (limited to 'libraries')
-rw-r--r--libraries/base/tests/IO/T12010/Makefile7
-rw-r--r--libraries/base/tests/IO/T12010/T12010.hsc7
-rw-r--r--libraries/base/tests/IO/T12010/test.T4
3 files changed, 7 insertions, 11 deletions
diff --git a/libraries/base/tests/IO/T12010/Makefile b/libraries/base/tests/IO/T12010/Makefile
index b924de29ae..ac7a13c637 100644
--- a/libraries/base/tests/IO/T12010/Makefile
+++ b/libraries/base/tests/IO/T12010/Makefile
@@ -1,11 +1,10 @@
TOP=../../../../../testsuite
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
-TESTDIR=$(TOP)/../libraries/base/tests/IO/T12010
.PHONY: T12010
T12010:
- '$(HSC2HS)' -I $(TOP)/../libraries/base/include/ -I $(TOP)/../includes/ T12010.hsc
- '$(TEST_HC)' $(TEST_HC_OPTS) $(WAY_FLAGS) -c $(TESTDIR)/cbits/initWinSock.c
- '$(TEST_HC)' $(TEST_HC_OPTS) $(WAY_FLAGS) -fno-warn-unsupported-calling-conventions $(TESTDIR)/cbits/initWinSock.o $(TESTDIR)/T12010.hs
+ '$(HSC2HS)' T12010.hsc
+ '$(TEST_HC)' $(TEST_HC_OPTS) $(WAY_FLAGS) -c cbits/initWinSock.c
+ '$(TEST_HC)' $(TEST_HC_OPTS) $(WAY_FLAGS) -v0 -fno-warn-unsupported-calling-conventions cbits/initWinSock.o T12010.hs
./T12010
diff --git a/libraries/base/tests/IO/T12010/T12010.hsc b/libraries/base/tests/IO/T12010/T12010.hsc
index fa566e0025..e13a5fe5c7 100644
--- a/libraries/base/tests/IO/T12010/T12010.hsc
+++ b/libraries/base/tests/IO/T12010/T12010.hsc
@@ -7,10 +7,9 @@ import Foreign.Marshal.Alloc
import GHC.IO.FD
import System.Exit
--- HsBase includes WinSock on Windows, on POSIX we need to explicitly ask for
--- sockets.
-#include "HsBase.h"
-#ifndef _WIN32
+#ifdef _WIN32
+#include <winsock.h>
+#else
#include <sys/socket.h>
#endif
diff --git a/libraries/base/tests/IO/T12010/test.T b/libraries/base/tests/IO/T12010/test.T
index ecf48284fa..b7b64c770c 100644
--- a/libraries/base/tests/IO/T12010/test.T
+++ b/libraries/base/tests/IO/T12010/test.T
@@ -1,10 +1,8 @@
test('T12010',
[
- extra_clean(['cbits/initWinSock.o', 'T12010.hi', 'T12010.hs']),
+ extra_files(['cbits/']),
only_ways(['threaded1']),
extra_ways(['threaded1']),
- exit_code(0),
- ignore_output,
cmd_prefix('WAY_FLAGS="' + ' '.join(config.way_flags('T12010')['threaded1']) + '"')],
run_command,
['$MAKE -s --no-print-directory T12010'])