module Tests ( tests ) where
import Distribution.TestSuite
import AST
import Check
import Parser
import Printer
import Reduction
tests :: IO [Test]
tests = return [testGroup "stdlib" tests]
where
tests = [Test stdlib_check, Test stdlib_compile]
stdlib_check = TestInstance
{ run = stdlib_check_job
, name = "standard library test"
, tags = ["stdlib"]
, options = [stdlib_path]
, setOption = parseTestOptions
}
stdlib_compile = TestInstance
{ run = stdlib_compile_job
, name = "standard library test"
, tags = ["stdlib"]
, options = [stdlib_path]
, setOption = parseTestOptions
}
stdlib_path = OptionDescr
{ optionName = "stdlib-path"
, optionDescription = "uses the given file path to the stdlib in test"
, optionType = OptionFile
{ optionFileMustExist = True
, optionFileIsDir = False
, optionFileExtensions = ["dl", "cdl"]
}
, optionDefault = Nothing
}
parseTestOptions option value
| option == "stdlib-path" = undefined
| otherwise = Left $ "option name `" ++ option ++ "' not recognized"
stdlib_check_job = return $ Finished Pass
stdlib_compile_job = return $ Finished Pass