Description
Using the 'Debug=1967' command line option one can simulate an unexpected crash of CMEX. This test verifies that the GAMS executable catches this crash as "Unexpected cmexRC" on Windows, which is defined by the exit code 407. On Unix we expect an "Could not spawn GAMSCMEX" error with exit code 400. See also: https://www.gams.com/latest/docs/UG_GAMSReturnCodes.html Contributor: Lutz Westermann, January 2015
Small Model of Type : GAMS
Category : GAMS Test library
Main file : cmexrc01.gms
$title 'Trigger unexpected cmexRC error' (CMEXRC01,SEQ=675)
$onText
Using the 'Debug=1967' command line option one can simulate an unexpected crash
of CMEX. This test verifies that the GAMS executable catches this crash as
"Unexpected cmexRC" on Windows, which is defined by the exit code 407. On Unix
we expect an "Could not spawn GAMSCMEX" error with exit code 400.
See also: https://www.gams.com/latest/docs/UG_GAMSReturnCodes.html
Contributor: Lutz Westermann, January 2015
$offText
$call gamslib -q trnsport
$call gams trnsport.gms lo=%GAMS.lo% Debug=1967
$ifThen %system.filesys% == UNIX
$ ifE errorlevel<>mod(400,256) $abort 'Debug=1967 should trigger an "Could not spawn GAMSCMEX (=400)" error'
$else
$ ifE errorlevel<>407 $abort 'Debug=1967 should trigger an "Unexpected cmexRC (=407)" error'
$endIf