From d510c45790432249fe7027b1ed70ce1c06fdd824 Mon Sep 17 00:00:00 2001 From: randen Date: Fri, 1 Jan 2016 18:02:11 -0800 Subject: The Haddock part for fully gcc-like response files " driver/Main.hs * Moved the response file handling into ResponseFile.hs, updating import section as appropriate. * driver/ResponseFile.hs * New file. In anticipation that maybe some day this could be provided by another library, and to make it possible to unit test, this functionality is pulled out of the Main.hs module, and expanded to support the style/format of response files which gcc uses. * The specification for the format of response files which gcc generates and consumes, seems to be best derived from the gcc code itself (libiberty/argv.c), so that is what has been done here. * This is intended to fix haskell/haddock#379 * driver-test/Main.hs * New file for testing code in the driver source tree * driver-test/ResponseFileSpec.hs * Tests, adapted/adopted from the same gcc code where the escaping/unescaping is from, in the hspec style of unit tests * haddock.cabal * Add the driver-test test-suite. Introduces a new library dependency (upon hspec) for the haddock driver target in the haddock.cabal file, but practically, this should not be a problem as the haddock-api tests already depend on hspec. --- driver-test/Main.hs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 driver-test/Main.hs (limited to 'driver-test/Main.hs') diff --git a/driver-test/Main.hs b/driver-test/Main.hs new file mode 100644 index 00000000..d3f636e9 --- /dev/null +++ b/driver-test/Main.hs @@ -0,0 +1,12 @@ +module Main where + +import Test.Hspec (describe, hspec, Spec) +import qualified ResponseFileSpec (spec) + + +main :: IO () +main = hspec spec + +spec :: Spec +spec = do + describe "ResponseFile" ResponseFileSpec.spec -- cgit v1.2.3