You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

69 lines
1.0 KiB

  1. # Script that runs the tests
  2. #
  3. # Version: 20161106
  4. $ExitSuccess = 0
  5. $ExitFailure = 1
  6. $ExitIgnore = 77
  7. Set-Location -Path "tests"
  8. $Result = ${ExitSuccess}
  9. $Lines = Get-Content "Makefile.am"
  10. $InTests = $FALSE
  11. Foreach (${Line} in ${Lines})
  12. {
  13. If (${InTests})
  14. {
  15. If (-Not ${Line})
  16. {
  17. ${InTests} = $FALSE
  18. Continue
  19. }
  20. ${Line} = ${Line}.TrimStart()
  21. If (${Line}.EndsWith(" \"))
  22. {
  23. ${Line} = ${Line}.Substring(0, ${Line}.Length - 2)
  24. }
  25. If (-Not (${Line}.EndsWith(".sh")))
  26. {
  27. Continue
  28. }
  29. ${Line} = ${Line}.Substring(0, ${Line}.Length - 3)
  30. ${Line} = ".\${Line}.ps1"
  31. Try
  32. {
  33. Invoke-Expression ${Line}
  34. If (${LastExitCode} -ne ${ExitSuccess})
  35. {
  36. $Result = ${ExitFailure}
  37. Write-Host "FAIL" -foreground Red -nonewline
  38. }
  39. Else
  40. {
  41. Write-Host "PASS" -foreground Green -nonewline
  42. }
  43. }
  44. Catch
  45. {
  46. Write-Host "SKIP" -foreground Cyan -nonewline
  47. }
  48. Write-Host ": ${Line}"
  49. }
  50. ElseIf (${Line}.StartsWith("TESTS = "))
  51. {
  52. ${InTests} = $TRUE
  53. }
  54. }
  55. Set-Location -Path ".."
  56. Exit ${Result}