25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

44 lines
1012 B

  1. $ErrorActionPreference = "Stop"
  2. $gcc = "D:\Dev-Cpp\MinGW64\bin\gcc.exe"
  3. $repoRoot = (Resolve-Path (Join-Path $PSScriptRoot "..\..")).Path
  4. $temporaryExe = Join-Path ([System.IO.Path]::GetTempPath()) `
  5. ("plsr_host_tests_{0}.exe" -f [System.Guid]::NewGuid().ToString("N"))
  6. $exitCode = 1
  7. if (-not (Test-Path -LiteralPath $gcc)) {
  8. throw "Required compiler not found: $gcc"
  9. }
  10. $compileArguments = @(
  11. "-std=c99"
  12. "-Wall"
  13. "-Wextra"
  14. "-Werror"
  15. "-DPLSR_HOST_TEST"
  16. "-I$repoRoot\PLSR\Inc"
  17. "-I$repoRoot\PLSR\Src"
  18. "$repoRoot\PLSR\Src\plsr.c"
  19. "$repoRoot\PLSR\Src\plsr_planner.c"
  20. "$repoRoot\PLSR\Src\plsr_platform_f407.c"
  21. "$PSScriptRoot\test_plsr_host.c"
  22. "-o"
  23. $temporaryExe
  24. )
  25. try {
  26. & $gcc @compileArguments
  27. if ($LASTEXITCODE -ne 0) {
  28. $exitCode = $LASTEXITCODE
  29. }
  30. else {
  31. & $temporaryExe
  32. $exitCode = $LASTEXITCODE
  33. }
  34. }
  35. finally {
  36. Remove-Item -LiteralPath $temporaryExe -Force -ErrorAction SilentlyContinue
  37. }
  38. exit $exitCode