Skip to content

Commit

Permalink
Add print of save file location
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterRugg committed Jan 15, 2025
1 parent 7f4177d commit ad525a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/QuickCheckVEngine/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,12 @@ main = withSocketsDo $ do
Just dir -> do
t <- getCurrentTime
let tstamp = [if x == ' ' then '_' else if x == ':' then '-' else x | x <- show t]
let fname = dir ++ "/failure-" ++ tstamp ++ ".S"
let prelude = case sourceFile of
Just name -> "# Generated from input file: " ++ show name ++ "\n"
Nothing -> "# Automatically generated failing test case\n"
writeFile (dir ++ "/failure-" ++ tstamp ++ ".S") (prelude ++ contents)
putStrLn $ "Writing counterexample file to: " ++ fname
writeFile fname (prelude ++ contents)
let saveOnFail :: Maybe FilePath -> Test TestResult -> (Test TestResult -> Test TestResult) -> IO ()
saveOnFail sourceFile test testTrans = runImpls implA m_implB alive (timeoutDelay flags) 0 Nothing test onTrace onDeath onDeath
where onDeath test = do putStrLn "Failure rerunning test"
Expand Down

0 comments on commit ad525a0

Please sign in to comment.