mirror of
https://github.com/Show-maket/IR-protocol.git
synced 2026-09-21 12:29:35 +00:00
39 lines
1.3 KiB
PowerShell
39 lines
1.3 KiB
PowerShell
$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' }
|