Commit 8f5bde5d authored by Sophie Herold's avatar Sophie Herold 🌼

Adds first step towards Haskell integration tests

parent cffa2031
Pipeline #681 passed with stage
in 6 minutes and 31 seconds
v0.10.0.0 (WIP)
- Adds support for reading setup.yml from STDIN
- Changes to better support SEQUENCEs
v0.9.0.0
- Fixes DELETE BASE before schema definitions are read (#64)
- Fixes bugs in table constraint statements (#59)
- Fixes coded that needed O(n^2) in number of SQL objects (#62)
- Fixes code that needed O(n^2) in number of SQL objects (#62)
- Fixes incorrect naming of sequences for SERIAL emulation
- Adds bash completion install (closes #63)
- Adds link to example project to README
......
HS = $(shell find app/ src/ test/ -name '*.hs')
VERSION = 0.9.90.0
HPCDIRS = --hpcdir dist/hpc/vanilla/mix/hamsql --hpcdir dist/hpc/vanilla/mix/hamsql-${VERSION}
.PHONY: test $(HS)
update-and-build: update build
update:
......@@ -9,44 +12,30 @@ update:
cabal update
cabal install -ffast --force-reinstalls --only-dependencies --disable-optimization
tests:
test:
cabal configure --disable-optimization --enable-coverage --enable-tests
cabal test --show-details direct
cabal build
-rm test/hamsql.tix
-rm -r test/coverage
-rm test/hamsql-stmt-log.sql
make -C test
hpc report test/hamsql.tix ${HPCDIRS}
hpc markup test/hamsql.tix ${HPCDIRS} --destdir=test/coverage --verbosity=0
cabal test --show-details=direct --test-option=--color=always
doc:
cabal haddock
build:
cabal configure --disable-optimization
cabal build --ghc-options="-Wall -fwarn-incomplete-record-updates -fno-warn-orphans"
cabal build
install:
cp dist/build/hamsql/hamsql /usr/local/bin/
hamsql --bash-completion-script hamsql > /etc/bash_completion.d/hamsql
# ununsual options
dev-format-code: $(HS)
dev-clean:
cabal clean
cabal sandbox delete
$(HS):
-@./.cabal-sandbox/bin/hindent $@
dev-build-without-dep:
cabal sandbox init
cabal install frontmatter
cabal configure --disable-optimization
cabal build
# ununsual options
dev-rebuild:
cabal clean
cabal configure --disable-optimization
cabal build --ghc-options="-fforce-recomp -Wall -fwarn-incomplete-record-updates -fno-warn-orphans"
cabal build --ghc-options="-fforce-recomp"
dev-build-optim:
cabal configure --enable-optimization
......
......@@ -8,4 +8,3 @@ import Database.HamSql.Cli
main :: IO ()
main = parseArgv >>= run
......@@ -13,13 +13,16 @@ copyright: (c) 2014-2016 Michael Herold et al.
stability: experimental
build-type: Simple
cabal-version: >=1.20
extra-source-files:
AUTHORS,
CHANGELOG,
README.md,
data/doc-template.rst
source-repository head
type: git
location: git@git.hemio.de:hemio/hamsql.git
library
hs-source-dirs: src
default-language: Haskell2010
......@@ -96,6 +99,12 @@ library
unordered-containers >=0.2 && <0.3,
yaml >=0.8 && <0.9
ghc-options:
-Wall
-Wcompat
-Wincomplete-record-updates
-Wno-orphans
executable hamsql
main-is: app/hamsql.hs
default-language: Haskell2010
......@@ -104,15 +113,27 @@ executable hamsql
base >=4.8 && <5.0,
hamsql
ghc-options:
-Wall
-Wcompat
-Wincomplete-record-updates
test-suite hamsql-tests
default-language: Haskell2010
type: exitcode-stdio-1.0
main-is: test/hamsql-tests.hs
hs-source-dirs: . test
build-depends:
base >=4.8 && <5.0,
hamsql
source-repository head
type: git
location: git@git.hemio.de:hemio/hamsql.git
hamsql,
directory,
-- test
tasty,
tasty-hunit,
-- dev
hindent
ghc-options:
-Wall
-Wcompat
-Wincomplete-record-updates
module Main where
import System.Directory
import Test.Tasty
import Test.Tasty.HUnit
import Database.HamSql.Cli
main :: IO ()
main = do
exec ["--help"]
where exec xs = parseThisArgv xs >>= run
main = defaultMain tests
tests :: TestTree
tests =
testGroup
"Integration Tests"
[testCase "1" (exec ["--help"]), integrationTests]
integrationTests :: TestTree
integrationTests =
testCase "x" $
--exec ["--help"]
do
exec
[ "install"
, "-s"
, "test/setups/invalid.yml"
, "-c"
, "postgresql://postgres@/test1"
]
getCurrentDirectory >>= putStrLn
exec xs = parseThisArgv xs >>= run
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment