Skip to content
Browse files

added initial implementation for reading configuration file

added dummy cabal file
  • Loading branch information...
1 parent 1e49b9a commit d9b1eb1c06249b925c11a26d5c40ff27a76bea70 @boegel boegel committed with Nov 7, 2010
Showing with 32 additions and 3 deletions.
  1. +1 −0 HaBench.cabal
  2. +8 −0 HaBench.cfg
  3. +18 −2 HaBench.hs
  4. +5 −1 Makefile
View
1 HaBench.cabal
@@ -0,0 +1 @@
+build-depends: ConfigFile >= 1.0
View
8 HaBench.cfg
@@ -0,0 +1,8 @@
+[haddock]
+name: haddock
+version: 2.8.1
+workloads: (F.hs -o . -d -h; F.hs; F.html habench_stdout), ("<dummy cmdline>" 1.hs 2.hs; x.html)
+[HRay]
+name: HRay
+version: 1.1.1
+workloads: (1.hry; 1.hry; 1.ppm)
View
20 HaBench.hs
@@ -1,7 +1,15 @@
-module HaBench where
+--module HaBench where
+import Data.ConfigFile
+import System.Environment (getArgs)
import System.IO (FilePath)
+-- THOUGHTS
+-- specify command line to run benchmark with, for each workload
+-- run benchmark in a sandbox directory: "haddock F.hs -o . -d -h > stdout 2> stderr"
+-- copy output files we're interested in, remove sandbox
+-- specified command line should be useable both by criterion and the benchmark
+
-- data type for a benchmark
data Benchmark = Benchmark {
bName :: String,
@@ -52,5 +60,13 @@ data PrecisionValidator = PrecisionValidator Double
instance Validator PrecisionValidator where
isValid (PrecisionValidator p) _ = return True -- FIXME
+-- read HaBench configuration file
+readConfig :: FilePath -> IO String
+readConfig fp = return fp
+
-- dummy main
-main = putStr "HaBench"
+main = do
+ args <- getArgs
+ let fp = head args
+ cfg <- readConfig fp
+ putStrLn cfg
View
6 Makefile
@@ -1,5 +1,9 @@
-all: proposal.lhs
+all: HaBench
+
+proposal: proposal.lhs
lhs2TeX proposal.lhs > proposal.tex
pdflatex proposal.tex
pdflatex proposal.tex
+HaBench: HaBench.hs
+ ghc --make HaBench.hs -o HaBench

0 comments on commit d9b1eb1

Please sign in to comment.
Something went wrong with that request. Please try again.