diff options
| author | Roman Smrž <roman.smrz@seznam.cz> | 2026-10-17 20:40:33 +0200 |
|---|---|---|
| committer | Roman Smrž <roman.smrz@seznam.cz> | 2026-10-21 20:37:20 +0200 |
| commit | 8f62c1ad5045564d8fd5ddafea877efc2d7fc803 (patch) | |
| tree | 4994ec461fe9ec8bde13ea8fea3192604ea3ca4f /src/Run.hs | |
| parent | e56577e4506c7db72aef9e273cfa00592ca20829 (diff) | |
Diffstat (limited to 'src/Run.hs')
| -rw-r--r-- | src/Run.hs | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -44,6 +44,7 @@ import System.Posix.Signals import System.Process import Config +import Error import GDB import Network import Network.Ip @@ -117,7 +118,7 @@ runTest out opts gdefs test = do when (optForce opts) $ removeDirectoryRecursive testDir `catchIOError` \e -> if isDoesNotExistError e then return () else ioError e exists <- doesPathExist testDir - when exists $ ioError $ userError $ testDir ++ " exists" + when exists $ throwOtherError $ "test directory ‘" <> T.pack testDir <> "’ already exists" createDirectoryIfMissing True testDir failedVar <- newTVarIO Nothing @@ -136,12 +137,12 @@ runTest out opts gdefs test = do let path = takeWhile (/= '\n') cabalOut return $ T.unpack $ T.unwords (T.pack path : args) _ -> do - ioError $ userError $ "failed to find ‘" <> T.unpack name <> "’ executable path using cabal" + throwOtherError $ "failed to find ‘" <> name <> "’ executable path using cabal" | otherwise -> return $ T.unpack arg defaultTool <- case optDefaultTool opts of Just tool -> evalTool tool - Nothing -> ioError $ userError "No test tool defined" + Nothing -> throwOtherError "no test tool defined" procTools <- mapM (sequence . fmap evalTool) $ optProcTools opts mgdb <- if optGDB opts |