Permalink
Browse files

Adding travis ci support

  • Loading branch information...
alanz committed Apr 14, 2012
1 parent bbb74a6 commit cdeb385f3d2bf375d3e07f03d2859b51fe0a902e
Showing with 58 additions and 19 deletions.
  1. +1 −0 .travis.yml
  2. +2 −3 buildall.sh
  3. +36 −16 language-javascript.cabal
  4. +19 −0 runtests.hs
View
@@ -0,0 +1 @@
+language: haskell
View
@@ -4,6 +4,5 @@
./runalex.sh
# do a clean build of all, including the tests
-cabal clean && cabal configure -fbuildtests && cabal build && cabal haddock
-
-
+#cabal clean && cabal configure -fbuildtests && cabal build && cabal haddock
+cabal clean && cabal configure --enable-tests && cabal build && cabal test && cabal haddock
View
@@ -19,12 +19,44 @@ Extra-source-files: README
.ghci
buildall.sh
-Cabal-version: >= 1.6
+-- Version requirement upped for test support in later Cabal
+Cabal-version: >= 1.9.2
+Test-Suite test-language-javascript
+ Type: exitcode-stdio-1.0
+ Main-is: runtests.hs
+ build-depends: base, Cabal >= 1.9.2
+ , QuickCheck >= 2 && < 3
+ , HUnit
+ , test-framework-hunit
+ , test-framework
+ , array >= 0.3 && < 0.5
+ , utf8-light >= 0.4 && < 1.0
+ , containers >= 0.2 && < 0.5
+ , mtl >= 1.1 && < 2.9
+ , utf8-string >= 0.3.7 && < 1
+ , bytestring >= 0.9.1 && < 1
+ , blaze-builder >= 0.2 && < 1
+ hs-source-dirs: . src ./dist/build
-flag buildtests
- description: Build the executable to run unit tests
- default: False
+
+-- executable runtests
+-- if flag(buildtests)
+-- Buildable: True
+-- cpp-options: -DTEST
+-- build-depends: QuickCheck >= 2 && < 3,
+-- HUnit,
+-- test-framework-hunit,
+-- test-framework
+-- hs-source-dirs: . src ./dist/build
+-- else
+-- Buildable: False
+-- main-is: runtests.hs
+
+
+-- flag buildtests
+-- description: Build the executable to run unit tests
+-- default: False
Library
Build-depends: base >= 4 && < 5
@@ -53,18 +85,6 @@ Library
Build-tools: happy
ghc-options: -Wall
-executable runtests
- if flag(buildtests)
- Buildable: True
- cpp-options: -DTEST
- build-depends: QuickCheck >= 2 && < 3,
- HUnit,
- test-framework-hunit,
- test-framework
- hs-source-dirs: . src ./dist/build
- else
- Buildable: False
- main-is: runtests.hs
source-repository head
type: git
View
@@ -1,3 +1,5 @@
+module Main where
+
import Test.Framework (defaultMain, testGroup, Test)
import Test.Framework.Providers.HUnit
import Test.HUnit hiding (Test)
@@ -9,6 +11,23 @@ import Language.JavaScript.Parser
--import Language.JavaScript.Parser.Grammar
import Language.JavaScript.Parser.Grammar5
+{-
+import Distribution.TestSuite
+
+instance TestOptions (String, Bool) where
+ name = fst
+ options = const []
+ defaultOptions _ = return (Options [])
+ check _ _ = []
+
+instance PureTestable (String, Bool) where
+ run (name, result) _ | result == True = Pass
+ | result == False = Fail (name ++ " failed!")
+
+test :: (String, Bool) -> Test
+test = pure
+-}
+
main :: IO ()
main = defaultMain [testSuite,{- ++AZ++temporary++ commentSuite ,-}commentPrintSuite]

0 comments on commit cdeb385

Please sign in to comment.