runTest :: FilePath -> FilePath -> IO Bool
runTest bin path = do
  (fp, h) <- openTempFile "." ".temp"
  (_, _, _, p) <- createProcess $ process bin path (UseHandle h)
  waitForProcess p
  h1 <- openFile fp ReadMode
  output <- hGetContents h1
  putStr output
  eOutput <- readFile $ (path ++ ".output")
  putStr eOutput
  removeFile fp
  if output == eOutput then return True
  else do putStrLn ("----------------------------------------------------")
          putStrLn ("-- Testfile: " ++ path ++ " failed")
          putStrLn ("----------------------------------------------------")
          putStrLn ("Output:\n" ++ output)
          putStrLn ("Expected:\n" ++ eOutput)
          return False

-- | Spawn a process with the moniteshell running a script file
runTest :: FilePath -> FilePath -> IO Bool
runTest bin path = do
  (fp, h) <- openTempFile "." ".temp"
  (_, _, _, p) <- createProcess $ process bin path (UseHandle h)
  waitForProcess p
  h1 <- openFile fp ReadMode
  output <- hGetContents h1
  putStr output
  eOutput <- readFile $ (path ++ ".output")
  putStr eOutput
  removeFile fp
  if output == eOutput then return True
  else do putStrLn ("----------------------------------------------------")
          putStrLn ("-- Testfile: " ++ path ++ " failed")
          putStrLn ("----------------------------------------------------")
          putStrLn ("Output:\n" ++ output)
          putStrLn ("Expected:\n" ++ eOutput)
          return False

-- | Spawn a process with the moniteshell running a script file
runTest bin path = do
  (fp, h) <- openTempFile "." ".temp"
  (_, _, _, p) <- createProcess $ process bin path (UseHandle h)
  waitForProcess p
  h1 <- openFile fp ReadMode
  output <- hGetContents h1
  putStr output
  eOutput <- readFile $ (path ++ ".output")
  putStr eOutput
  removeFile fp
  if output == eOutput then return True
  else do putStrLn ("----------------------------------------------------")
          putStrLn ("-- Testfile: " ++ path ++ " failed")
          putStrLn ("----------------------------------------------------")
          putStrLn ("Output:\n" ++ output)
          putStrLn ("Expected:\n" ++ eOutput)
          return False

-- | Spawn a process with the moniteshell running a script file