$title Test $show feature (show01,SEQ=838) $onText This test verifies that the Environment Report printed to the output file using $show (and its variants $showFiles, $showVariables, and $showMacros) works as expected. Contributor: Lutz Westermann, November 2020 $offText $onEchoV > t.gms $macro star * $macro firstStar * $setGlobal g global $setLocal l local $set s scoped $%gams.user1% $offEcho * Test the default (unsorted) variants $call.checkErrorLevel gams t.gms lo=%gams.lo% user1=show $onEchoV > tWantShow.txt ---- Begin of Active File List Level Type Line Filename --------------------------------- ---- End of Active File List ---- Begin of Compile-time Variable List Level SetVal Type Text ----------------------------------------------------- 0 l LOCAL local 0 s SCOPED scoped 0 g GLOBAL global ---- End of Compile-time Variable List ---- Begin of Macro List $macro star * $macro firstStar * ---- End of Macro List $offEcho $call.checkErrorLevel awk "/Begin of Active File List/,/End of Macro List/" t.lst | sed -n "/INPUT/!p" > tHaveShow.txt $call.checkErrorLevel diff -bw tHaveShow.txt tWantShow.txt $call.checkErrorLevel gams t.gms lo=%gams.lo% user1=showFiles $onEchoV > tWantShowFiles.txt ---- Begin of Active File List Level Type Line Filename --------------------------------- ---- End of Active File List $offEcho $call.checkErrorLevel awk "/Begin of Active File List/,/End of Active File List/" t.lst | sed -n "/INPUT/!p" > tHaveShowFiles.txt $call.checkErrorLevel diff -bw tHaveShowFiles.txt tWantShowFiles.txt $call.checkErrorLevel gams t.gms lo=%gams.lo% user1=showVariables $onEchoV > tWantShowVariables.txt ---- Begin of Compile-time Variable List Level SetVal Type Text ----------------------------------------------------- 0 l LOCAL local 0 s SCOPED scoped 0 g GLOBAL global ---- End of Compile-time Variable List $offEcho $call.checkErrorLevel awk "/Begin of Compile-time Variable List/,/End of Compile-time Variable List/" t.lst | sed -n "/INPUT/!p" > tHaveShowVariables.txt $call.checkErrorLevel diff -bw tHaveShowVariables.txt tWantShowVariables.txt $call.checkErrorLevel gams t.gms lo=%gams.lo% user1=showMacros $onEchoV > tWantShowMacros.txt ---- Begin of Macro List $macro star * $macro firstStar * ---- End of Macro List $offEcho $call.checkErrorLevel awk "/Begin of Macro List/,/End of Macro List/" t.lst | sed -n "/INPUT/!p" > tHaveShowMacros.txt $call.checkErrorLevel diff -bw tHaveShowMacros.txt tWantShowMacros.txt * Test the sorted variants $call.checkErrorLevel gams t.gms lo=%gams.lo% user1=show.sorted $onEchoV > tWantShow.txt ---- Begin of Active File List Level Type Line Filename --------------------------------- ---- End of Active File List ---- Begin of Compile-time Variable List Level SetVal Type Text ----------------------------------------------------- 0 g GLOBAL global 0 l LOCAL local 0 s SCOPED scoped ---- End of Compile-time Variable List ---- Begin of Macro List $macro firstStar * $macro star * ---- End of Macro List $offEcho $call.checkErrorLevel awk "/Begin of Active File List/,/End of Macro List/" t.lst | sed -n "/INPUT/!p" > tHaveShow.txt $call.checkErrorLevel diff -bw tHaveShow.txt tWantShow.txt $call.checkErrorLevel gams t.gms lo=%gams.lo% user1=showVariables.sorted $onEchoV > tWantShowVariables.txt ---- Begin of Compile-time Variable List Level SetVal Type Text ----------------------------------------------------- 0 g GLOBAL global 0 l LOCAL local 0 s SCOPED scoped ---- End of Compile-time Variable List $offEcho $call.checkErrorLevel awk "/Begin of Compile-time Variable List/,/End of Compile-time Variable List/" t.lst | sed -n "/INPUT/!p" > tHaveShowVariables.txt $call.checkErrorLevel diff -bw tHaveShowVariables.txt tWantShowVariables.txt $call.checkErrorLevel gams t.gms lo=%gams.lo% user1=showMacros.sorted $onEchoV > tWantShowMacros.txt ---- Begin of Macro List $macro firstStar * $macro star * ---- End of Macro List $offEcho $call.checkErrorLevel awk "/Begin of Macro List/,/End of Macro List/" t.lst | sed -n "/INPUT/!p" > tHaveShowMacros.txt $call.checkErrorLevel diff -bw tHaveShowMacros.txt tWantShowMacros.txt