Commit a08668c4 authored by Ning Wang's avatar Ning Wang

1. add an option to enable the test coverage report. 2. fix errors in expected...

1. add an option to enable the test coverage report. 2. fix errors in expected files, and introduced a mismatch in the expected file to test if Travis CI can catch this error.
parent dcd563d6
......@@ -25,6 +25,11 @@ To run the tests in the folder testing/, change to the src directory and run
cabal configure --enable-tests
cabal test
To run the tests with the test coverage report, change to the src directory and run
cabal configure --enable-tests -f testcoverage
cabal test
You'll need a Haskell Platform, which should include appropriate
versions of Cabal and GHC.
......
......@@ -24,6 +24,12 @@ Source-repository head
Type: git
Location: http://git.haskell.org/packages/hoopl.git
flag testcoverage {
description: Enable test coverage report
default: False
}
Library
Default-Language: Haskell2010
Other-Extensions: CPP
......@@ -73,8 +79,11 @@ Test-Suite hoopl-test
Type: exitcode-stdio-1.0
Main-Is: Main.hs
Hs-Source-Dirs: testing src
Ghc-Options: -fhpc -Wall
Ghc-Options: -Wall
Build-Depends: base >= 4.3 && < 4.9,
containers >= 0.4 && < 0.6,
parsec >= 3.1.7,
mtl >= 2.1.3.1
if flag(testcoverage) {
Ghc-Options: -fhpc
}
f() {
L0:
goto "L1"
goto L1
L1:
ret (1)
}
\ No newline at end of file
}
f(x) {
L100:
goto "L101"
goto L101
L101:
goto "L103"
goto L103
L103:
ret ((x + 5) + 4)
ret ((x + 5) + 3)
}
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