Commit 23b03f50 authored by Ben Gamari's avatar Ben Gamari 🐢

Allow additional arguments to cachegrind

parent 637337f8
......@@ -70,6 +70,7 @@ data Nofib
,tag :: String
,output :: String
,cachegrind :: Bool
,cachegrind_args :: String
,run :: Bool
,speed :: Speed
,rts :: [String]
......@@ -95,7 +96,8 @@ nofibMode = cmdArgsMode $ modes
,compiler_args = "" &= help "Extra arguments to pass to the Compiler when building tests"
,tag = "" &= help "Tag to name the compiler, defaults to compiler --version"
,output = "" &= help "Where to put created files under _make, defaults to tag/way"
,cachegrind = False &= groupname "Running" &= help "Run the tests under cachegrind (Fast,Norm,Slow)"
,cachegrind = False &= groupname "Running" &= help "Run the tests under cachegrind"
,cachegrind_args = "" &= groupname "Running" &= help "Extra arguments to pass to cachegrind"
,run = False &= groupname "Running" &= help "Run the tests"
,speed = Norm &= groupname "Running" &= help "Test speed (Fast,Norm,Slow)"
,times = 1 &= help "Number of times to run each test"
......@@ -296,7 +298,8 @@ buildRules nofib@Build{..} = do
(stdin, args) <- liftIO $ getTestCmdline nofib test
executable <- liftIO $ IO.canonicalizePath $ output </> test </> "Main" <.> exe
out' <- liftIO $ IO.canonicalizePath out
cmd_ (Cwd test) (EchoStdout False) (StdinBS stdin) "valgrind" "--tool=cachegrind" ("--cachegrind-out-file="++out') executable args
cmd_ (Cwd test) (EchoStdout False) (StdinBS stdin)
"valgrind" "--tool=cachegrind" cachegrind_args ("--cachegrind-out-file="++out') executable args
getTestCmdline :: Nofib -> String -> IO (BSL.ByteString, [String])
getTestCmdline nofib@Build{..} test = do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment