From 3ddfc0111566113b3ec15725cb5ced6dea531a3a Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Mon, 13 May 2019 20:35:10 +0100 Subject: Fix report generation for fuzz run --- src/VeriFuzz/Fuzz.hs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/VeriFuzz/Fuzz.hs b/src/VeriFuzz/Fuzz.hs index da59da1..825017a 100644 --- a/src/VeriFuzz/Fuzz.hs +++ b/src/VeriFuzz/Fuzz.hs @@ -26,7 +26,7 @@ where import Control.DeepSeq (force) import Control.Exception.Lifted (finally) -import Control.Lens +import Control.Lens hiding ((<.>)) import Control.Monad (forM, void) import Control.Monad.IO.Class import Control.Monad.Trans.Class (lift) @@ -139,8 +139,12 @@ pop f a = do dir <- liftSh pwd finally (liftSh (cd f) >> a) . liftSh $ cd dir +applyList :: [a -> b] -> [a] -> [b] +applyList a b = apply' <$> zip a b + where apply' (a', b') = a' b' + toSynthResult :: [(SynthTool, SynthTool)] -> [Result Failed ()] -> [SynthResult] -toSynthResult a b = uncurry SynthResult <$> a <*> b +toSynthResult a b = flip applyList b $ uncurry SynthResult <$> a equivalence :: (MonadBaseControl IO m, MonadSh m) => SourceInfo -> Fuzz m () equivalence src = do @@ -180,7 +184,10 @@ reduction src = do where red (SynthResult a b _) = do make dir - pop dir $ reduceSynth a b src + pop dir $ do + s <- reduceSynth a b src + writefile (fromText ".." dir <.> "v") $ genSource s + return s where dir = fromText $ "reduce_" <> toText a <> "_" <> toText b -- cgit