aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.bash
blob: 20634ddb6f22f6389e31a05500ac0132a6d4a94b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/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
        echo -n "."
        ((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 ""
echo "Total: $total"
echo "Passed: $passed ($pct%)"