@@ -297,8 +297,7 @@ $jobRows = $queriesToCheck | ForEach-Object -ThrottleLimit $NumThreads -Parallel
297297 " RULE" = $CurrentRuleName ;
298298 " QUERY" = $CurrentQueryName ;
299299 " COMPILE_PASS" = $false ;
300- " EXTRACTOR_PASS" = $false ;
301- " EXTRACTOR_ERRORS" = " " ;
300+ " COMPILE_ERROR_OUTPUT" = " " ;
302301 " TEST_PASS" = $false ;
303302 " TEST_DIFFERENCE" = " " ;
304303 }
@@ -323,32 +322,19 @@ $jobRows = $queriesToCheck | ForEach-Object -ThrottleLimit $NumThreads -Parallel
323322 }
324323 catch {
325324 Write-Host - ForegroundColor ([ConsoleColor ]4 ) " FAILED"
325+ $row [" COMPILE_ERROR_OUTPUT" ] = $_
326326
327327 return $row # although it is unlikely to succeed with the next rule skipping to the next rule
328328 # ensures all of the rules will be reported in the
329329 # output.
330330 }
331331
332332 $row [" COMPILE_PASS" ] = $true
333- Write-Host " Validating extractor results..." - NoNewline
334-
335- try {
336- $diagnostics = Execute- QueryAndDecodeAsJson - DatabasePath $db - QueryPath $diagnostic_query
337- }catch {
338- Write-Host - ForegroundColor ([ConsoleColor ]4 ) $_Exception.Message
339- return $row
340- }
341-
342- if ( $diagnostics .' #select' .tuples.Length -eq 0 ) {
343- $row [" EXTRACTOR_PASS" ] = $true
344- Write-Host - ForegroundColor ([ConsoleColor ]2 ) " OK"
345- } else {
346- Write-Host - ForegroundColor ([ConsoleColor ]4 ) " FAILED"
347- $row [" EXTRACTOR_ERRORS" ] = $diagnostics | ConvertTo-Json - Depth 100
348- }
349-
333+
350334 Write-Host " Checking expected output..."
351335
336+ # Dragons below 🐉🐉🐉
337+ #
352338 # Note this technique uses so-called "wizard" settings to make it possible
353339 # to compare hand compiled databases using qltest. The relative paths and
354340 # other options are required to be set as below (especially the detail about
@@ -388,7 +374,6 @@ $jobRows = $queriesToCheck | ForEach-Object -ThrottleLimit $NumThreads -Parallel
388374 Write-Host " Standard Out Buffered to: $stdOut "
389375 Write-Host " Standard Error Buffered to: $stdErr "
390376
391-
392377 $procDetails = Start-Process - FilePath " codeql" - PassThru - NoNewWindow - Wait - ArgumentList " test run $qlRefFile --dataset=`" $datasetRelPath `" " - RedirectStandardOutput $stdOut - RedirectStandardError $stdErr
393378
394379 if (-Not $procDetails.ExitCode -eq 0 ) {
0 commit comments