@@ -399,15 +399,15 @@ protected WurstModel testScript(String name, boolean executeProg, String prog) {
399399 private void testWithInliningAndOptimizations (String name , boolean executeProg , boolean executeTests , WurstGui gui ,
400400 WurstCompilerJassImpl compiler , WurstModel model , boolean executeProgOnlyAfterTransforms , RunArgs runArgs ) throws Error {
401401 // test with inlining and local optimization
402- currentTestEnv = "With Inlining and Optimizations" ;
402+ setCurrentTestEnv ( "With Inlining and Optimizations" ) ;
403403 compiler .setRunArgs (runArgs .with ("-inline" , "-localOptimizations" ));
404404 translateAndTest (name + "_inlopt" , executeProg , executeTests , gui , compiler , model , executeProgOnlyAfterTransforms );
405405 }
406406
407407 private void testWithInliningAndOptimizationsAndStacktraces (String name , boolean executeProg , boolean executeTests , WurstGui gui ,
408408 WurstCompilerJassImpl compiler , WurstModel model , boolean executeProgOnlyAfterTransforms , RunArgs runArgs ) throws Error {
409409 // test with inlining and local optimization
410- currentTestEnv = "With Inlining, Optimizations and Stacktraces" ;
410+ setCurrentTestEnv ( "With Inlining, Optimizations and Stacktraces" ) ;
411411 compiler .setRunArgs (runArgs .with ("-inline" , "-localOptimizations" , "-stacktraces" ));
412412 translateAndTest (name + "_stacktraceinlopt" , executeProg , executeTests , gui , compiler , model , executeProgOnlyAfterTransforms );
413413 }
@@ -416,15 +416,15 @@ private void testWithInlining(String name, boolean executeProg, boolean executeT
416416 , WurstCompilerJassImpl compiler , WurstModel model , boolean executeProgOnlyAfterTransforms
417417 , RunArgs runArgs ) throws Error {
418418 // test with inlining
419- currentTestEnv = "With Inlining" ;
419+ setCurrentTestEnv ( "With Inlining" ) ;
420420 compiler .setRunArgs (runArgs .with ("-inline" ));
421421 translateAndTest (name + "_inl" , executeProg , executeTests , gui , compiler , model , executeProgOnlyAfterTransforms );
422422 }
423423
424424 private void testWithLocalOptimizations (String name , boolean executeProg , boolean executeTests , WurstGui gui ,
425425 WurstCompilerJassImpl compiler , WurstModel model , boolean executeProgOnlyAfterTransforms , RunArgs runArgs ) throws Error {
426426 // test with local optimization
427- currentTestEnv = "With Local Optimizations" ;
427+ setCurrentTestEnv ( "With Local Optimizations" ) ;
428428 compiler .setRunArgs (runArgs .with ("-localOptimizations" ));
429429 translateAndTest (name + "_opt" , executeProg , executeTests , gui , compiler , model , executeProgOnlyAfterTransforms );
430430 }
@@ -434,7 +434,7 @@ private void testWithoutInliningAndOptimization(String name, boolean executeProg
434434 throws Error {
435435 compiler .setRunArgs (runArgs );
436436 // test without inlining and optimization
437- currentTestEnv = "No opts" ;
437+ setCurrentTestEnv ( "No opts" ) ;
438438 translateAndTest (name + "_no_opts" , executeProg , executeTests , gui , compiler , model , executeProgOnlyAfterTransforms );
439439 }
440440
@@ -526,7 +526,7 @@ private void translateAndTest(String name, boolean executeProg,
526526 if (executeProg ) {
527527 WLogger .info ("Executing imProg before jass transformation" );
528528 String currentEnv = currentTestEnv ;
529- currentTestEnv = "ImProg before jass transformation" ;
529+ setCurrentTestEnv ( "ImProg before jass transformation" ) ;
530530 executeImProg (gui , imProg );
531531 currentTestEnv = currentEnv ;
532532 }
@@ -545,7 +545,7 @@ private void translateAndTest(String name, boolean executeProg,
545545 if (executeProg ) {
546546 WLogger .info ("Executing imProg after jass transformation" );
547547 String currentEnv = currentTestEnv ;
548- currentTestEnv += "-ImProg" ;
548+ setCurrentTestEnv ( currentTestEnv + "-ImProg" ) ;
549549 executeImProg (gui , imProg );
550550 currentTestEnv = currentEnv ;
551551 }
@@ -563,7 +563,7 @@ private void translateAndTest(String name, boolean executeProg,
563563
564564 if (executeProg ) {
565565 String currentEnv = currentTestEnv ;
566- currentTestEnv += "-JassProg" ;
566+ setCurrentTestEnv ( currentTestEnv + "-JassProg" ) ;
567567 executeJassProg (prog );
568568 currentTestEnv = currentEnv ;
569569 }
@@ -613,7 +613,16 @@ private void runPjass(File outputFile) throws Error {
613613 }
614614 }
615615
616- public static String currentTestEnv = "" ;
616+ private static String currentTestEnv = "" ;
617+
618+ public static String getCurrentTestEnv () {
619+ return currentTestEnv ;
620+ }
621+
622+ public static void setCurrentTestEnv (String env ) {
623+ currentTestEnv = env ;
624+ System .out .println ("Current test environment: " + currentTestEnv );
625+ }
617626
618627 private void executeImProg (WurstGui gui , ImProg imProg ) throws TestFailException {
619628 try {
0 commit comments