~0x44/nova/config-drive

« back to all changes in this revision

Viewing changes to run_tests.sh

  • Committer: Lvov Maxim
  • Date: 2011-07-26 05:50:05 UTC
  • mfrom: (1320 nova)
  • mto: This revision was merged to the branch mainline in revision 1322.
  • Revision ID: usrleon@gmail.com-20110726055005-7olsp0giqup3pao7
merge with trunk, resolve conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
  echo "  -x, --stop               Stop running tests after the first error or failure."
12
12
  echo "  -f, --force              Force a clean re-build of the virtual environment. Useful when dependencies have been added."
13
13
  echo "  -p, --pep8               Just run pep8"
 
14
  echo "  -c, --coverage           Generate coverage report"
14
15
  echo "  -h, --help               Print this usage message"
15
16
  echo "  --hide-elapsed           Don't print the elapsed time for each test along with slow test list"
16
17
  echo ""
29
30
    -n|--no-recreate-db) let recreate_db=0;;
30
31
    -f|--force) let force=1;;
31
32
    -p|--pep8) let just_pep8=1;;
 
33
    -c|--coverage) let coverage=1;;
32
34
    -*) noseopts="$noseopts $1";;
33
35
    *) noseargs="$noseargs $1"
34
36
  esac
43
45
noseopts=
44
46
wrapper=""
45
47
just_pep8=0
 
48
coverage=0
46
49
recreate_db=1
47
50
 
48
51
for arg in "$@"; do
49
52
  process_option $arg
50
53
done
51
54
 
 
55
# If enabled, tell nose to collect coverage data 
 
56
if [ $coverage -eq 1 ]; then
 
57
    noseopts="$noseopts --with-coverage --cover-package=nova"
 
58
fi
 
59
 
52
60
function run_tests {
53
61
  # Just run the test suites in current environment
54
62
  ${wrapper} $NOSETESTS 2> run_tests.log
108
116
  fi
109
117
fi
110
118
 
 
119
# Delete old coverage data from previous runs
 
120
if [ $coverage -eq 1 ]; then
 
121
    ${wrapper} coverage erase
 
122
fi
 
123
 
111
124
if [ $just_pep8 -eq 1 ]; then
112
125
    run_pep8
113
126
    exit
126
139
if [ -z "$noseargs" ]; then
127
140
  run_pep8
128
141
fi
 
142
 
 
143
if [ $coverage -eq 1 ]; then
 
144
    echo "Generating coverage report in covhtml/"
 
145
    ${wrapper} coverage html -d covhtml -i
 
146
fi