2023-06-15 17:42:58 +03:00
|
|
|
module VampIR.Compilation.Negative where
|
|
|
|
|
|
|
|
import Base
|
|
|
|
import VampIR.Compilation.Base
|
|
|
|
|
|
|
|
data NegTest = NegTest
|
|
|
|
{ _name :: String,
|
|
|
|
_relDir :: Path Rel Dir,
|
|
|
|
_file :: Path Rel File
|
|
|
|
}
|
|
|
|
|
|
|
|
root :: Path Abs Dir
|
|
|
|
root = relToProject $(mkRelDir "tests/VampIR/negative")
|
|
|
|
|
|
|
|
testDescr :: NegTest -> TestDescr
|
|
|
|
testDescr NegTest {..} =
|
|
|
|
let tRoot = root <//> _relDir
|
|
|
|
file' = tRoot <//> _file
|
|
|
|
in TestDescr
|
|
|
|
{ _testName = _name,
|
|
|
|
_testRoot = tRoot,
|
2023-11-16 18:19:52 +03:00
|
|
|
_testAssertion = Steps $ vampirCompileErrorAssertion tRoot file'
|
2023-06-15 17:42:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
allTests :: TestTree
|
|
|
|
allTests =
|
|
|
|
testGroup
|
|
|
|
"Juvix to VampIR compilation negative tests"
|
|
|
|
(map (mkTest . testDescr) tests)
|
|
|
|
|
|
|
|
tests :: [NegTest]
|
|
|
|
tests =
|
|
|
|
[ NegTest
|
|
|
|
"Test001: Missing comma"
|
|
|
|
$(mkRelDir ".")
|
|
|
|
$(mkRelFile "test001.juvix")
|
|
|
|
]
|