fix jq not found
Some checks failed
memory-limit / Build judge (push) Successful in 11s
memory-limit / Linux / clang (push) Successful in 9s
memory-limit / Linux / gcc (push) Successful in 10s
memory-limit / Windows / clang (push) Failing after 11s
memory-limit / Windows / msvc (push) Failing after 13s

This commit is contained in:
2026-04-10 23:58:48 +03:00
parent 329a7eb132
commit 5197e8d5ec

View File

@@ -96,7 +96,8 @@ jobs:
judge "$SUITE_FILE" . --json > report.json || true judge "$SUITE_FILE" . --json > report.json || true
cat report.json cat report.json
- name: Assert enforcement - name: Assert enforcement (Linux)
if: matrix.toolchain.system == 'Linux'
shell: bash shell: bash
working-directory: ${{ env.EXAMPLE_DIR }} working-directory: ${{ env.EXAMPLE_DIR }}
run: | run: |
@@ -124,3 +125,41 @@ jobs:
rc=1 rc=1
fi fi
exit $rc exit $rc
- name: Assert enforcement (Windows)
if: matrix.toolchain.system == 'Windows'
shell: pwsh
working-directory: ${{ env.EXAMPLE_DIR }}
run: |
$ErrorActionPreference = 'Stop'
$report = Get-Content report.json -Raw | ConvertFrom-Json
$pass = $report.groups | Where-Object { $_.name -eq 'within_limit' } |
Select-Object -ExpandProperty tests |
Where-Object { $_.name -eq 'allocate_16mb' }
$fail = $report.groups | Where-Object { $_.name -eq 'exceeds_limit' } |
Select-Object -ExpandProperty tests |
Where-Object { $_.name -eq 'allocate_256mb' }
$passStatus = $pass.status
$failStatus = $fail.status
$passPeak = if ($pass.peak_memory_kb) { [int]$pass.peak_memory_kb } else { 0 }
$failPeak = if ($fail.peak_memory_kb) { [int]$fail.peak_memory_kb } else { 0 }
Write-Host "within_limit/allocate_16mb: status=$passStatus peak=$passPeak KiB"
Write-Host "exceeds_limit/allocate_256mb: status=$failStatus peak=$failPeak KiB"
$rc = 0
if ($passStatus -ne 'PASS') {
Write-Host "FAIL: within_limit test should PASS, got $passStatus"
$rc = 1
}
if ($failStatus -ne 'MLE') {
Write-Host "FAIL: exceeds_limit test should be MLE, got $failStatus"
$rc = 1
}
if ($passPeak -le 0) {
Write-Host "FAIL: within_limit peak memory not reported (got $passPeak)"
$rc = 1
}
exit $rc