Skip to content

Include result.kore with --bug-report #2324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Jan 15, 2021
Merged
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions kore/app/exec/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ writeOptionsAndKoreFiles
opts@KoreExecOptions
{ definitionFileName
, patternFileName
--, outputFileName
, koreSolverOptions
, koreSearchOptions
, koreProveOptions
Expand All @@ -528,6 +529,9 @@ writeOptionsAndKoreFiles
(reportDirectory </> defaultDefinitionFilePath opts)
for_ patternFileName
$ flip copyFile (reportDirectory </> "pgm.kore")
-- for_ outputFileName
-- $ flip copyFile (reportDirectory </> "result.kore")
-- _ <- error "Test."
writeKoreSolverFiles koreSolverOptions reportDirectory
for_ koreSearchOptions
(writeKoreSearchFiles reportDirectory)
Expand Down Expand Up @@ -558,20 +562,14 @@ main = do

mainWithOptions :: KoreExecOptions -> IO ()
mainWithOptions execOptions = do
let KoreExecOptions
{ koreLogOptions
, koreSolverOptions
, bugReportOption
}
= execOptions
let KoreExecOptions { koreSolverOptions, bugReportOption, outputFileName } = execOptions
ensureSmtPreludeExists koreSolverOptions
exitCode <-
withBugReport Main.exeName bugReportOption $ \tmpDir -> do
writeOptionsAndKoreFiles tmpDir execOptions
go <* warnIfLowProductivity
& handle handleWithConfiguration
& handle handleSomeException
& runKoreLog tmpDir koreLogOptions
e <- code tmpDir
for_ outputFileName $ flip copyFile (tmpDir </> "result.kore")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will only capture the output if it is being written to a file already. It will not capture the standard output. We should write the output to a temporary file first, and copy the file or print it to standard output afterward.

return e
let KoreExecOptions { rtsStatistics } = execOptions
for_ rtsStatistics $ \filePath ->
writeStats filePath =<< getStats
Expand All @@ -580,6 +578,7 @@ mainWithOptions execOptions = do
KoreExecOptions { koreProveOptions } = execOptions
KoreExecOptions { koreSearchOptions } = execOptions
KoreExecOptions { koreMergeOptions } = execOptions
KoreExecOptions { koreLogOptions } = execOptions

handleSomeException :: SomeException -> Main ExitCode
handleSomeException someException = do
Expand Down Expand Up @@ -613,6 +612,12 @@ mainWithOptions execOptions = do
| otherwise =
koreRun execOptions

code :: FilePath -> IO ExitCode
code tmpDir = go <* warnIfLowProductivity
& handle handleWithConfiguration
& handle handleSomeException
& runKoreLog tmpDir koreLogOptions

koreSearch :: KoreExecOptions -> KoreSearchOptions -> Main ExitCode
koreSearch execOptions searchOptions = do
let KoreExecOptions { definitionFileName } = execOptions
Expand Down