Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

43 lignes
972 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_platform_f407.c"
  20. "$PSScriptRoot\test_plsr_host.c"
  21. "-o"
  22. $temporaryExe
  23. )
  24. try {
  25. & $gcc @compileArguments
  26. if ($LASTEXITCODE -ne 0) {
  27. $exitCode = $LASTEXITCODE
  28. }
  29. else {
  30. & $temporaryExe
  31. $exitCode = $LASTEXITCODE
  32. }
  33. }
  34. finally {
  35. Remove-Item -LiteralPath $temporaryExe -Force -ErrorAction SilentlyContinue
  36. }
  37. exit $exitCode