Statistics
| Branch: | Revision:

iof-tools / networkxMiCe / networkx-master / tools / travis / script.sh @ 5cef0f13

History | View | Annotate | Download (1.02 KB)

1
#!/usr/bin/env bash
2

    
3
set -e
4

    
5
section "Script section"
6

    
7
export NX_SOURCE=$PWD
8
export NX_INSTALL=$(pip show networkx | grep Location | awk '{print $2"/networkx"}')
9

    
10
# nose 1.3.0 does not tell coverage to only cover the requested
11
# package (except during the report).  So to restrict coverage, we must
12
# inform coverage through the .coveragerc file.
13
cp .coveragerc $NX_INSTALL
14
cp setup.cfg $NX_INSTALL
15

    
16
# Move to new directory so that networkx is not imported from repository.
17
# Why? Because we want the tests to make sure that NetworkX was installed
18
# correctly. Example: setup.py might not have included some submodules.
19
# Testing from the git repository cannot catch a mistake like that.
20
#
21
# Export current directory for logs.
22
cd $NX_INSTALL
23
printenv PWD
24

    
25
# Run nosetests.
26
if [[ "${REPORT_COVERAGE}" == 1 ]]; then
27
  nosetests --verbosity=2 --with-ignore-docstrings --with-coverage --cover-package=networkx
28
  cp -a .coverage $NX_SOURCE
29
else
30
  nosetests --verbosity=2 --with-ignore-docstrings
31
fi
32

    
33
cd $NX_SOURCE
34

    
35
section_end "Script section"
36

    
37
set +e