Permalink
Browse files

Add (failing) test case for Cabal projects.

  • Loading branch information...
1 parent 3be8802 commit ec1a30cd4438514848e1d0ab09f37b4a5183fb2c @nominolo committed May 3, 2011
View
@@ -19,6 +19,14 @@ file_config001 p =
file_config002 p =
FileConfig (p </> "tests" </> "projects" </> "file001.hs") ["-Wall"]
+cabal_config001 p =
+ CabalConfig
+ { sc_name = "hello"
+ , sc_cabalFile = p </> "tests" </> "projects" </> "hello" </> "hello.cabal"
+ , sc_component = Library
+ , sc_configFlags = []
+ }
+
tests =
[ testCase "ping" $ runScion $ do
withSession (file_config001 ".") $ \sid -> do
@@ -31,5 +39,9 @@ tests =
testCase "exts" $ runScion $ do
withSession (file_config001 ".") $ \sid -> do
exts <- supportedLanguagesAndExtensions
- io $ assertBool "There should be some supported extensions." (length exts > 0)
+ io $ assertBool "There should be some supported extensions." (length exts > 0),
+ testCase "cabal01" $ runScion $ do
+ withSession (cabal_config001 ".") $ \sid -> do
+ notes <- sessionNotes sid
+ io $ MS.size notes @?= 42 -- TODO:
]
@@ -0,0 +1,24 @@
+Copyright 2010, Simon Marlow
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+
+- Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND THE CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,6 @@
+module Main (main) where
+
+import Distribution.Simple
+
+main :: IO ()
+main = defaultMain
@@ -0,0 +1,39 @@
+-- Instructions on how to write this file are in the Cabal
+-- documentation, which can be found here:
+-- http://haskell.org/cabal/release/cabal-latest/doc/users-guide/
+
+name: hello
+version: 1.0.0.2
+license: BSD3
+license-file: LICENSE
+copyright: (c) Simon Marlow
+author: Simon Marlow
+maintainer: Simon Marlow <marlowsd@gmail.com>
+bug-reports: mailto:marlowsd@gmail.com
+stability: stable
+homepage: http://www.haskell.org/hello/
+synopsis: Hello World, an example package
+category: Console, Text
+cabal-version: >= 1.6
+build-type: Simple
+
+Description:
+ This is an implementation of the classic "Hello World" program in
+ Haskell, as an example of how to create a minimal Haskell
+ application using Cabal and Hackage. Please submit any suggestions and
+ improvements.
+
+source-repository head
+ type: darcs
+ location: http://darcs.haskell.org/hello/
+
+flag threaded
+ default: False
+
+executable hello
+ hs-source-dirs: src
+ main-is: hello.hs
+ build-depends: base >= 4.2 && < 5
+
+ if flag(threaded)
+ ghc-options: -threaded
@@ -0,0 +1,3 @@
+module Main (main) where
+
+main = putStrLn "Hello, World!"

0 comments on commit ec1a30c

Please sign in to comment.