mirror of
https://github.com/unisonweb/unison.git
synced 2024-11-13 09:55:35 +03:00
Fix blank version string in compiled output from transcript runner
- Some calls into the transcript runner are still given an invalid version string, but they are in the parser-typecheker's unit tests, not the main transcript runner.
This commit is contained in:
parent
2b5b07e8fe
commit
4074ea6c20
@ -120,8 +120,8 @@ parse srcName txt = case P.parse (stanzas <* P.eof) srcName txt of
|
|||||||
Right a -> Right a
|
Right a -> Right a
|
||||||
Left e -> Left (show e)
|
Left e -> Left (show e)
|
||||||
|
|
||||||
run :: FilePath -> FilePath -> [Stanza] -> Codebase IO Symbol Ann -> IO Text
|
run :: String -> FilePath -> FilePath -> [Stanza] -> Codebase IO Symbol Ann -> IO Text
|
||||||
run dir configFile stanzas codebase = do
|
run version dir configFile stanzas codebase = do
|
||||||
let initialPath = Path.absoluteEmpty
|
let initialPath = Path.absoluteEmpty
|
||||||
putPrettyLn $ P.lines [
|
putPrettyLn $ P.lines [
|
||||||
asciiartUnison, "",
|
asciiartUnison, "",
|
||||||
@ -144,7 +144,7 @@ run dir configFile stanzas codebase = do
|
|||||||
(config, cancelConfig) <-
|
(config, cancelConfig) <-
|
||||||
catchIOError (watchConfig configFile) $ \_ ->
|
catchIOError (watchConfig configFile) $ \_ ->
|
||||||
die "Your .unisonConfig could not be loaded. Check that it's correct!"
|
die "Your .unisonConfig could not be loaded. Check that it's correct!"
|
||||||
runtime <- RTI.startRuntime ""
|
runtime <- RTI.startRuntime version
|
||||||
traverse_ (atomically . Q.enqueue inputQueue) (stanzas `zip` [1..])
|
traverse_ (atomically . Q.enqueue inputQueue) (stanzas `zip` [1..])
|
||||||
let patternMap =
|
let patternMap =
|
||||||
Map.fromList
|
Map.fromList
|
||||||
|
@ -79,7 +79,7 @@ runTranscript (Codebase codebasePath fmt) transcript = do
|
|||||||
output <-
|
output <-
|
||||||
flip (either err) (TR.parse "transcript" (Text.pack . stripMargin $ unTranscript transcript)) $ \stanzas ->
|
flip (either err) (TR.parse "transcript" (Text.pack . stripMargin $ unTranscript transcript)) $ \stanzas ->
|
||||||
fmap Text.unpack $
|
fmap Text.unpack $
|
||||||
TR.run
|
TR.run "Unison.Test.Ucm.runTranscript Invalid Version String"
|
||||||
codebasePath
|
codebasePath
|
||||||
configFile
|
configFile
|
||||||
stanzas
|
stanzas
|
||||||
|
@ -54,12 +54,10 @@ test =
|
|||||||
, expectExitCode ExitSuccess "stack" defaultArgs ["exec", "--", "unison", "--token", "MY_TOKEN"] "" -- ?
|
, expectExitCode ExitSuccess "stack" defaultArgs ["exec", "--", "unison", "--token", "MY_TOKEN"] "" -- ?
|
||||||
, expectExitCode ExitSuccess "stack" defaultArgs ["exec", "--", "unison"] ""
|
, expectExitCode ExitSuccess "stack" defaultArgs ["exec", "--", "unison"] ""
|
||||||
, expectExitCode ExitSuccess "stack" defaultArgs ["exec", "--", "unison", "--ui", tempCodebase] ""
|
, expectExitCode ExitSuccess "stack" defaultArgs ["exec", "--", "unison", "--ui", tempCodebase] ""
|
||||||
-- run.compiled appears to be broken at the moment, these should be added back once it's
|
, scope "can compile, then run compiled artifact" $ tests
|
||||||
-- fixed to ensure it keeps working.
|
[ expectExitCode ExitSuccess "stack" defaultArgs ["exec", "--", "unison", "transcript", transcriptFile] ""
|
||||||
-- , scope "can compile, then run compiled artifact" $ tests
|
, expectExitCode ExitSuccess "stack" defaultArgs ["exec", "--", "unison", "run.compiled", "./unison-cli/integration-tests/IntegrationTests/main.uc"] ""
|
||||||
-- [ expectExitCode ExitSuccess "stack" defaultArgs [] ["exec", "--", "unison", "transcript", transcriptFile] ""
|
]
|
||||||
-- , expectExitCode ExitSuccess "stack" defaultArgs [] ["exec", "--", "unison", "run.compiled", "./unison-cli/integration-tests/IntegrationTests/main"] ""
|
|
||||||
-- ]
|
|
||||||
]
|
]
|
||||||
|
|
||||||
expectExitCode :: ExitCode -> FilePath -> [String] -> [String] -> String -> Test ()
|
expectExitCode :: ExitCode -> FilePath -> [String] -> [String] -> String -> Test ()
|
||||||
|
@ -248,7 +248,7 @@ runTranscripts' mcodepath transcriptDir args = do
|
|||||||
configFilePath <- getConfigFilePath mcodepath
|
configFilePath <- getConfigFilePath mcodepath
|
||||||
-- We don't need to create a codebase through `getCodebaseOrExit` as we've already done so previously.
|
-- We don't need to create a codebase through `getCodebaseOrExit` as we've already done so previously.
|
||||||
((closeCodebase, theCodebase),_) <- getCodebaseOrExit (Just (DontCreateCodebaseWhenMissing transcriptDir))
|
((closeCodebase, theCodebase),_) <- getCodebaseOrExit (Just (DontCreateCodebaseWhenMissing transcriptDir))
|
||||||
mdOut <- TR.run transcriptDir configFilePath stanzas theCodebase
|
mdOut <- TR.run Version.gitDescribeWithDate transcriptDir configFilePath stanzas theCodebase
|
||||||
closeCodebase
|
closeCodebase
|
||||||
let out = currentDir FP.</>
|
let out = currentDir FP.</>
|
||||||
FP.addExtension (FP.dropExtension fileName ++ ".output")
|
FP.addExtension (FP.dropExtension fileName ++ ".output")
|
||||||
|
Loading…
Reference in New Issue
Block a user