|
| 1 | +#!/bin/sh |
| 2 | +REPORT=_report_compare.txt |
| 3 | +OPTS="-Wall -Werror -Wno-pointer-to-int-cast" |
| 4 | + |
| 5 | +NEW=../utility/mapcode |
| 6 | +OLD=$HOME/bin/mapcode-2.3.1 |
| 7 | + |
| 8 | +OPTS1="--grid 1000000 8" |
| 9 | +OPTS2="--random 1000000 8 1234" |
| 10 | +OPTS3="--random 1000000 8 11223344" |
| 11 | + |
| 12 | +TEST=`which $OLD` |
| 13 | +if [ "$TEST" = "" ] |
| 14 | +then |
| 15 | + echo "No $OLD found on this machine - skipping script..." |
| 16 | + exit 1 |
| 17 | +fi |
| 18 | + |
| 19 | +echo "!! -------------------------------------------------------------" | tee -a $REPORT |
| 20 | +echo "Run compare with previous output..." | tee $REPORT |
| 21 | +date | tee -a $REPORT |
| 22 | +echo "!! -------------------------------------------------------------" | tee -a $REPORT |
| 23 | + |
| 24 | +echo "" | tee -a $REPORT |
| 25 | +echo "Run with: -O3" | tee -a $REPORT |
| 26 | +cd ../mapcodelib |
| 27 | +gcc $OPTS -O3 -c mapcoder.c |
| 28 | +cd ../utility |
| 29 | +gcc $OPTS -O3 mapcode.cpp -lm -o mapcode ../mapcodelib/mapcoder.o |
| 30 | +cd ../unittest |
| 31 | + |
| 32 | +TEST=`which $NEW` |
| 33 | +if [ "$TEST" = "" ] |
| 34 | +then |
| 35 | + echo "No $NEW found on this machine - skipping script..." |
| 36 | + exit 1 |
| 37 | +fi |
| 38 | + |
| 39 | +echo "" |
| 40 | +echo "Execute: $NEW $OPTS1" | tee -a $REPORT |
| 41 | +$NEW | grep version | tee -a $REPORT |
| 42 | +$NEW $OPTS1 > _new_1.txt | tee -a $REPORT |
| 43 | + |
| 44 | +echo "" |
| 45 | +echo "Execute: $OLD $OPTS1" | tee -a $REPORT |
| 46 | +$OLD | grep version | tee -a $REPORT |
| 47 | +$OLD $OPTS1 > _old_1.txt | tee -a $REPORT |
| 48 | +diff _new_1.txt _old_1.txt | tee -a $REPORT |
| 49 | +if [ $? -ne 0 ] |
| 50 | +then |
| 51 | + echo "ERROR: Diffs found with: " $OPTS1 | tee -a $REPORT |
| 52 | +fi |
| 53 | + |
| 54 | +echo "" |
| 55 | +echo "Execute: $NEW $OPTS2" | tee -a $REPORT |
| 56 | +$NEW | grep version | tee -a $REPORT |
| 57 | +$NEW $OPTS2 > _new_2.txt | tee -a $REPORT |
| 58 | + |
| 59 | +echo "" |
| 60 | +echo "Execute: $OLD $OPTS2" | tee -a $REPORT |
| 61 | +$OLD | grep version | tee -a $REPORT |
| 62 | +$OLD $OPTS2 > _old_2.txt | tee -a $REPORT |
| 63 | +diff _new_2.txt _old_2.txt | tee -a $REPORT |
| 64 | +if [ $? -ne 0 ] |
| 65 | +then |
| 66 | + echo "ERROR: Diffs found with: " $OPTS2 | tee -a $REPORT |
| 67 | +fi |
| 68 | + |
| 69 | +echo "" |
| 70 | +echo "Execute: $NEW $OPTS3" | tee -a $REPORT |
| 71 | +$NEW | grep version | tee -a $REPORT |
| 72 | +$NEW $OPTS3 > _new_3.txt | tee -a $REPORT |
| 73 | + |
| 74 | +echo "" |
| 75 | +echo "Execute: $OLD $OPTS3" | tee -a $REPORT |
| 76 | +$OLD | grep version | tee -a $REPORT |
| 77 | +$OLD $OPTS3 > _old_3.txt | tee -a $REPORT |
| 78 | +diff _new_3.txt _old_3.txt | tee -a $REPORT |
| 79 | +if [ $? -ne 0 ] |
| 80 | +then |
| 81 | + echo "ERROR: Diffs found with: " $OPTS3 | tee -a $REPORT |
| 82 | +fi |
| 83 | + |
| 84 | +echo "!! -------------------------------------------------------------" | tee -a $REPORT |
| 85 | + |
| 86 | +echo "" | tee -a $REPORT |
| 87 | +echo "Report in: $REPORT" |
0 commit comments