gbin1.gms : Checks to see if we have unix utilities in the path

Description

This test is a bit convoluted for Windows:
We first need to reset the path to the gams system directory
and only then we test that gams will set the path to gbin correctly
by executing a simple grep job.


Small Model of Type : GAMS


Category : GAMS Test library


Main file : gbin1.gms

$title 'Checks to see if we have unix utilities in the path' (GBIN1,SEQ=61)

* This test is a bit convoluted for Windows:
* We first need to reset the path to the gams system directory
* and only then we test that gams will set the path to gbin correctly
* by executing a simple grep job.

$echo display 'good test by gbin1 on %system.filesys%' > temp.txt
$echo '$call grep display temp.txt > temp.gms'         > temp.%gams.scrext%
$echo $error gbin1 test failed                         > temp.gms

$if %system.filesys% == MSNT $set ext  temp.cmd

$if NOT set ext $goTo notMS

$echo @echo off                              > %ext%
$echo path=%gams.sysdir%                     >> %ext%
$echo 'gams temp.%gams.scrext% lo=%GAMS.lo%' >> %ext%
$call %ext%
$goTo grepcheck

$label notMS
$include temp.%gams.scrext%

$label grepcheck
$call =gams temp.gms lo=%GAMS.lo%
$if NOT errorlevel 0 $error errorlevel not 0 grep failed
$if     errorlevel 1 $error errorlevel not 0 grep failed