File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -371,7 +371,7 @@ object SetupApp {
371371 return
372372 }
373373 if (setup.quiet) {
374- val diagnostics = quietCompilerDiagnostics (result.output)
374+ val diagnostics = quietCompilerFailureOutput (result.output, setup.debug )
375375 diagnostics.forEach { System .err.println (it) }
376376 fail(" ❌ Wurst $commandName failed. (Errors: ${quietCompilerErrorCount(result.output, diagnostics)} )" )
377377 return
@@ -408,6 +408,10 @@ object SetupApp {
408408 return true
409409 }
410410
411+ internal fun quietCompilerFailureOutput (output : List <String >, debug : Boolean ): List <String > {
412+ return if (debug) output else quietCompilerDiagnostics(output)
413+ }
414+
411415 internal fun quietCompilerDiagnostics (output : List <String >): List <String > {
412416 val diagnostics = ArrayList <String >()
413417 var pendingVerboseError: MatchResult ? = null
Original file line number Diff line number Diff line change @@ -347,6 +347,25 @@ class GenerateTests {
347347 )
348348 }
349349
350+ @Test(priority = 10 )
351+ fun testQuietDebugCompilerFailureOutputBypassesFilter () {
352+ val output = listOf (
353+ " Error Broken.wurst:12: Could not find variable realUserTypo." ,
354+ " java.lang.IllegalStateException: extra debug context" ,
355+ " \t at de.peeeq.wurstio.Main.main(Main.java:1)" ,
356+ " Warning: Error: e:Could not find variable generatedNoise."
357+ )
358+
359+ Assert .assertEquals(SetupApp .quietCompilerFailureOutput(output, debug = true ), output)
360+ Assert .assertEquals(
361+ SetupApp .quietCompilerFailureOutput(output, debug = false ),
362+ listOf (
363+ " Error Broken.wurst:12: Could not find variable realUserTypo." ,
364+ " java.lang.IllegalStateException: extra debug context"
365+ )
366+ )
367+ }
368+
350369 @Test(priority = 10 )
351370 fun testDevBuildFlag () {
352371 val setup = SetupMain ()
You can’t perform that action at this time.
0 commit comments