5959import java .util .concurrent .atomic .AtomicReference ;
6060
6161/**
62- * Sql test executor that uses DBSP as a SQL runtime.
63- * Does not support arbitrary tests: only tests that can be recast as a standing query will work.
62+ * Sql test executor that uses DBSP for query execution.
6463 */
6564public class DBSPExecutor extends SqlSltTestExecutor {
6665 /**
@@ -273,7 +272,7 @@ boolean runBatch(TestStatistics result) {
273272 System .err .println ("Error while compiling " + testQuery .getQuery () + ": " + ex .getMessage ());
274273 result .addFailure (
275274 new TestStatistics .FailedTestDescription (testQuery ,
276- "Exception during test" , ex , options . verbosity > 0 ));
275+ "Exception during test" , "" , ex ));
277276 return false ;
278277 }
279278 queryNo ++;
@@ -290,9 +289,10 @@ boolean runBatch(TestStatistics result) {
290289 System .out .println (elapsedTime (queryNo ));
291290 this .cleanupFilesystem ();
292291 if (this .execute )
293- result .setPassed (result .getPassed () + queryNo ); // This is not entirely correct, but I am not parsing the rust output
292+ // This is not entirely correct, but I am not parsing the rust output
293+ result .setPassedTestCount (result .getPassedTestCount () + queryNo );
294294 else
295- result .setIgnored (result .getIgnored () + queryNo );
295+ result .setIgnoredTestCount (result .getIgnoredTestCount () + queryNo );
296296 } catch (SQLException | IOException | InterruptedException e ) {
297297 throw new RuntimeException (e );
298298 }
@@ -423,7 +423,7 @@ public TestStatistics execute(SltTestFile file, OptionsParser.SuppliedOptions op
423423 // Used for debugging
424424 int toSkip = 0 ; // file.getTestCount() - 10;
425425
426- TestStatistics result = new TestStatistics (options .stopAtFirstError );
426+ TestStatistics result = new TestStatistics (options .stopAtFirstError , options . verbosity );
427427 boolean seenQueries = false ;
428428 int remainingInBatch = batchSize ;
429429 for (ISqlTestOperation operation : file .fileContents ) {
@@ -436,22 +436,17 @@ public TestStatistics execute(SltTestFile file, OptionsParser.SuppliedOptions op
436436 remainingInBatch = batchSize ;
437437 seenQueries = false ;
438438 }
439- boolean status ;
440439 try {
441440 if (this .buggyOperations .contains (stat .statement )) {
442441 this .options .message ("Skipping buggy test " + stat .statement + "\n " , 1 );
443- status = stat .shouldPass ;
444442 } else {
445- status = this .statement (stat );
443+ this .statement (stat );
446444 }
447445 } catch (SQLException ex ) {
448- this . options . error ( ex );
449- status = false ;
446+ if ( stat . shouldPass )
447+ this . options . error ( ex ) ;
450448 }
451449 this .statementsExecuted ++;
452- if (//this.options.validateStatus &&
453- status != stat .shouldPass )
454- throw new RuntimeException ("Statement " + stat .statement + " status " + status + " expected " + stat .shouldPass );
455450 } else {
456451 SqlTestQuery query = operation .to (options .err , SqlTestQuery .class );
457452 if (toSkip > 0 ) {
@@ -632,7 +627,7 @@ void reset() {
632627 this .queriesToRun .clear ();
633628 }
634629
635- public String writeCodeToFile (
630+ public void writeCodeToFile (
636631 DBSPCompiler compiler ,
637632 List <DBSPFunction > inputFunctions ,
638633 List <ProgramAndTester > functions
@@ -649,12 +644,13 @@ public String writeCodeToFile(
649644 rust .add (pt .tester );
650645 }
651646 rust .writeAndClose ();
652- return testFileName ;
653647 }
654648
655649 public static void register (OptionsParser parser ) {
656650 AtomicReference <Boolean > jit = new AtomicReference <>();
651+ jit .set (false );
657652 AtomicReference <Boolean > incremental = new AtomicReference <>();
653+ incremental .set (false );
658654 parser .registerOption ("-j" , null , "Emit JIT code" , o -> {
659655 jit .set (true );
660656 return true ;
0 commit comments