[commit: ghc] ghc-8.0: Testsuite: fix T12010 for real (2557d25)

git at git.haskell.org git at git.haskell.org
Mon Sep 5 21:27:19 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/2557d258033071482c37383ce54768101f801533/ghc

>---------------------------------------------------------------

commit 2557d258033071482c37383ce54768101f801533
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date:   Sun May 22 14:41:48 2016 +0200

    Testsuite: fix T12010 for real
    
    * 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
    
    (cherry picked from commit 2230c8822233d6d68f930170cd51d96169649056)


>---------------------------------------------------------------

2557d258033071482c37383ce54768101f801533
 libraries/base/tests/IO/T12010/Makefile   | 7 +++----
 libraries/base/tests/IO/T12010/T12010.hsc | 7 +++----
 libraries/base/tests/IO/T12010/test.T     | 4 +---
 3 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/libraries/base/tests/IO/T12010/Makefile b/libraries/base/tests/IO/T12010/Makefile
index b924de2..ac7a13c 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 fa566e0..e13a5fe 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 ecf4828..51c7a81 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_clean(['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'])



More information about the ghc-commits mailing list