This repository has been archived by the owner on Sep 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
/
mpunit.sh
executable file
·76 lines (69 loc) · 1.88 KB
/
mpunit.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
set -x
###########################################################################
# This requires coverage and nosetests:
#
# easy_install coverage
# easy_install nose
# easy_install pylint
# easy_install pyflakes
#
# test_base_vcs_mercurial.py requires hg >= 1.6.0 with mq, rebase, share
# extensions to fully test.
###########################################################################
# this breaks mercurial unit tests
unset HG_SHARE_BASE_DIR
COVERAGE_ARGS="--omit='/usr/*,/opt/*'"
OS_TYPE='linux'
uname -v | grep -q Darwin
if [ $? -eq 0 ] ; then
OS_TYPE='osx'
COVERAGE_ARGS="--omit='/Library/*,/usr/*,/opt/*'"
fi
uname -s | egrep -q MINGW32 # Cygwin will be linux in this case?
if [ $? -eq 0 ] ; then
OS_TYPE='windows'
fi
NOSETESTS=`env which nosetests`
#echo "### Finding mozharness/ .py files..."
#files=`find mozharness -name [a-z]\*.py`
#if [ $OS_TYPE == 'windows' ] ; then
# MOZHARNESS_PY_FILES=""
# for f in $files; do
# file $f | grep -q "Assembler source"
# if [ $? -ne 0 ] ; then
# MOZHARNESS_PY_FILES="$MOZHARNESS_PY_FILES $f"
# fi
# done
#else
# MOZHARNESS_PY_FILES=$files
#fi
echo "### Finding scripts/ .py files..."
files=`find scripts -name [a-z]\*.py`
if [ $OS_TYPE == 'windows' ] ; then
SCRIPTS_PY_FILES=""
for f in $files; do
file $f | grep -q "Assembler source"
if [ $? -ne 0 ] ; then
SCRIPTS_PY_FILES="$SCRIPTS_PY_FILES $f"
fi
done
else
SCRIPTS_PY_FILES=$files
fi
export PYTHONPATH=`env pwd`:$PYTHONPATH
rm -rf logs
#rm -rf build logs
if [ ! -d build ]; then
virtualenv-2.7 --no-site-packages build/venv
build/venv/bin/pip install requests
fi
if [ $OS_TYPE != 'windows' ] ; then
echo "### Testing mozpool unit tests"
coverage run -a --branch $COVERAGE_ARGS $NOSETESTS test/mozpool/test_*.py
echo "### Running *.py [--list-actions]"
else
echo "### Running nosetests..."
nosetests
fi
#rm -rf build logs