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