Back to home page

Enduro/X

 
 

    


0001 #!/bin/bash
0002 ##
0003 ##
0004 ## @file test_mkfldhdr_env.sh
0005 ##
0006 ## -----------------------------------------------------------------------------
0007 ## Enduro/X Middleware Platform for Distributed Transaction Processing
0008 ## Copyright (C) 2009-2016, ATR Baltic, Ltd. All Rights Reserved.
0009 ## Copyright (C) 2017-2018, Mavimax, Ltd. All Rights Reserved.
0010 ## This software is released under one of the following licenses:
0011 ## GPL or Mavimax's license for commercial use.
0012 ## -----------------------------------------------------------------------------
0013 ## GPL license:
0014 ## 
0015 ## This program is free software; you can redistribute it and/or modify it under
0016 ## the terms of the GNU General Public License as published by the Free Software
0017 ## Foundation; either version 3 of the License, or (at your option) any later
0018 ## version.
0019 ##
0020 ## This program is distributed in the hope that it will be useful, but WITHOUT ANY
0021 ## WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
0022 ## PARTICULAR PURPOSE. See the GNU General Public License for more details.
0023 ##
0024 ## You should have received a copy of the GNU General Public License along with
0025 ## this program; if not, write to the Free Software Foundation, Inc., 59 Temple
0026 ## Place, Suite 330, Boston, MA 02111-1307 USA
0027 ##
0028 ## -----------------------------------------------------------------------------
0029 ## A commercial use license is available from Mavimax, Ltd
0030 ## contact@mavimax.com
0031 ## -----------------------------------------------------------------------------
0032 ##
0033 echo "Testing mkfldhdr, reading field table from env" >&2
0034 #####
0035 DIR=`mktemp -d`
0036 
0037 #  Generate files
0038 ret=0
0039 
0040 # Load env variables
0041 . setenv
0042 
0043 ../mkfldhdr/mkfldhdr -d $DIR
0044 # save return code
0045 ret=$?
0046 
0047 # Compare each generated file, should be the same...
0048 
0049 if [ $ret -eq 0 ]; then
0050         # Compare each file by file
0051         LIST=`ls -1 $DIR`
0052         for f in $LIST; do
0053                 echo "Comparing $DIR/$f with mkfldhdr_ref/$f" >&2
0054                 diff $DIR/$f mkfldhdr_ref/$f
0055                 ret=$?
0056                 if [ $ret -ne 0 ]; then
0057                         break;          
0058                 fi
0059         done
0060 fi
0061 
0062 # Remove temp dir
0063 #rm -rf $DIR
0064 exit $ret