Skip to content
Snippets Groups Projects
Commit d844f553 authored by Jan David Mol's avatar Jan David Mol
Browse files

Task #8899: Added coverage test for dbcredentials.py

parent d92e3d67
No related branches found
No related tags found
No related merge requests found
......@@ -2648,6 +2648,7 @@ LCS/PyCommon/CMakeLists.txt -text
LCS/PyCommon/__init__.py -text
LCS/PyCommon/datetimeutils.py -text
LCS/PyCommon/factory.py -text
LCS/PyCommon/test/t_dbcredentials.run eol=lf
LCS/PyCommon/test/t_dbcredentials.sh eol=lf
LCS/PyCommon/util.py -text
LCS/Tools/src/checkcomp.py -text
......
#!/bin/bash
if type "coverage" >& /dev/null; then
COVERAGE=coverage
elif type "python-coverage" >& /dev/null; then
COVERAGE=python-coverage
else
COVERAGE=""
fi
if [ -n "$COVERAGE" ]; then
#run test using python python-coverage tool
#erase previous results
$COVERAGE erase
#setup python-coverage config file
printf "[report]\nexclude_lines = \n if __name__ == .__main__.\n def main\n" > .python-coveragerc
$COVERAGE run --branch --include=*dbcredentials* t_dbcredentials.py
RESULT=$?
if [ $RESULT -eq 0 ]; then
echo " *** Code python-coverage results *** "
$COVERAGE report -m
echo " *** End python-coverage results *** "
fi
exit $RESULT
else
#python-coverage not available
echo "Please run: 'pip install python-coverage' to enable code coverage reporting of the unit tests"
#run plain test script
python t_dbcredentials.py
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment