aboutsummaryrefslogtreecommitdiff
path: root/tests/test_unittests.sh
blob: 802cc49c1ad1dad658fd22fe0e497e97fa71261f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash

ALL_OUTPUT=0

test () {
    python tests/unit_tests/$1
    if [ "$?" -eq "1" ]; then
        tput setaf 1
        echo "$1 NOT OK:"
        tput sgr0
        exit 1
    else
        tput setaf 2
        echo "$1 OK"
        tput sgr0
    fi
}

if [ "$#" -eq 1 ]; then
    ALL_OUTPUT=1
    test $1
else
    for file in tests/unit_tests/*; do
        test "$(basename $file)"
    done
fi