mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-11-28 09:23:04 +03:00
Allow expected failures to be ignored
This commit is contained in:
parent
2bba4a6871
commit
3ca8746eb3
3
Makefile
3
Makefile
@ -6,6 +6,8 @@ ARCH := $(shell uname -m)
|
||||
TESTS ?= issues regression renamer mono-binds
|
||||
TEST_DIFF ?= meld
|
||||
|
||||
IGNORE_EXPECTED ?= --ignore-expected
|
||||
|
||||
CABAL_BUILD_FLAGS ?= -j
|
||||
CABAL_INSTALL_FLAGS ?= $(CABAL_BUILD_FLAGS)
|
||||
|
||||
@ -230,6 +232,7 @@ test: ${CS_BIN}/cryptol-test-runner
|
||||
-r output \
|
||||
-T --hide-successes \
|
||||
-T --jxml=$(call adjust-path,$(CURDIR)/results.xml) \
|
||||
$(IGNORE_EXPECTED) \
|
||||
$(if $(TEST_DIFF),-p $(TEST_DIFF),) \
|
||||
)
|
||||
|
||||
|
@ -61,6 +61,7 @@ data Options = Options
|
||||
, optResultDir :: FilePath
|
||||
, optTests :: [FilePath]
|
||||
, optDiff :: Maybe String
|
||||
, optIgnoreExpected :: Bool
|
||||
} deriving (Show)
|
||||
|
||||
defaultOptions :: Options
|
||||
@ -71,6 +72,7 @@ defaultOptions = Options
|
||||
, optResultDir = "output"
|
||||
, optTests = []
|
||||
, optDiff = Nothing
|
||||
, optIgnoreExpected = False
|
||||
}
|
||||
|
||||
setHelp :: Endo Options
|
||||
@ -92,6 +94,10 @@ addTestFile :: String -> Endo Options
|
||||
addTestFile path =
|
||||
Endo (\ opts -> opts { optTests = path : optTests opts })
|
||||
|
||||
setIgnoreExpected :: Endo Options
|
||||
setIgnoreExpected =
|
||||
Endo (\ opts -> opts { optIgnoreExpected = True })
|
||||
|
||||
options :: [OptDescr (Endo Options)]
|
||||
options =
|
||||
[ Option "c" ["cryptol"] (ReqArg setCryptol "PATH")
|
||||
@ -102,6 +108,8 @@ options =
|
||||
"use this diffing program on failures"
|
||||
, Option "T" [] (ReqArg addOther "STRING")
|
||||
"add an argument to pass to the test-runner main"
|
||||
, Option "i" ["ignore-expected"] (NoArg setIgnoreExpected)
|
||||
"ignore expected failures"
|
||||
, Option "h" ["help"] (NoArg setHelp)
|
||||
"display this message"
|
||||
]
|
||||
@ -201,7 +209,8 @@ generateAssertion opts dir file = testCase file $ do
|
||||
(_,diffOut,_) <- readProcessWithExitCode "diff" [ goldFile', resultOut ] ""
|
||||
assertFailure diffOut
|
||||
|
||||
Right fail_msg -> assertFailure fail_msg
|
||||
Right fail_msg | optIgnoreExpected opts -> return ()
|
||||
| otherwise -> assertFailure fail_msg
|
||||
|
||||
-- Test Discovery --------------------------------------------------------------
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user