gdxcopy1.gms : Test GDXCOPY utility with /V5 option

Description

Gdxcopy should write a version 5 GDX file
(i.e. one compatible with Distribution 22.2) if the -v5
flag is used.

Contributor: Steve Dirkse


Small Model of Type : GAMS


Category : GAMS Test library


Main file : gdxcopy1.gms

$title 'Test GDXCOPY utility with -V5 option' (GDXCOPY1,SEQ=290)

$ontext

Gdxcopy should write a version 5 GDX file
(i.e. one compatible with Distribution 22.2) if the -v5
flag is used.

Contributor: Steve Dirkse
$offtext

$ifi %system.platform% == DEX $exit No V5 GDX exists for this platform
$ifi %system.platform% == DAX $exit No V5 GDX exists for this platform

$set subdir gdxcopy.dir

$onecho > makegdx.gms
set I / 1 * 10 /;
parameter c(I);
c(I) = ord(I);
positive variable x(I);
x.up(I) = 2 * c(I);
x.l(I)  = c(I);
x.m(I) = 3 * c(I);
$offecho

$if dexist %subdir% $call rm -r %subdir%
$if dexist %subdir% $abort directory %subdir% still exists!
$call =gams makegdx.gms lo=%GAMS.lo% gdx=tcopy.gdx

* $call mkdir %subdir%
$call gdxcopy -v5 tcopy.gdx %subdir%
$if not dexist %subdir%                      $abort directory %subdir% should exist after gdxdopy call
$if not  exist %subdir%%system.dirsep%tcopy.gdx $abort file %subdir%%system.dirsep%tcopy.gdx should exist after gdxdopy call

$call gdxdiff tcopy.gdx %subdir%%system.dirsep%tcopy.gdx > %system.nullfile%
$if errorlevel 1 $abort "Files differ: bad gdxcopy or gdxdiff"

$log All done: the test passed