mirror of
https://github.com/carp-lang/Carp.git
synced 2024-11-04 19:26:10 +03:00
Creates basic test runner script for Windows
This commit is contained in:
parent
84403988f1
commit
0b1cb484e9
38
run_carp_tests.ps1
Normal file
38
run_carp_tests.ps1
Normal file
@ -0,0 +1,38 @@
|
||||
# Stops script if there is an error
|
||||
Set-StrictMode -Version Latest
|
||||
$ErrorActionPreference = "Stop"
|
||||
$PSDefaultParameterValues['*:ErrorAction']='Stop'
|
||||
|
||||
function exitOnError {
|
||||
param([scriptblock]$ScriptBlock)
|
||||
& @ScriptBlock
|
||||
if ($lastexitcode -ne 0) {
|
||||
exit $lastexitcode
|
||||
}
|
||||
}
|
||||
|
||||
# TODO Add building of examples
|
||||
|
||||
# Actual tests (using the test suite)
|
||||
Get-ChildItem -Filter test/*.carp | ForEach-Object -Process {
|
||||
exitOnError {
|
||||
echo $_.FullName
|
||||
stack exec carp "--" -x --log-memory $_.FullName
|
||||
echo ""
|
||||
}
|
||||
}
|
||||
|
||||
# TODO Add tests for error messages
|
||||
|
||||
# Just make sure these compile
|
||||
exitOnError { stack exec carp "--" ./examples/mutual_recursion.carp -b }
|
||||
exitOnError { stack exec carp "--" ./examples/guessing.carp -b }
|
||||
exitOnError { stack exec carp "--" ./examples/no_core.carp --no-core -b }
|
||||
exitOnError { stack exec carp "--" ./examples/check_malloc.carp -b }
|
||||
|
||||
# Generate docs
|
||||
exitOnError { stack exec carp "--" ./docs/core/generate_core_docs.carp }
|
||||
exitOnError { stack exec carp "--" ./docs/sdl/generate_sdl_docs.carp }
|
||||
|
||||
echo "ALL TESTS DONE."
|
||||
|
Loading…
Reference in New Issue
Block a user