Skip to content
Snippets Groups Projects
Commit 41054fe5 authored by chrg's avatar chrg
Browse files

Quality of life stuff

parent a9918e16
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@ import ReduceC
import Colog
import Control.Applicative
import Control.Monad
import Control.Monad.IRTree qualified as RPath
import Control.Monad.State
import Data.Foldable
import Data.Functor
......@@ -106,7 +107,7 @@ run = do
<> fmtMessage m
)
usingLoggerT (cmapM fmt logTextStderr) do
usingLoggerT (filterBySeverity Info msgSeverity $ cmapM fmt logTextStderr) do
let
test f = process D ("test " <> Text.pack f) do
err <- liftIO $ runProcess cmd
......@@ -131,21 +132,25 @@ run = do
removeFile (f <.> "bak")
liftIO exitFailure
check' f _ c = process I "Checking predictate" do
check' f l c = process D "Checking predictate" do
when debug do
pPrint (void c)
when pedandic do
liftIO $ copyFile f (f <.> "last")
logDebug (Text.pack . show $ RPath.fromChoiceList $ map fst l)
output f c
v <- validiate f
if v
then test f
else do
logWarning "Produced invalid code"
when pedandic do
res <-
if v
then test f
else do
logWarning "Produced invalid code"
liftIO $ copyFile f (f <.> "fail")
cleanup f
pure False
when pedandic do
cleanup f
pure False
logInfo ("Predicate was " <> Text.pack (show res))
pure res
let bak = file <.> "bak"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment