Skip to content
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

Minor alignment fixes #48

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Changes from all 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
10 changes: 5 additions & 5 deletions src/QuickCheckVEngine/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@
, optContinueOnFail= False
, optIgnoreAsserts = False
, optSingleImp = False
, csrIncludeRegex = Nothing
, csrExcludeRegex = Nothing
, csrIncludeRegex = Nothing
, csrExcludeRegex = Nothing
}

options :: [OptDescr (Options -> Options)]
Expand Down Expand Up @@ -184,7 +184,7 @@
, Option ['L'] ["test-length"]
(ReqArg (\ f opts -> opts { testLen = read f }) "TEST-LENGTH")
"Generate tests up to TEST-LENGTH instructions long"
, Option [] ["strict-comparison"]
, Option [] ["strict-comparison"]
(NoArg (\ opts -> opts { optStrict = True }))
"Compare all RVFI fields"
, Option ['S'] ["disable-shrink"]
Expand All @@ -202,10 +202,10 @@
, Option [] ["single-implementation"]
(NoArg (\ opts -> opts { optSingleImp = True }))
"Run with only implementation A, testing asserts only (if enabled)"
, Option [] ["csr-include-regex"]
, Option [] ["csr-include-regex"]
(ReqArg (\ f opts -> opts { csrIncludeRegex = Just f }) "REGEX")
"Specify REGEX to test only a subset of CSRs"
, Option [] ["csr-exclude-regex"]
, Option [] ["csr-exclude-regex"]
(ReqArg (\ f opts -> opts { csrExcludeRegex = Just f }) "REGEX")
"Specify REGEX to exclude a subset of CSRs from tests"
]
Expand Down Expand Up @@ -277,7 +277,7 @@
rawArgs <- getArgs
(flags, _) <- commandOpts rawArgs
when (optVerbosity flags > 1) $ print flags
let checkRegex incReg excReg str = (str =~ (fromMaybe ".*" incReg)) && (not $ str =~ fromMaybe "a^" excReg)

Check warning on line 280 in src/QuickCheckVEngine/Main.hs

View workflow job for this annotation

GitHub Actions / Run HLint on the QuickCheck Verification Engine codebase

Suggestion in main in module Main: Move brackets to avoid $ ▫︎ Found: "(str =~ (fromMaybe \".*\" incReg))\n && (not $ str =~ fromMaybe \"a^\" excReg)" ▫︎ Perhaps: "(str =~ (fromMaybe \".*\" incReg))\n && not (str =~ fromMaybe \"a^\" excReg)"

Check warning on line 280 in src/QuickCheckVEngine/Main.hs

View workflow job for this annotation

GitHub Actions / Run HLint on the QuickCheck Verification Engine codebase

Suggestion in main in module Main: Redundant bracket ▫︎ Found: "str =~ (fromMaybe \".*\" incReg)" ▫︎ Perhaps: "str =~ fromMaybe \".*\" incReg"
let archDesc = arch flags
let csrFilter idx = checkRegex (csrIncludeRegex flags) (csrExcludeRegex flags) (fromMaybe "reserved" $ csrs_nameFromIndex idx)
let testParams = T.TestParams { T.archDesc = archDesc
Expand Down Expand Up @@ -375,12 +375,12 @@
where attemptTest (label, description, archReqs, template) =
if archReqs archDesc then do
putStrLn $ label ++ " -- " ++ description ++ ":"
(if optContinueOnFail flags then repeatTillTarget else (\f t -> f t >> return ())) ((numTests <$>) . (doCheck (wrapTest <$> (T.genTest testParams template)))) (nTests flags)

Check warning on line 378 in src/QuickCheckVEngine/Main.hs

View workflow job for this annotation

GitHub Actions / Run HLint on the QuickCheck Verification Engine codebase

Suggestion in main in module Main: Use void ▫︎ Found: "f t >> return ()" ▫︎ Perhaps: "void (f t)"

Check warning on line 378 in src/QuickCheckVEngine/Main.hs

View workflow job for this annotation

GitHub Actions / Run HLint on the QuickCheck Verification Engine codebase

Suggestion in main in module Main: Redundant bracket ▫︎ Found: "(numTests <$>)\n . (doCheck (wrapTest <$> (T.genTest testParams template)))" ▫︎ Perhaps: "(numTests <$>)\n . doCheck (wrapTest <$> (T.genTest testParams template))"

Check warning on line 378 in src/QuickCheckVEngine/Main.hs

View workflow job for this annotation

GitHub Actions / Run HLint on the QuickCheck Verification Engine codebase

Suggestion in main in module Main: Redundant bracket ▫︎ Found: "wrapTest <$> (T.genTest testParams template)" ▫︎ Perhaps: "wrapTest <$> T.genTest testParams template"
else
putStrLn $ "Warning: skipping " ++ label ++ " since architecture requirements not met"
repeatTillTarget f t = if t <= 0 then return () else f t >>= (\x -> repeatTillTarget f (t - x))
Just sock -> do
doCheck (liftM (wrapTest . singleSeq . (MkInstruction <$>)) $ listOf (genInstrServer sock)) (nTests flags)

Check warning on line 383 in src/QuickCheckVEngine/Main.hs

View workflow job for this annotation

GitHub Actions / Run HLint on the QuickCheck Verification Engine codebase

Warning in main in module Main: Use fmap ▫︎ Found: "liftM" ▫︎ Perhaps: "fmap"
return ()
--
rvfiDiiClose implA
Expand Down
Loading