mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-24 03:52:50 -06:00
Merge branch 'enable-tests' of https://github.com/kharus/gf-core into fix-tests
to continue working from ruslan tests
This commit is contained in:
1
gf.cabal
1
gf.cabal
@@ -352,4 +352,5 @@ test-suite gf-tests
|
|||||||
main-is: run.hs
|
main-is: run.hs
|
||||||
hs-source-dirs: testsuite
|
hs-source-dirs: testsuite
|
||||||
build-depends: base>=4.3 && <5, Cabal>=1.8, directory, filepath, process
|
build-depends: base>=4.3 && <5, Cabal>=1.8, directory, filepath, process
|
||||||
|
build-tool-depends: gf:gf
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ main =
|
|||||||
ok = length good
|
ok = length good
|
||||||
fail = ok<cnt
|
fail = ok<cnt
|
||||||
putStrLn $ show ok++"/"++show cnt++ " passed/tests"
|
putStrLn $ show ok++"/"++show cnt++ " passed/tests"
|
||||||
let overview = "dist/test/gf-tests.html"
|
let overview = "gf-tests.html"
|
||||||
writeFile overview (toHTML bad)
|
writeFile overview (toHTML bad)
|
||||||
if ok<cnt
|
if ok<cnt
|
||||||
then do putStrLn $ overview++" contains an overview of the failed tests"
|
then do putStrLn $ overview++" contains an overview of the failed tests"
|
||||||
@@ -55,7 +55,8 @@ main =
|
|||||||
|
|
||||||
runTest in_file out_file gold_file = do
|
runTest in_file out_file gold_file = do
|
||||||
input <- readFile in_file
|
input <- readFile in_file
|
||||||
writeFile out_file =<< run_gf input
|
rgl_lib_dir <- readFile "DATA_DIR"
|
||||||
|
writeFile out_file =<< run_gf ["-run","-gf-lib-path=" ++ rgl_lib_dir] input
|
||||||
exists <- doesFileExist gold_file
|
exists <- doesFileExist gold_file
|
||||||
if exists
|
if exists
|
||||||
then do out <- compatReadFile out_file
|
then do out <- compatReadFile out_file
|
||||||
@@ -71,9 +72,8 @@ main =
|
|||||||
hGetContents h
|
hGetContents h
|
||||||
|
|
||||||
-- Should consult the Cabal configuration!
|
-- Should consult the Cabal configuration!
|
||||||
run_gf = readProcess default_gf ["-run","-gf-lib-path="++gf_lib_path]
|
run_gf = readProcess default_gf
|
||||||
default_gf = "dist/build/gf/gf"<.>exeExtension buildPlatform
|
default_gf = "gf"<.>exeExtension buildPlatform
|
||||||
gf_lib_path = "dist/build/rgl"
|
|
||||||
|
|
||||||
-- | List files, excluding "." and ".."
|
-- | List files, excluding "." and ".."
|
||||||
ls path = filter (`notElem` [".",".."]) `fmap` getDirectoryContents path
|
ls path = filter (`notElem` [".",".."]) `fmap` getDirectoryContents path
|
||||||
|
|||||||
Reference in New Issue
Block a user