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