Back to home page

Enduro/X

 
 

    


0001 #!/bin/bash
0002 ## 
0003 ##
0004 ## @file test_mkfldhdr_cmd.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 cmd." >&2
0033 #####
0034 DIR=`mktemp -d`
0035 
0036 #  Generate files
0037 ret=0
0038 
0039 ../mkfldhdr/mkfldhdr -d $DIR ./ubftab/*.fd
0040 # save return code
0041 ret=$?
0042 
0043 # Compare each generated file, should be the same...
0044 
0045 if [ $ret -eq 0 ]; then
0046         # Compare each file by file
0047         LIST=`ls -1 $DIR`
0048         for f in $LIST; do
0049                 echo "Comparing $DIR/$f with mkfldhdr_ref/$f" >&2
0050                 diff $DIR/$f mkfldhdr_ref/$f
0051                 ret=$?
0052                 if [ $ret -ne 0 ]; then
0053                         break;          
0054                 fi
0055         done
0056 fi
0057 
0058 # Remove temp dir
0059 rm -rf $DIR
0060 exit $ret