gdxcopy3.gms : Test GDXCOPY utility with -V7C and V7U options

Description

Gdxcopy should write a version 7 GDX file
(i.e. one compatible with Distribution 22.6) if the -v7c or -v7u
flags are used.

Contributor: Steve Dirkse

  so many timing issues with directories, use separate ones


Small Model of Type : GAMS


Category : GAMS Test library


Main file : gdxcopy3.gms

$title 'Test GDXCOPY utility with -V7C and V7U options' (GDXCOPY3,SEQ=354)

$ontext

Gdxcopy should write a version 7 GDX file
(i.e. one compatible with Distribution 22.6) if the -v7c or -v7u
flags are used.

Contributor: Steve Dirkse
$offtext

* so many timing issues with directories, use separate ones
$set subdirC gdxcopyC.dir
$set subdirU gdxcopyU.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

$call =gams makegdx.gms lo=%GAMS.lo% gdx=tcopy.gdx

$if dexist %subdirC% $call rm -r %subdirC%
$if dexist %subdirC% $abort directory %subdirC% still exists!
$call gdxcopy -v7c tcopy.gdx %subdirC%
$if not dexist %subdirC%                      $abort directory %subdirC% should exist after gdxdopy call
$if not  exist %subdirC%%system.dirsep%tcopy.gdx $abort file %subdirC%%system.dirsep%tcopy.gdx should exist after gdxdopy call
$call gdxdiff tcopy.gdx %subdirC%%system.dirsep%tcopy.gdx > %system.nullfile%
$if errorlevel 1 $abort "Files differ: bad gdxcopy -v7c or gdxdiff"

$if dexist %subdirU% $call rm -r %subdirU%
$if dexist %subdirU% $abort directory %subdirU% still exists!
$call gdxcopy -v7u tcopy.gdx %subdirU%
$if not dexist %subdirU%                      $abort directory %subdirU% should exist after gdxdopy call
$if not  exist %subdirU%%system.dirsep%tcopy.gdx $abort file %subdirU%%system.dirsep%tcopy.gdx should exist after gdxdopy call
$call gdxdiff tcopy.gdx %subdirU%%system.dirsep%tcopy.gdx > %system.nullfile%
$if errorlevel 1 $abort "Files differ: bad gdxcopy -v7u or gdxdiff"

$log All done: the test passed