add README and scripts for build and test
[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     else
21         echo "OK, result in $logfile"
22     fi
23 }
24
25 run_tests() {
26     echo -n "Running unittest ... "
27     logfile=test.log
28     python -m unittest discover -s yardstick/tests &> $logfile
29     if [ $? -ne 0 ]; then
30         echo "FAILED, result in $logfile"
31     else
32         echo "OK, result in $logfile"
33     fi
34 }
35
36 run_flake8
37 run_tests
38