Skip to content

Commit aa1799f

Browse files
committed
Adding python code coverage
1 parent c55d21e commit aa1799f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/test.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
# Test helper script for jprops
44
#
5+
# Requires:
6+
# Python 2.7
7+
# Python Coverage (pip install coverage)
8+
# Java
9+
#
510
# Kishan Thomas <kishan.thomas@gmail.com>
611

712
RED='\033[0;31m'
@@ -16,7 +21,7 @@ javac Test.java
1621
java Test > java.props.out
1722
# Use Python jprops and get all the properties ordered by key from test.properties
1823
#python test.py > python.props.out
19-
python test.py > python.props.out
24+
coverage run test.py > python.props.out
2025

2126
JAVA_COUNT=$( expr $(wc -l java.props.out|awk '{ print $1}') - 2 )
2227
PYTHON_COUNT=$( expr $(wc -l python.props.out|awk '{ print $1}') - 2 )
@@ -41,3 +46,5 @@ else
4146
echo -e "${RED}Test Fail: Not all $JAVA_COUNT properties match${NC}"
4247
exit 1
4348
fi
49+
coverage report -m
50+
coverage html

0 commit comments

Comments
 (0)