From b3ed032566f4e1ad7ea76a807a2ae54d08b38f31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sun, 23 Aug 2026 21:47:11 +0200 Subject: Create test dir subdirectory for based on test name Changelog: Create test dir subdirectory for given test that includes the test module and name. --- src/Run.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Run.hs') diff --git a/src/Run.hs b/src/Run.hs index f3805ea..7dc5f5d 100644 --- a/src/Run.hs +++ b/src/Run.hs @@ -32,6 +32,7 @@ import Data.Text qualified as T import Data.Typeable import System.Directory +import System.FilePath import System.Exit import System.IO.Error import System.Posix.Process @@ -58,7 +59,7 @@ import Test.Builtins runTest :: Output -> TestOptions -> GlobalDefs -> Test -> IO Bool runTest out opts gdefs test = do - let testDir = optTestDir opts + let testDir = optTestDir opts T.unpack (textModuleName (testModuleName test) <> "." <> testName test) when (optForce opts) $ removeDirectoryRecursive testDir `catchIOError` \e -> if isDoesNotExistError e then return () else ioError e exists <- doesPathExist testDir @@ -81,6 +82,7 @@ runTest out opts gdefs test = do { teOutput = out , teFailed = failedVar , teOptions = opts + , teTestDir = testDir , teNextObjId = objIdVar , teNextProcId = procIdVar , teProcesses = procVar @@ -302,7 +304,7 @@ runStep = \case withInternet :: (Network -> TestRun a) -> TestRun a withInternet inner = do - testDir <- asks $ optTestDir . teOptions . fst + testDir <- asks $ teTestDir . fst inet <- newInternet testDir flip finally (delInternet inet) $ do withNetwork (inetRoot inet) $ \net -> do -- cgit v1.2.3