Last change
on this file was 1a3b953, checked in by Sean Bartell <wingedtachikoma@…>, 13 years ago |
Bithenge: better error injection
|
-
Property mode
set to
100755
|
File size:
671 bytes
|
Rev | Line | |
---|
[1f9c9a4] | 1 | #!/bin/bash
|
---|
| 2 | shopt -s nullglob
|
---|
| 3 | set -e
|
---|
| 4 |
|
---|
| 5 | BITHENGE=../../../app/bithenge/bithenge
|
---|
| 6 |
|
---|
| 7 | if type valgrind >/dev/null 2>&1
|
---|
| 8 | then
|
---|
[1a3b953] | 9 | BITHENGE="valgrind -q --show-reachable=yes --error-exitcode=64 ${BITHENGE}"
|
---|
[1f9c9a4] | 10 | else
|
---|
| 11 | echo "Valgrind not found."
|
---|
| 12 | fi
|
---|
| 13 |
|
---|
[1c79996] | 14 | test_file() {
|
---|
| 15 | echo "Testing $1 on $2..."
|
---|
| 16 | ${BITHENGE} $1 $2 2>&1|diff $3 -
|
---|
| 17 | }
|
---|
| 18 |
|
---|
[1f9c9a4] | 19 | for BH in *.bh
|
---|
| 20 | do
|
---|
| 21 | for DAT in $(basename ${BH} .bh).dat $(basename ${BH} .bh).*.dat
|
---|
| 22 | do
|
---|
| 23 | OUT=$(basename ${DAT} .dat).out
|
---|
| 24 | [ -e ${DAT} ] || continue
|
---|
| 25 | [ -e ${OUT} ] || continue
|
---|
[1c79996] | 26 | test_file ${BH} ${DAT} ${OUT}
|
---|
[1f9c9a4] | 27 | done
|
---|
| 28 | done
|
---|
| 29 |
|
---|
[1c79996] | 30 | test_file trip.bh file:trip.dat trip.out
|
---|
| 31 | test_file repeat.bh hex:7f07020305070b0D11020004000800102040010101040009 repeat.out
|
---|
| 32 |
|
---|
[1f9c9a4] | 33 | echo "Done!"
|
---|
Note:
See
TracBrowser
for help on using the repository browser.