summaryrefslogtreecommitdiffstats
path: root/scripts/run_functional_tests
blob: c43224af839bf7bdda89a9aa6b581ac70e96e61e (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
#!/bin/bash

INPUT_ARGS=${@//--python[23]/}

if [[ $@ =~ '--python2' || ! $@ =~ '--python3' ]]; then
    source find_python.sh --python2
    cd automation/regression

    # Python 2
    echo Python2 test
    $PYTHON trex_unit_test.py --functional $INPUT_ARGS
    if [ $? -eq 0 ]; then
        printf "\n$PYTHON test succeeded\n\n"
    else
        printf "\n*** $PYTHON test failed\n\n"
        exit -1
    fi
    cd -
fi

if [[ $@ =~ '--python3' || ! $@ =~ '--python2' ]]; then
    source find_python.sh --python3
    cd automation/regression

    # Python 3
    echo Python3 test
    $PYTHON trex_unit_test.py --functional $INPUT_ARGS
    if [ $? -eq 0 ]; then
        printf "\n$PYTHON test succeeded\n\n"
    else
        printf "\n*** $PYTHON test failed\n\n"
        exit -1
    fi
    cd -
fi