GenI 0.24.1 → 0.24.2
raw patch · 2 files changed
+19/−9 lines, 2 files
Files
- GenI.cabal +1/−1
- src/NLP/GenI/Console.hs +18/−8
GenI.cabal view
@@ -1,5 +1,5 @@ Name: GenI-Version: 0.24.1+Version: 0.24.2 License: GPL License-file: LICENSE Author: Carlos Areces and Eric Kow
src/NLP/GenI/Console.hs view
@@ -21,7 +21,11 @@ {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternGuards #-}-module NLP.GenI.Console ( consoleGeni, loadNextSuite ) where+module NLP.GenI.Console (+ consoleGeni, loadNextSuite,+ -- * Internal+ RunAs(..), writeResults, getBatchDir+ ) where import Control.Applicative (pure, (<$>)) import Control.Monad@@ -111,12 +115,7 @@ runInstructions :: ProgStateRef -> CustomSem sem -> IO () runInstructions pstRef wrangler = do pst <- readIORef pstRef- batchDir <- case getFlag BatchDirFlg pst of- Nothing -> do- t <- getTemporaryDirectory- utc <- fmtTime <$> getCurrentTime- return (t </> "geni-" ++ utc)- Just bdir -> return bdir+ batchDir <- getBatchDir pst runBatch batchDir unless (hasFlag BatchDirFlg pst) $ ePutStr. unlines $ [ ""@@ -124,7 +123,6 @@ , "To save results in a different directory, use the --batchdir flag" ] where- fmtTime = formatTime defaultTimeLocale (iso8601DateFormat (Just "%H%M")) runBatch bdir = do pst <- readIORef pstRef let instructions = getListFlag TestInstructionsFlg pst@@ -157,6 +155,18 @@ (if null badres then "" else parens (pretty (length badres) <+> "failures")) where (goodres, badres) = partition isSuccess (grResults gresults)++-- | Return the batch directory or a temporary directory if unset+getBatchDir :: HasFlags fs => fs -> IO FilePath+getBatchDir pst = do+ case getFlag BatchDirFlg pst of+ Nothing -> do+ t <- getTemporaryDirectory+ utc <- fmtTime <$> getCurrentTime+ return (t </> "geni-" ++ utc)+ Just bdir -> return bdir+ where+ fmtTime = formatTime defaultTimeLocale (iso8601DateFormat (Just "%H%M")) -- | Used in processing instructions files. Each instruction consists of a -- suite file and a list of test case names from that file