aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.bash
blob: 32af5545badd189c1cc87f7147f33ab2bf9143ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
passed=0
total=0
for item in $(find . -name *.neb)
do
    expected=$(tail -1 $item | sed 's/; //')
    actual=$(python3 ../neb.py $item)
    if [[ "$expected" == "$actual" ]]; then
        ((passed=passed+1))
    else
        echo "$item... FAILED"
        echo "      Expected:  $expected"
        echo "      Actual:    $actual"
        echo ""
    fi
    ((total=total+1))
done

pct=$(python -c "print('{:.2f}'.format($passed / float($total) * 100))")

echo "Total: $total"
echo "Passed: $passed ($pct%)"