This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "snap-server".

The branch, master has been updated
       via  446969dd3d11d925f519f238820c56dfd4e6604f (commit)
      from  ce603fd59f04ba7592aa8825f8f6ff5a60c7aa0c (commit)


Summary of changes:
 src/Snap/Http/Server.hs          |   30 +++++++++++++++---------------
 test/pongserver/Main.hs          |    5 ++---
 test/snap-server-testsuite.cabal |    9 ++++++---
 test/suite/Test/Blackbox.hs      |   14 ++++++++------
 test/testserver/Main.hs          |    6 ++----
 5 files changed, 33 insertions(+), 31 deletions(-)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 446969dd3d11d925f519f238820c56dfd4e6604f
Author: Gregory Collins <[email protected]>
Date:   Sun Oct 10 22:15:33 2010 +0200

    Fix testsuite for 0.3

diff --git a/src/Snap/Http/Server.hs b/src/Snap/Http/Server.hs
index 066fab9..264bcea 100644
--- a/src/Snap/Http/Server.hs
+++ b/src/Snap/Http/Server.hs
@@ -95,21 +95,21 @@ quickHttpServe m = commandLineConfig emptyConfig >>= \c -> 
httpServe c m
 setUnicodeLocale :: String -> IO ()
 setUnicodeLocale lang =
 #ifndef PORTABLE
-    mapM_ (\k -> setEnv k (lang ++ ".UTF-8") True)
-          [ "LANG"
-          , "LC_CTYPE"
-          , "LC_NUMERIC"
-          , "LC_TIME"
-          , "LC_COLLATE"
-          , "LC_MONETARY"
-          , "LC_MESSAGES"
-          , "LC_PAPER"
-          , "LC_NAME"
-          , "LC_ADDRESS"
-          , "LC_TELEPHONE"
-          , "LC_MEASUREMENT"
-          , "LC_IDENTIFICATION"
-          , "LC_ALL" ]
+    mapM_ (\k -> setEnv k (lang ++ ".UTF-8") True)
+          [ "LANG"
+          , "LC_CTYPE"
+          , "LC_NUMERIC"
+          , "LC_TIME"
+          , "LC_COLLATE"
+          , "LC_MONETARY"
+          , "LC_MESSAGES"
+          , "LC_PAPER"
+          , "LC_NAME"
+          , "LC_ADDRESS"
+          , "LC_TELEPHONE"
+          , "LC_MEASUREMENT"
+          , "LC_IDENTIFICATION"
+          , "LC_ALL" ]
 #else
     return ()
 #endif
diff --git a/test/pongserver/Main.hs b/test/pongserver/Main.hs
index 8e11b50..010f52f 100644
--- a/test/pongserver/Main.hs
+++ b/test/pongserver/Main.hs
@@ -2,6 +2,7 @@
 module Main where
 
 import           Control.Concurrent
+import           Control.Exception (finally)
 
 import           Snap.Iteratee
 import           Snap.Types
@@ -25,6 +26,4 @@ main = do
     return ()
 
   where
-    go m = do
-        httpServe "*" 3000 "localhost" Nothing Nothing pongServer 
-        putMVar m ()
+    go m = quickHttpServe pongServer `finally` putMVar m ()
diff --git a/test/snap-server-testsuite.cabal b/test/snap-server-testsuite.cabal
index e53088b..ff6def2 100644
--- a/test/snap-server-testsuite.cabal
+++ b/test/snap-server-testsuite.cabal
@@ -40,13 +40,14 @@ Executable testsuite
      old-locale,
      parallel > 2,
      iteratee >= 0.3.1 && < 0.4,
-     snap-core >= 0.2.12 && <0.3,
+     snap-core >= 0.3 && <0.4,
      template-haskell,
      test-framework >= 0.3.1 && <0.4,
      test-framework-hunit >= 0.2.5 && < 0.3,
      test-framework-quickcheck2 >= 0.2.6 && < 0.3,
      time,
      transformers,
+     utf8-string >= 0.3.6 && <0.4,
      vector >= 0.6.0.1 && < 0.7
 
    if !os(windows)
@@ -98,11 +99,12 @@ Executable pongserver
      murmur-hash >= 0.1 && < 0.2,
      network == 2.2.1.7,
      network-bytestring >= 0.1.2 && < 0.2,
-     snap-core >= 0.2.12 && <0.3,
+     snap-core >= 0.3 && <0.4,
      template-haskell,
      time,
      transformers,
      unix-compat,
+     utf8-string >= 0.3.6 && <0.4,
      vector >= 0.6.0.1 && < 0.7
 
    if flag(portable) || os(windows)
@@ -175,13 +177,14 @@ Executable testserver
      old-locale,
      parallel > 2,
      iteratee >= 0.3.1 && < 0.4,
-     snap-core >= 0.2.12 && <0.3,
+     snap-core >= 0.3 && <0.4,
      template-haskell,
      test-framework >= 0.3.1 && <0.4,
      test-framework-hunit >= 0.2.5 && < 0.3,
      test-framework-quickcheck2 >= 0.2.6 && < 0.3,
      time,
      transformers,
+     utf8-string >= 0.3.6 && <0.4,
      vector >= 0.6.0.1 && < 0.7
 
    if !os(windows)
diff --git a/test/suite/Test/Blackbox.hs b/test/suite/Test/Blackbox.hs
index a74cef9..c3b91d3 100644
--- a/test/suite/Test/Blackbox.hs
+++ b/test/suite/Test/Blackbox.hs
@@ -49,13 +49,15 @@ tests port = map ($ port) [ testPong
 
 startTestServer :: IO (ThreadId,Int)
 startTestServer = do
+    let cfg = setAccessLog (Just "ts-access.log") .
+              setErrorLog  (Just "ts-error.log")  .
+              setPort      port                   .
+              setVerbose   False                  .
+              setAddress   "*"                    $
+              defaultConfig
+              
     tid <- forkIO $
-           httpServe "*"
-                     port
-                     "localhost"
-                     (Just "ts-access.log")
-                     (Just "ts-error.log")
-                     testHandler
+           httpServe cfg testHandler
     waitabit
 
     return $ (tid, port)
diff --git a/test/testserver/Main.hs b/test/testserver/Main.hs
index e4e3956..51e248f 100644
--- a/test/testserver/Main.hs
+++ b/test/testserver/Main.hs
@@ -5,6 +5,7 @@
 module Main where
 
 import           Control.Concurrent
+import           Control.Exception (finally)
 
 import           Snap.Http.Server
 import           Test.Common.TestHandler
@@ -31,8 +32,5 @@ main = do
     return ()
 
   where
-    go m = do
-        httpServe "*" 3000 "localhost" (Just "ts-access.log")
-                  (Just "ts-error.log") testHandler 
-        putMVar m ()
+    go m = quickHttpServe testHandler `finally` putMVar m ()
 
-----------------------------------------------------------------------


hooks/post-receive
-- 
snap-server
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap

Reply via email to