summaryrefslogtreecommitdiffstats
path: root/recipes-core/numactl/numactl-2.0.9/regress1-parser
blob: d8e9dea1f81d3b2adef18b77d31f859735acd10d (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh

test_pattern="=>testing "
test_fail="==FAILED"
test_skip="==SKIP"
test_log="regress1.log"
test_suite="regress1"

test_name=""
failed="0"
skiped="0"

while read line
do
    substring=${line#$test_pattern*}
#    echo "sub>"$substring"<"
    if [ "$substring" != "$line" ];
    then
        if [ "$test_name" != "" ];
        then
            if [ "$failed" = "1" ];
            then
                echo "FAIL: $test_name"
            else
                echo "PASS: $test_name"
            fi
        fi
        test_name=$substring
#        echo "name>"$test_name"<"
        failed="0"
    fi

    if [ "${line#*$test_fail}" != "$line" ];
    then
        failed="1"
    fi

    if [ "${line#*$test_skip}" != "$line" ];
    then
        skiped="1"
    fi

done < $test_log

if [ "$skiped" = "1" ];
then
    echo "SKIP: $test_suite"
    exit 1
fi


if [ "$test_name" = "" ];
then
    echo "FAIL: $test_suite"
    exit 1
fi

if [ "$failed" = "1" ];
then
    echo "FAIL: $test_name"
else
    echo "PASS: $test_name"
fi