show01.gms : Test $show feature

Description

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


Small Model of Type : GAMS


Category : GAMS Test library


Main file : show01.gms

$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 *
$setGlobal g global
$setLocal l local
$set s scoped
$%gams.user1%
$offEcho

$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  *
---- 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  *
---- 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