offinc01.gms : Test dollar control option $offInclude

Description

This test ensures the correct behavior the dollar control option

Contributor: Lutz Westermann, September 2021


Small Model of Type : GAMS


Category : GAMS Test library


Main file : offinc01.gms

$title 'Test dollar control option $offInclude' (offinc01,SEQ=876)

$onText
This test ensures the correct behavior the dollar control option
$offInclude.

Contributor: Lutz Westermann, September 2021
$offText


$onEcho > i1.inc
put / 'hello i1 pre'
$include i2.inc
put / 'hello i1 post'
$offEcho
$onEcho > i2.inc
put / 'hello i2'
$offEcho
$onEcho > run.gms
file fx / '' /; put fx 'Start of put'
$if set offInclude        $offInclude
$include i1.inc
$if set offIncludeSummary $offInclude
$if set onIncludeSummary  $onInclude
$offEcho

$call.checkErrorLevel gams run.gms lo=2
$call.checkErrorLevel grep -q "Include File Summary" run.lst    > %system.NullFile%
$call.checkErrorLevel grep -q "^INCLUDE" run.lst                > %system.NullFile%

$call.checkErrorLevel gams run.gms lo=2 --offIncludeSummary=yes
$call                 grep -q "Include File Summary" run.lst    > %system.NullFile%
$ifE                  errorLevel=0 $abort Include File Summary not expected
$call.checkErrorLevel grep -q "^INCLUDE" run.lst                > %system.NullFile%

$call.checkErrorLevel gams run.gms lo=2 --offInclude=yes --onIncludeSummary=yes
$call.checkErrorLevel grep -q "Include File Summary" run.lst    > %system.NullFile%
$call                 grep -q "^INCLUDE" run.lst                > %system.NullFile%
$ifE                  errorLevel=0 $abort INCLUDE not expected

$call.checkErrorLevel gams run.gms lo=2 --offInclude=yes
$call                 grep -q "Include File Summary" run.lst    > %system.NullFile%
$ifE                  errorLevel=0 $abort Include File Summary not expected
$call                 grep -q "^INCLUDE" run.lst                > %system.NullFile%
$ifE                  errorLevel=0 $abort INCLUDE not expected