2020-04-06 18:36:42 +03:00
|
|
|
# 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 ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-23 08:30:43 +03:00
|
|
|
# TODO Add test for empty project (with and without core)
|
|
|
|
|
2020-04-06 18:36:42 +03:00
|
|
|
# TODO Add tests for error messages
|
|
|
|
|
|
|
|
# Just make sure these compile
|
|
|
|
exitOnError { stack exec carp "--" ./examples/mutual_recursion.carp -b }
|
2020-11-23 08:30:43 +03:00
|
|
|
exitOnError { stack exec carp "--" ./examples/guessing_game.carp -b }
|
2020-04-30 16:01:30 +03:00
|
|
|
exitOnError { stack exec carp "--" ./examples/no_core.carp --no-core --no-profile -b }
|
2020-04-06 18:36:42 +03:00
|
|
|
exitOnError { stack exec carp "--" ./examples/check_malloc.carp -b }
|
2021-02-04 10:35:48 +03:00
|
|
|
exitOnError { stack exec carp "--" ./examples/benchmark_*.carp -b }
|
2020-04-06 18:36:42 +03:00
|
|
|
|
|
|
|
# Generate docs
|
|
|
|
exitOnError { stack exec carp "--" ./docs/core/generate_core_docs.carp }
|
|
|
|
|
|
|
|
echo "ALL TESTS DONE."
|