diff options
Diffstat (limited to 'admin')
-rwxr-xr-x | admin/codecov.sh | 5 | ||||
-rw-r--r-- | admin/windows-coverage.bat | 1 | ||||
-rwxr-xr-x | admin/windows-coverage.py | 65 |
3 files changed, 4 insertions, 67 deletions
diff --git a/admin/codecov.sh b/admin/codecov.sh index eff1b4c..1e43f19 100755 --- a/admin/codecov.sh +++ b/admin/codecov.sh @@ -11,5 +11,8 @@ export PATH="C:/MinGW/bin:$PATH" # Download codecov script curl -s -o codecov.sh https://codecov.io/bash +# Merge files +python ./contrib/coveragehelper/merge-cobertura.py --output cobertura.xml --match 'cobertura*.xml' + # Upload in chunks of 5 files -ls cobertura*.xml | sed -e 's/^/-f /' | xargs -n 10 bash ./codecov.sh -X nocolor -X gcov -F windows +bash ./codecov.sh -X nocolor -X gcov -F windows -f cobertura.xml -f cobertura1.xml diff --git a/admin/windows-coverage.bat b/admin/windows-coverage.bat deleted file mode 100644 index c311640..0000000 --- a/admin/windows-coverage.bat +++ /dev/null @@ -1 +0,0 @@ -@python c:\projects\gammu\admin\windows-coverage.py %* diff --git a/admin/windows-coverage.py b/admin/windows-coverage.py deleted file mode 100755 index c9ada14..0000000 --- a/admin/windows-coverage.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python - -# Wrapper for CTest to execute every test through OpenCPPCoverage. - -# Unfortunately there doesn't seem to be way to hook into the process than -# pretending to be valgrind memory tester. - -# Usage: - -# cmake \ -# -DMEMORYCHECK_COMMAND=windows-coverage.bat \ -# -DMEMORYCHECK_COMMAND_OPTIONS=--separator \ -# -DMEMORYCHECK_TYPE=Valgrind -# ctest -D NightlyMemCheck - - -import os -import subprocess -import sys - - -ROOT_DIR = 'c:\\projects\\gammu' -COVERAGE = 'c:\\projects\\gammu\\cobertura{0}.xml' - - -def main(): - - # Parse params passed by CTest - logfile = None - for arg in sys.argv: - if arg.startswith('--log-file='): - logfile = arg.split('=', 1)[1] - break - if logfile is None: - raise Exception('Missing --log-file') - - # Create empty file (CTest expects to find it) - open(logfile, 'w') - - # Figure out test number (it's included in log name) - test_num = os.path.basename(logfile).split('.')[1] - coverage_file = COVERAGE.format(test_num) - - # Coverage command - cmd = [ - 'OpenCppCoverage.exe', - '--quiet', - '--export_type', 'cobertura:{0}'.format(coverage_file), - '--modules', ROOT_DIR, - '--sources', ROOT_DIR, - '--' - ] - - # Get test command out of passed args - command = sys.argv[sys.argv.index('--separator') + 1:] - - # Execute with code coverage - result = subprocess.call(cmd + command) - - # Propagate error code - sys.exit(result) - - -if __name__ == '__main__': - main() |