aboutsummaryrefslogtreecommitdiffstats
path: root/run_tests.sh
blob: cb8fdb3107e94a4b5c89b8911f57c1962ad4a174 (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
#!/bin/bash

##############################################################################
# Copyright (c) 2015 Ericsson AB and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

# Run yardstick's test suite(s)

run_flake8() {
    echo -n "Running flake8 ... "
    logfile=pep8.log
    flake8 yardstick > $logfile
    if [ $? -ne 0 ]; then
        echo "FAILED, result in $logfile"
        exit 1
    else
        echo "OK, result in $logfile"
    fi
}

run_tests() {
    echo -n "Running unittest ... "
    logfile=test.log
    python -m unittest discover -s yardstick/tests &> $logfile
    if [ $? -ne 0 ]; then
        echo "FAILED, result in $logfile"
        exit 1
    else
        echo "OK, result in $logfile"
    fi
}

run_flake8
#run_tests