pogo_training.ps1 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. param (
  2. [string[]]$scenarios = @(),
  3. [Parameter(Mandatory=$True)]
  4. [string]$binary,
  5. [Parameter(Mandatory=$True)]
  6. [string]$arch,
  7. # force callers to specify this in case of future use
  8. [Parameter(Mandatory=$True)]
  9. [string]$flavor = ""
  10. )
  11. $binpath = Split-Path -Path $binary -Parent
  12. $pgodll = Join-Path $binpath "pgort140.dll";
  13. if (-not (Test-Path ($pgodll))) {
  14. $vcarchpath = ""
  15. if ($arch -eq "x64") {
  16. $vcarchpath = "amd64"
  17. } elseif ($arch -eq "arm") {
  18. $vcarchpath = "arm"
  19. }
  20. $pgoSrcDll = Join-Path ${env:ProgramFiles(x86)} (Join-Path (Join-Path "Microsoft Visual Studio 14.0\VC\bin" $vcarchpath) "pgort140.dll")
  21. Copy-Item $pgoSrcDll $pgodll
  22. }
  23. for ($i=0; $i -lt $scenarios.Length; $i = $i+1) {
  24. $path = $scenarios[$i]
  25. $items = @()
  26. if (Test-Path $path -PathType Container) {
  27. # *.js files in directories
  28. $items = Get-ChildItem -Path $path -Filter "*.js" | % {join-path $path $_ }
  29. }
  30. else {
  31. $items = @($path)
  32. }
  33. for ($j=0; $j -lt $items.Length; $j = $j+1) {
  34. $testFile = $items[$j]
  35. Write-Host "$binary $testFile"
  36. iex "$binary $testFile"
  37. }
  38. }