| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- $ErrorActionPreference = "Continue"
- $output = @()
- # Test 1: Check if v11_test.js loads
- try {
- $nodeVer = node --version
- $output += "Node version: $nodeVer"
- } catch {
- $output += "Node not found: $_"
- }
- # Test 2: Run v11 test and capture output
- try {
- $result = & node "$PSScriptRoot\v11_test.js" 2>&1 | Out-String
- $output += "--- v11_test.js output ---"
- $output += $result
-
- # Read the result file
- $resultFile = "$PSScriptRoot\v11_result.txt"
- if (Test-Path $resultFile) {
- $output += "--- v11_result.txt content ---"
- $output += Get-Content $resultFile -Raw
- } else {
- $output += "v11_result.txt not found"
- }
- } catch {
- $output += "v11 test error: $_"
- }
- # Test 3: Maven compile check
- try {
- $mvnOut = & mvn test-compile -q 2>&1 | Out-String
- $output += "--- Maven compile output (last 20 lines) ---"
- $lines = $mvnOut -split "`n"
- $output += ($lines[-20..-1] -join "`n")
- $output += "Maven exit: $LASTEXITCODE"
- } catch {
- $output += "Maven error: $_"
- }
- $output -join "`n" | Out-File -FilePath "$PSScriptRoot\test_run_output.txt" -Encoding utf8
- Write-Host "SCRIPT_DONE"
|