@@ -43,16 +43,15 @@ public RunKoans(Path pathToEnlightenment){
4343 }
4444
4545 public void run (String ... values ) {
46- ApplicationUtils .getPresenter ().clearMessages ();
47- KoanSuiteResult result = runKoans ();
48- ApplicationUtils .getPresenter ().displayResult (result );
49- if (!ApplicationSettings .isInteractive ()) {
50- // could overflow past 255 resulting in 0 (ie all koans succeed) or misleading # of failed koans
51- int numberOfFailingKoans = Math . min ( 255 , result . getTotalNumberOfKoans () - result . getNumberPassing ());
52- System . err . println ( numberOfFailingKoans );
53- AppLauncher . exit ( numberOfFailingKoans );
46+ ApplicationUtils .getPresenter ().clearMessages ();
47+ KoanSuiteResult result = runKoans ();
48+ ApplicationUtils .getPresenter ().displayResult (result );
49+ if (!ApplicationSettings .isInteractive ()) {
50+ // could overflow past 255 resulting in 0 (ie all koans succeed)
51+ // or otherwise misleading # of failed koans
52+ AppLauncher . exit ( Math . min ( 255 , result . getTotalNumberOfKoans () - result . getNumberPassing ()) );
53+ }
5454 }
55- }
5655
5756 KoanSuiteResult runKoans () {
5857 List <String > passingSuites = new ArrayList <String >();
@@ -109,6 +108,9 @@ private Object safelyConstructSuite(DynamicClassLoader loader,
109108 while (suite == null || compilationListener .isLastCompilationAttemptFailure ()) {
110109 suite = constructSuite (loader , e .getKey (), compilationListener );
111110 if (compilationListener .isLastCompilationAttemptFailure ()){
111+ if (!ApplicationSettings .isInteractive ()){
112+ AppLauncher .exit (255 );
113+ }
112114 try {
113115 Thread .sleep (1000 );
114116 } catch (InterruptedException e1 ) {}
0 commit comments