mirror of
https://github.com/Show-maket/IR-protocol.git
synced 2026-09-21 20:39:35 +00:00
fix(rx): reject undersized typed frames safely
This commit is contained in:
38
tests/run_host_tests.ps1
Normal file
38
tests/run_host_tests.ps1
Normal file
@ -0,0 +1,38 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$repo = Split-Path -Parent $PSScriptRoot
|
||||
$build = Join-Path $PSScriptRoot '.build'
|
||||
New-Item -ItemType Directory -Force -Path $build | Out-Null
|
||||
|
||||
$compiler = if (Test-Path -LiteralPath 'C:\MinGW\bin\g++.exe') {
|
||||
'C:\MinGW\bin\g++.exe'
|
||||
} else {
|
||||
(Get-Command g++ -ErrorAction Stop).Source
|
||||
}
|
||||
|
||||
$common = @(
|
||||
'-std=c++17', '-Wall', '-Wextra', '-Werror',
|
||||
'-Wno-unused-parameter', '-Wno-ignored-qualifiers', '-Wno-sign-compare',
|
||||
'-I', (Join-Path $PSScriptRoot 'arduino_stubs'),
|
||||
'-I', $repo
|
||||
)
|
||||
|
||||
& $compiler @common `
|
||||
(Join-Path $PSScriptRoot 'test_timing_contract.cpp') `
|
||||
(Join-Path $repo 'IR_Encoder.cpp') `
|
||||
(Join-Path $repo 'IR_config.cpp') `
|
||||
'-o' (Join-Path $build 'test_timing_contract.exe')
|
||||
if ($LASTEXITCODE -ne 0) { throw 'timing test build failed' }
|
||||
|
||||
& (Join-Path $build 'test_timing_contract.exe')
|
||||
if ($LASTEXITCODE -ne 0) { throw 'timing test failed' }
|
||||
|
||||
& $compiler @common `
|
||||
(Join-Path $PSScriptRoot 'test_packet_types.cpp') `
|
||||
(Join-Path $repo 'PacketTypes.cpp') `
|
||||
(Join-Path $repo 'IR_config.cpp') `
|
||||
'-o' (Join-Path $build 'test_packet_types.exe')
|
||||
if ($LASTEXITCODE -ne 0) { throw 'packet test build failed' }
|
||||
|
||||
& (Join-Path $build 'test_packet_types.exe')
|
||||
if ($LASTEXITCODE -ne 0) { throw 'packet test failed' }
|
||||
Reference in New Issue
Block a user