urlencoded 0.1 → 0.1.0.1
raw patch · 2 files changed
+22/−11 lines, 2 filessetup-changed
Files
- Setup.lhs +20/−10
- urlencoded.cabal +2/−1
Setup.lhs view
@@ -6,16 +6,26 @@ > import Distribution.Simple.Utils ( rawSystemExit ) > import Distribution.Verbosity ( normal ) > import System.FilePath ( (</>) )--> main = defaultMainWithHooks hooks+> import Control.Monad ( forM_, when )+> import Data.Char ( toLower ) -> hooks = simpleUserHooks { instHook = inst-> , runTests = test-> }+> main = defaultMainWithHooks $ handleTestExes simpleUserHooks -> inst pkg = instHook simpleUserHooks $ pkg { executables = [] }+> handleTestExes hooks = hooks { instHook = dropTestExes instHook+> , copyHook = dropTestExes copyHook+> , runTests = runTestExes+> }+> where+> dropTestExes hook pkg =+> let nonTest = filter (not . isTestExe) (executables pkg)+> in hook hooks $ pkg { executables = nonTest }+>+> runTestExes args _unknown pkg lbi = do+> buildHook hooks pkg lbi hooks defaultBuildFlags+> forM_ (executables pkg) $ \exe ->+> let testPath = buildDir lbi </> exeName exe </> exeName exe+> in when (isTestExe exe) $ rawSystemExit normal testPath args -> test args _unknown pkg lbi = do-> buildHook hooks pkg lbi hooks defaultBuildFlags-> let testPath = buildDir lbi </> "test" </> "test"-> rawSystemExit normal testPath args+> isTestExe exe =+> let fields = customFieldsBI (buildInfo exe)+> in ["true"] == [ map toLower val | ("x-test-executable", val) <- fields ]
urlencoded.cabal view
@@ -1,6 +1,6 @@ name: urlencoded Cabal-Version: >= 1.6-version: 0.1+version: 0.1.0.1 synopsis: Generate or process x-www-urlencoded data description: Generate or process x-www-urlencoded data as it@@ -33,3 +33,4 @@ GHC-Options: -Wall Main-is: TestDriver.hs HS-Source-Dirs: src, test+ X-Test-Executable: true