test-native.ps1 941 B

1234567891011121314
  1. $ErrorActionPreference = "Stop"
  2. # Run in PowerShell from the repository root in a logged-in desktop session.
  3. $env:CGO_ENABLED = "0"
  4. New-Item -ItemType Directory -Force bin, test-results | Out-Null
  5. function Invoke-Go { & go @args; if ($LASTEXITCODE -ne 0) { throw "go command failed: $args" } }
  6. Invoke-Go build -buildvcs=false -mod=vendor -o bin/cfbrowser.exe ./cmd/cfbrowser
  7. Invoke-Go build -buildvcs=false -mod=vendor -o bin/cfbrowser-worker.exe ./cmd/cfbrowser-worker
  8. Invoke-Go test -buildvcs=false -mod=vendor ./internal/nativehost ./driver/native -count=1 -v -timeout=120s
  9. & ./bin/cfbrowser.exe --engine native --worker "$PWD/bin/cfbrowser-worker.exe" --diagnostics demo
  10. if ($LASTEXITCODE -ne 0) { throw "native demo failed" }
  11. $env:CFBROWSER_INTEGRATION = "1"
  12. $env:CFBROWSER_TEST_ENGINE = "native"
  13. $env:CFBROWSER_WORKER = "$PWD/bin/cfbrowser-worker.exe"
  14. Invoke-Go test -buildvcs=false -mod=vendor ./integration -count=1 -v -timeout=180s