@@ -297,8 +297,7 @@ $jobRows = $queriesToCheck | ForEach-Object -ThrottleLimit $NumThreads -Parallel
297
297
" RULE" = $CurrentRuleName ;
298
298
" QUERY" = $CurrentQueryName ;
299
299
" COMPILE_PASS" = $false ;
300
- " EXTRACTOR_PASS" = $false ;
301
- " EXTRACTOR_ERRORS" = " " ;
300
+ " COMPILE_ERROR_OUTPUT" = " " ;
302
301
" TEST_PASS" = $false ;
303
302
" TEST_DIFFERENCE" = " " ;
304
303
}
@@ -323,32 +322,19 @@ $jobRows = $queriesToCheck | ForEach-Object -ThrottleLimit $NumThreads -Parallel
323
322
}
324
323
catch {
325
324
Write-Host - ForegroundColor ([ConsoleColor ]4 ) " FAILED"
325
+ $row [" COMPILE_ERROR_OUTPUT" ] = $_
326
326
327
327
return $row # although it is unlikely to succeed with the next rule skipping to the next rule
328
328
# ensures all of the rules will be reported in the
329
329
# output.
330
330
}
331
331
332
332
$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
+
350
334
Write-Host " Checking expected output..."
351
335
336
+ # Dragons below 🐉🐉🐉
337
+ #
352
338
# Note this technique uses so-called "wizard" settings to make it possible
353
339
# to compare hand compiled databases using qltest. The relative paths and
354
340
# other options are required to be set as below (especially the detail about
@@ -388,7 +374,6 @@ $jobRows = $queriesToCheck | ForEach-Object -ThrottleLimit $NumThreads -Parallel
388
374
Write-Host " Standard Out Buffered to: $stdOut "
389
375
Write-Host " Standard Error Buffered to: $stdErr "
390
376
391
-
392
377
$procDetails = Start-Process - FilePath " codeql" - PassThru - NoNewWindow - Wait - ArgumentList " test run $qlRefFile --dataset=`" $datasetRelPath `" " - RedirectStandardOutput $stdOut - RedirectStandardError $stdErr
393
378
394
379
if (-Not $procDetails.ExitCode -eq 0 ) {
0 commit comments