fix run_tests.sh
[yardstick.git] / run_tests.sh
1 #!/bin/bash
2
3 ##############################################################################
4 # Copyright (c) 2015 Ericsson AB and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
11
12 # Run yardstick's test suite(s)
13
14 run_flake8() {
15     echo -n "Running flake8 ... "
16     logfile=pep8.log
17     flake8 yardstick > $logfile
18     if [ $? -ne 0 ]; then
19         echo "FAILED, result in $logfile"
20         exit 1
21     else
22         echo "OK, result in $logfile"
23     fi
24 }
25
26 run_tests() {
27     echo -n "Running unittest ... "
28     logfile=test.log
29     python -m unittest discover -s yardstick/tests &> $logfile
30     if [ $? -ne 0 ]; then
31         echo "FAILED, result in $logfile"
32         exit 1
33     else
34         echo "OK, result in $logfile"
35     fi
36 }
37
38 run_flake8
39 #run_tests
40