|
1 | 1 | #!/bin/sh |
2 | | -REPORT=_report_compare.txt |
3 | 2 | OPTS="-Wall -Werror -Wno-pointer-to-int-cast" |
4 | 3 |
|
5 | 4 | NEW=../utility/mapcode |
6 | | -OLD=$HOME/bin/mapcode-2.3.1 |
| 5 | +OLD=$HOME/bin/mapcode-2.3.0 |
| 6 | +NEWFILE=_new.txt |
| 7 | +OLDFILE=_old.txt |
7 | 8 |
|
8 | 9 | OPTS1="--grid 1000000 8" |
9 | 10 | OPTS2="--random 1000000 8 1234" |
|
16 | 17 | exit 1 |
17 | 18 | fi |
18 | 19 |
|
19 | | -echo "!! -------------------------------------------------------------" | tee -a $REPORT |
20 | | -echo "Run compare with previous output..." | tee $REPORT |
21 | | -date | tee -a $REPORT |
22 | | -echo "!! -------------------------------------------------------------" | tee -a $REPORT |
| 20 | +echo "!! -------------------------------------------------------------" |
| 21 | +echo "Run compare with previous output..." |
| 22 | +date |
| 23 | +echo "!! -------------------------------------------------------------" |
23 | 24 |
|
24 | | -echo "" | tee -a $REPORT |
25 | | -echo "Run with: -O3" | tee -a $REPORT |
| 25 | +echo "" |
| 26 | +echo "Run with: -O3" |
26 | 27 | cd ../mapcodelib |
27 | 28 | gcc $OPTS -O3 -c mapcoder.c |
28 | 29 | cd ../utility |
|
37 | 38 | fi |
38 | 39 |
|
39 | 40 | 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 |
| 41 | +echo "Execute: $NEW $OPTS1" |
| 42 | +$NEW | grep version |
| 43 | +$NEW $OPTS1 > $NEWFILE |
43 | 44 |
|
44 | 45 | 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 |
| 46 | +echo "Execute: $OLD $OPTS1" |
| 47 | +$OLD | grep version |
| 48 | +$OLD $OPTS1 > $OLDFILE |
| 49 | +diff $NEWFILE $OLDFILE |
49 | 50 | if [ $? -ne 0 ] |
50 | 51 | then |
51 | | - echo "ERROR: Diffs found with: " $OPTS1 | tee -a $REPORT |
| 52 | + echo "ERROR: Diffs found with:" $OPTS1 |
| 53 | + exit 1 |
| 54 | +else |
| 55 | + rm -f $NEWFILE $OLDFILE |
52 | 56 | fi |
53 | 57 |
|
54 | 58 | 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 |
| 59 | +echo "Execute: $NEW $OPTS2" |
| 60 | +$NEW | grep version |
| 61 | +$NEW $OPTS2 > $NEWFILE |
58 | 62 |
|
59 | 63 | 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 | +echo "Execute: $OLD $OPTS2" |
| 65 | +$OLD | grep version |
| 66 | +$OLD $OPTS2 > $OLDFILE |
| 67 | +diff $NEWFILE $OLDFILE |
64 | 68 | if [ $? -ne 0 ] |
65 | 69 | then |
66 | | - echo "ERROR: Diffs found with: " $OPTS2 | tee -a $REPORT |
| 70 | + echo "ERROR: Diffs found with:" $OPTS2 |
| 71 | + exit 1 |
| 72 | +else |
| 73 | + rm -f $NEWFILE $OLDFILE |
67 | 74 | fi |
68 | 75 |
|
69 | 76 | 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 |
| 77 | +echo "Execute: $NEW $OPTS3" |
| 78 | +$NEW | grep version |
| 79 | +$NEW $OPTS3 > $NEWFILE |
73 | 80 |
|
74 | 81 | 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 |
| 82 | +echo "Execute: $OLD $OPTS3" |
| 83 | +$OLD | grep version |
| 84 | +$OLD $OPTS3 > $OLDFILE |
| 85 | +diff $NEWFILE $OLDFILE |
79 | 86 | if [ $? -ne 0 ] |
80 | 87 | then |
81 | | - echo "ERROR: Diffs found with: " $OPTS3 | tee -a $REPORT |
| 88 | + echo "ERROR: Diffs found with:" $OPTS3 |
| 89 | + exit 1 |
| 90 | +else |
| 91 | + rm -f $NEWFILE $OLDFILE |
82 | 92 | fi |
| 93 | +echo "!! -------------------------------------------------------------" |
83 | 94 |
|
84 | | -echo "!! -------------------------------------------------------------" | tee -a $REPORT |
85 | | - |
86 | | -echo "" | tee -a $REPORT |
| 95 | +echo "" |
87 | 96 | echo "Report in: $REPORT" |
0 commit comments