mirror of
https://github.com/carp-lang/Carp.git
synced 2024-09-20 01:47:18 +03:00
38 lines
990 B
PowerShell
38 lines
990 B
PowerShell
# 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 }
|
|
|
|
echo "ALL TESTS DONE."
|
|
|