run_all_tests.ps1 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. $ErrorActionPreference = "Continue"
  2. $output = @()
  3. # Test 1: Check if v11_test.js loads
  4. try {
  5. $nodeVer = node --version
  6. $output += "Node version: $nodeVer"
  7. } catch {
  8. $output += "Node not found: $_"
  9. }
  10. # Test 2: Run v11 test and capture output
  11. try {
  12. $result = & node "$PSScriptRoot\v11_test.js" 2>&1 | Out-String
  13. $output += "--- v11_test.js output ---"
  14. $output += $result
  15. # Read the result file
  16. $resultFile = "$PSScriptRoot\v11_result.txt"
  17. if (Test-Path $resultFile) {
  18. $output += "--- v11_result.txt content ---"
  19. $output += Get-Content $resultFile -Raw
  20. } else {
  21. $output += "v11_result.txt not found"
  22. }
  23. } catch {
  24. $output += "v11 test error: $_"
  25. }
  26. # Test 3: Maven compile check
  27. try {
  28. $mvnOut = & mvn test-compile -q 2>&1 | Out-String
  29. $output += "--- Maven compile output (last 20 lines) ---"
  30. $lines = $mvnOut -split "`n"
  31. $output += ($lines[-20..-1] -join "`n")
  32. $output += "Maven exit: $LASTEXITCODE"
  33. } catch {
  34. $output += "Maven error: $_"
  35. }
  36. $output -join "`n" | Out-File -FilePath "$PSScriptRoot\test_run_output.txt" -Encoding utf8
  37. Write-Host "SCRIPT_DONE"