ifthen7.gms : Test premature termination in include file and ifThen clause

Description

Test different variants of premature termination in an include file
that was included in an ifThen clause.

Contributor: Lutz Westermann, November 2024


Small Model of Type : GAMS


Category : GAMS Test library


Main file : ifthen7.gms

$title Test premature termination in include file and ifThen clause (IFTHEN7, SEQ=973)

$onText
Test different variants of premature termination in an include file
that was included in an ifThen clause.

Contributor: Lutz Westermann, November 2024
$offText


$onEchoV.out > testtemplate.gms
$onEcho.in > test.gms
$echo $%1 > %1.gms

$ifthene.test1 1==1
$include %1.gms
$endif.test1
$offEcho.in

$ifThenI "%2"=="checkErrorLevel"
$  call.checkErrorLevel gams test.gms lo=2
$else
$  call gams test.gms lo=2
$  ifE errorLevel=0 $abort 'Error expected'
$endIf
$call grep "Incomplete $ifThen" test.log
$ifE errorlevel=0 $abort Unexpected incomplete ifThen
$offEcho.out

$batInclude testtemplate exit checkErrorLevel
$batInclude testtemplate stop checkErrorLevel
$batInclude testtemplate terminate checkErrorLevel
$batInclude testtemplate abort.noError checkErrorLevel
$batInclude testtemplate abort