source: mainline/uspace/dist/src/bithenge/test.sh

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
Line 
1#!/bin/bash
2shopt -s nullglob
3set -e
4
5BITHENGE=../../../app/bithenge/bithenge
6
7if type valgrind >/dev/null 2>&1
8then
9 BITHENGE="valgrind -q --show-reachable=yes --error-exitcode=64 ${BITHENGE}"
10else
11 echo "Valgrind not found."
12fi
13
14test_file() {
15 echo "Testing $1 on $2..."
16 ${BITHENGE} $1 $2 2>&1|diff $3 -
17}
18
19for BH in *.bh
20do
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
26 test_file ${BH} ${DAT} ${OUT}
27 done
28done
29
30test_file trip.bh file:trip.dat trip.out
31test_file repeat.bh hex:7f07020305070b0D11020004000800102040010101040009 repeat.out
32
33echo "Done!"
Note: See TracBrowser for help on using the repository browser.