GAMS [ Home | Downloads | Documentation | Solvers | APIs | Tools | Model Libraries | Resources | Sales | Support | Contact Us | Search ]

slx01.gms : run tests for different solvelink values

Description

Many test models exist to test how CMEX behaves, but the code tested
may depend on the solvelink value used.  This model runs such tests
over a range of solvelink values, but only those where a simple solve
statement (vs. something without handleCollect, etc) is needed.

Contributor: Steve Dirkse, Dec 2016

Small Model of Type : GAMS


Category : GAMS Test library


Main file : slx01.gms

$title 'run tests for different solvelink values' (slx01,SEQ=711)

$ontext
Many test models exist to test how CMEX behaves, but the code tested
may depend on the solvelink value used.  This model runs such tests
over a range of solvelink values, but only those where a simple solve
statement (vs. something without handleCollect, etc) is needed.

Contributor: Steve Dirkse, Dec 2016
$offtext

SETS
  m 'models to test' /
    mcp06
    mcp11
  /
  v 'solvelink values to test' /
    %SOLVELINK.ChainScript%   'SOLVELINK.ChainScript'
    %SOLVELINK.CallScript%    'SOLVELINK.CallScript'
    %SOLVELINK.CallModule%    'SOLVELINK.CallModule'
    %SOLVELINK.LoadLibrary%   'SOLVELINK.LoadLibrary'
  /
  tried(m,v)  'tests attempted'
  failed(m,v) 'tests failed'
  ;

file exec 'command to execute';

scalar rc;
loop{m,
  put_utility exec 'shell' / 'rm -f ' m.tl:0 '.gms';
  put_utility exec 'shell' / 'testlib -q ' m.tl:0;
  loop{v,
    put_utility exec 'shell' / 'gams ' m.tl:0 ' lo=%gams.lo% SL=' v.tl:0;
    rc = errorlevel;
    tried(m,v) = yes;
    failed(m,v) = [rc <> 0];
  };
};

abort$[card(failed)] 'Some tests failed', failed, tried;