Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Everythink OK. Removed old files. Removed .DS_Store.

  • Loading branch information...
commit d09fcd0597d091baefab1a9cd823869bc4b66db0 1 parent 8efe5c2
@finnsson authored
View
46 main-test-generator.cabal
@@ -1,46 +0,0 @@
-name: main-test-generator
-version: 0.0.1
-cabal-version: -any
-build-type: Simple
-license: BSD4
-license-file: ""
-copyright:
-maintainer: Oscar Finnsson
-build-depends: base -any, test-framework-hunit, test-framework, HUnit, function-extractor, haskell-src-exts, haskell98, regex-posix, template-haskell
-stability:
-homepage:
-package-url:
-bug-reports:
-synopsis:
-description: Automagically generated the HUnit-bulk-code.
-category:
-author: Oscar Finnsson & Emil Nordling
-tested-with:
-data-files:
-data-dir: ""
-extra-source-files:
-extra-tmp-files:
-exposed-modules: MainTestGenerator
-exposed: True
-buildable: True
-build-tools:
-cpp-options:
-cc-options:
-ld-options:
-pkgconfig-depends:
-frameworks:
-c-sources:
-extensions:
-extra-libraries:
-extra-lib-dirs:
-includes:
-install-includes:
-include-dirs:
-hs-source-dirs: src
-other-modules:
-ghc-prof-options:
-ghc-shared-options:
-ghc-options:
-hugs-options:
-nhc98-options:
-jhc-options:
View
65 src/MainTestGenerator.hs
@@ -1,65 +0,0 @@
------------------------------------------------------------------------------
---
--- Module : MainTestGenerator
--- Copyright :
--- License : BSD4
---
--- Maintainer : Oscar Finnsson
--- Stability :
--- Portability :
---
---
------------------------------------------------------------------------------
-{-# OPTIONS_GHC -fglasgow-exts -XTemplateHaskell #-}
-
-module MainTestGenerator (
- mainTestGenerator
-) where
-import Language.Haskell.TH
-import Language.Haskell.Exts.Parser
-import Language.Haskell.Exts.Syntax
-import Text.Regex.Posix
-import Maybe
-import Language.Haskell.Exts.Extension
-import Test.Framework.Providers.HUnit
-import FunctionExtractor
-import Test.Framework (Test)
-
-import Test.HUnit
-
-
-import Test.Framework (defaultMain, testGroup)
-import Test.Framework.Providers.HUnit
-
--- | Generate the usual code and extract the usual functions needed in order to run HUnit.
---
--- > {-# OPTIONS_GHC -fglasgow-exts -XTemplateHaskell #-}
--- > module MyModuleTest where
--- > import Test.HUnit
--- > import MainTestGenerator
--- >
--- > main = $(mainTestGenerator)
--- >
--- > testFoo = do 4 @=? 4
--- >
--- > testBar = do "hej" @=? "hej"
---
--- will automagically extract testFoo and testBar and run them as well as present them as belonging to the testGroup 'MyModuleTest' such as
---
--- > me: runghc MyModuleTest.hs
--- > MyModuleTest:
--- > testFoo: [OK]
--- > testBar: [OK]
--- >
--- > Test Cases Total
--- > Passed 2 2
--- > Failed 0 0
--- > Total 2 2
---
-mainTestGenerator :: ExpQ
-mainTestGenerator =
- [| defaultMain [ testGroup $(locationModule) (mapTestCases $(functionExtractor "^test") ) ] |]
-
-mapTestCases :: [(String, Assertion)] -> [Test.Framework.Test]
-mapTestCases list =
- map (uncurry testCase) list
View
26 src/MainTestGeneratorTest.hs
@@ -1,26 +0,0 @@
------------------------------------------------------------------------------
---
--- Module : MainTestGenerator
--- Copyright :
--- License : BSD4
---
--- Maintainer : Oscar Finnsson
--- Stability :
--- Portability :
---
--- |
---
------------------------------------------------------------------------------
-{-# OPTIONS_GHC -fglasgow-exts -XTemplateHaskell #-}
-module MainTestGeneratorTest where
-import MainTestGenerator
-
-import Test.HUnit
-
-main = $(mainTestGenerator)
-
-testFoo =
- do 4 @=? 4
-
-testBar =
- do "hej" @=? "hej"
Please sign in to comment.
Something went wrong with that request. Please try again.