#564, fix JUnit tests (#799)

* Make the ScenarioService take an IO callback, not STM

* Remove a redundant space

* Use IO in preference to STM where we really don't care which is in use

* #564, always print out diagnostics for tests

* #564, fix getting the scenario names so if they can't be computed you give an answer

* Add a proper data type to represent pass/fail in the tests

* Centrailse printing a failure message

* Pull the test execution into a separate file, ensuring it always gives back an exit code

* Use nubOrd instead of Set

* Clean up how we figure out which files to test

* Fail if there are any errors

* Delete all the brittle failure tracking stuff

* Rename the compiler handle to h

* Only print out the successful results to stdout, since the unsuccessful ones end up in diagnostics

* Make JUnit output still print out the test results

* Make JUnit print out all the details

* Delete the stdio command path

* Break the bigger pieces apart in the test runner

* Inline testJUnit

* Shorten to UseColor

* Shorten to color

* Inline and comment part of the JUnit tests

* HLint

* Update daml-foundations/daml-tools/da-hs-daml-cli/DA/Cli/Damlc/Test.hs

Co-Authored-By: neil-da <35463327+neil-da@users.noreply.github.com>

* Fix an HLint refactoring snafu

* Fix up the damlc tests

* Tighten up a test by demanding it throws ExitFailure
This commit is contained in:
Neil Mitchell 2019-04-30 19:07:08 +01:00 committed by mergify[bot]
parent 5b4cfbb088
commit 70524321ad

View File

@ -20,11 +20,11 @@ module Development.IDE.State.Service(
) where
import Control.Concurrent.Extra
import Control.Concurrent.STM
import Control.Monad.Except
import Development.IDE.Functions.Compile (CompileOpts(..))
import Development.IDE.State.FileStore
import qualified Development.IDE.Logger as Logger
import Data.Maybe
import Data.Set (Set)
import qualified Data.Set as Set
import qualified Data.Text as T
@ -71,13 +71,13 @@ unsafeClearDiagnostics = unsafeClearAllDiagnostics
-- | Initialise the Compiler Service.
initialise :: Rules ()
-> Maybe (Event -> STM ())
-> Maybe (Event -> IO ())
-> Logger.Handle IO
-> CompileOpts
-> IO IdeState
initialise mainRule toDiags logger options =
shakeOpen
(maybe (const $ pure ()) (atomically .) toDiags)
(fromMaybe (const $ pure ()) toDiags)
logger
(setProfiling options $
shakeOptions { shakeThreads = optThreads options