| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Futhark.Test.Spec
Description
Definition and parsing of a test specification.
Synopsis
- testSpecFromProgram :: FilePath -> IO (Either String ProgramTest)
- testSpecFromProgramOrDie :: FilePath -> IO ProgramTest
- testSpecsFromPaths :: [FilePath] -> IO (Either String [(FilePath, ProgramTest)])
- testSpecsFromPathsOrDie :: [FilePath] -> IO [(FilePath, ProgramTest)]
- testSpecFromFile :: FilePath -> IO (Either String ProgramTest)
- testSpecFromFileOrDie :: FilePath -> IO ProgramTest
- data ProgramTest = ProgramTest {
- testDescription :: Text
- testTags :: [Text]
- testAction :: TestAction
- data StructureTest = StructureTest StructurePipeline AstMetrics
- data StructurePipeline
- data WarningTest = ExpectedWarning Text Regex
- data TestAction
- data ExpectedError
- data InputOutputs = InputOutputs {
- iosEntryPoint :: Text
- iosTestRuns :: [TestRun]
- data TestRun = TestRun {}
- data ExpectedResult values
- = Succeeds (Maybe values)
- | RunTimeFailure ExpectedError
- data Success
- data Values
- = Values [Value]
- | InFile FilePath
- | GenValues [GenValue]
- | ScriptValues Exp
- | ScriptFile FilePath
- data GenValue
- genValueType :: GenValue -> String
Documentation
testSpecFromProgram :: FilePath -> IO (Either String ProgramTest) Source #
Read the test specification from the given Futhark program.
testSpecFromProgramOrDie :: FilePath -> IO ProgramTest Source #
Like testSpecFromProgram, but exits the process on error.
testSpecsFromPaths :: [FilePath] -> IO (Either String [(FilePath, ProgramTest)]) Source #
Read test specifications from the given paths, which can be a
files or directories containing .fut files and further
directories.
testSpecsFromPathsOrDie :: [FilePath] -> IO [(FilePath, ProgramTest)] Source #
Like testSpecsFromPaths, but kills the process on errors.
testSpecFromFile :: FilePath -> IO (Either String ProgramTest) Source #
Read a test specification from a file. Expects only a single block, and no comment prefixes.
testSpecFromFileOrDie :: FilePath -> IO ProgramTest Source #
Like testSpecFromFile, but kills the process on errors.
data ProgramTest Source #
Description of a test to be carried out on a Futhark program. The Futhark program is stored separately.
Constructors
| ProgramTest | |
Fields
| |
Instances
| Show ProgramTest Source # | |
Defined in Futhark.Test.Spec Methods showsPrec :: Int -> ProgramTest -> ShowS # show :: ProgramTest -> String # showList :: [ProgramTest] -> ShowS # | |
data StructureTest Source #
A structure test specifies a compilation pipeline, as well as metrics for the program coming out the other end.
Constructors
| StructureTest StructurePipeline AstMetrics |
Instances
| Show StructureTest Source # | |
Defined in Futhark.Test.Spec Methods showsPrec :: Int -> StructureTest -> ShowS # show :: StructureTest -> String # showList :: [StructureTest] -> ShowS # | |
data StructurePipeline Source #
How a program can be transformed.
Constructors
| GpuPipeline | |
| SOACSPipeline | |
| SeqMemPipeline | |
| GpuMemPipeline | |
| NoPipeline |
Instances
| Show StructurePipeline Source # | |
Defined in Futhark.Test.Spec Methods showsPrec :: Int -> StructurePipeline -> ShowS # show :: StructurePipeline -> String # showList :: [StructurePipeline] -> ShowS # | |
data WarningTest Source #
A warning test requires that a warning matching the regular expression is produced. The program must also compile succesfully.
Constructors
| ExpectedWarning Text Regex |
Instances
| Show WarningTest Source # | |
Defined in Futhark.Test.Spec Methods showsPrec :: Int -> WarningTest -> ShowS # show :: WarningTest -> String # showList :: [WarningTest] -> ShowS # | |
data TestAction Source #
How to test a program.
Constructors
| CompileTimeFailure ExpectedError | |
| RunCases [InputOutputs] [StructureTest] [WarningTest] |
Instances
| Show TestAction Source # | |
Defined in Futhark.Test.Spec Methods showsPrec :: Int -> TestAction -> ShowS # show :: TestAction -> String # showList :: [TestAction] -> ShowS # | |
data ExpectedError Source #
The error expected for a negative test.
Instances
| Show ExpectedError Source # | |
Defined in Futhark.Test.Spec Methods showsPrec :: Int -> ExpectedError -> ShowS # show :: ExpectedError -> String # showList :: [ExpectedError] -> ShowS # | |
data InputOutputs Source #
Input and output pairs for some entry point(s).
Constructors
| InputOutputs | |
Fields
| |
Instances
| Show InputOutputs Source # | |
Defined in Futhark.Test.Spec Methods showsPrec :: Int -> InputOutputs -> ShowS # show :: InputOutputs -> String # showList :: [InputOutputs] -> ShowS # | |
A condition for execution, input, and expected result.
Constructors
| TestRun | |
Fields
| |
data ExpectedResult values Source #
How a test case is expected to terminate.
Constructors
| Succeeds (Maybe values) | Execution suceeds, with or without expected result values. |
| RunTimeFailure ExpectedError | Execution fails with this error. |
Instances
| Show values => Show (ExpectedResult values) Source # | |
Defined in Futhark.Test.Spec Methods showsPrec :: Int -> ExpectedResult values -> ShowS # show :: ExpectedResult values -> String # showList :: [ExpectedResult values] -> ShowS # | |
The result expected from a succesful execution.
Constructors
| SuccessValues Values | These values are expected. |
| SuccessGenerateValues | Compute expected values from executing a known-good reference implementation. |
Several values - either literally, or by reference to a file, or to be generated on demand. All paths are relative to test program.
Constructors
| Values [Value] | |
| InFile FilePath | |
| GenValues [GenValue] | |
| ScriptValues Exp | |
| ScriptFile FilePath |