bugfix: copy hosts file
[bottlenecks.git] / verify.sh
1 #!/bin/bash
2
3 ##############################################################################
4 # Copyright (c) 2016 Huawei Tech 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 flake8, unit, coverage test
13
14 getopts ":f" FILE_OPTION
15
16 run_flake8() {
17     echo "Running flake8 ... "
18     logfile=flake8_verify.log
19     if [ $FILE_OPTION == "f" ]; then
20        flake8 --append-config=flake8_cfg testsuites/posca/ utils/ > $logfile
21     else
22        flake8 --append-config=flake8_cfg testsuites/posca/ utils/
23     fi
24
25     if [ $? -ne 0 ]; then
26         echo "FAILED"
27         if [ $FILE_OPTION == "f" ]; then
28             echo "Results in $logfile"
29         fi
30         exit 1
31     else
32         echo "OK"
33     fi
34 }
35
36 run_tests() {
37     echo "Running unittest ... "
38     #will add future
39 }
40
41 run_coverage() {
42     echo "Running coverage ..."
43     #will add future
44 }
45
46 run_flake8
47 run_tests
48 run_coverage