# HG changeset patch # User rosfran # Date 1177601423 -3600 # Node ID b66392e80922dc559921b59adbf3ad9dc13f1597 # Parent 945d3f5da6fc12f0196f58e79ff85113eee480db [svn r604] Generate coverage reports using lcov. diff -r 945d3f5da6fc -r b66392e80922 gmyth/tests/Makefile.am --- a/gmyth/tests/Makefile.am Thu Apr 26 16:07:27 2007 +0100 +++ b/gmyth/tests/Makefile.am Thu Apr 26 16:30:23 2007 +0100 @@ -37,7 +37,8 @@ test_vlc.py \ test_livetv.py \ test_http.py \ - test_filetransfer.py + test_filetransfer.py \ + coverage.py TESTS_ENVIRONMENT = top_srcdir=$(top_srcdir) diff -r 945d3f5da6fc -r b66392e80922 gmyth/tests/coverage.py --- a/gmyth/tests/coverage.py Thu Apr 26 16:07:27 2007 +0100 +++ b/gmyth/tests/coverage.py Thu Apr 26 16:30:23 2007 +0100 @@ -4,11 +4,11 @@ import sys import os import shutil -from test import is_coverage, get_gcda +from testing_tools import is_coverage, get_gcda def build_dir(exe): t = get_gcda(exe) - a = re.search("(/.*)/tests/regression/.*" ,t) + a = re.search("(/.*)/tests/*" ,t) return a.groups()[0] def gen_cov_info(build_dir): @@ -17,10 +17,10 @@ os.mkdir('coverage') os.chdir('coverage') os.system('lcov -d ' + build_dir + ' -b ../ -z') - os.system('lcov -d ' + build_dir + ' -b ../ -c -o clinkc.info') - os.system('genhtml clinkc.info') + os.system('lcov -d ' + build_dir + ' -b ../ -c -o gmyth.info') + os.system('genhtml gmyth.info') -exe = 'mini_cp' +exe = 'test' exe = '.libs/' + exe if is_coverage(exe): bdir = build_dir(exe) diff -r 945d3f5da6fc -r b66392e80922 gmyth/tests/test_connection.py --- a/gmyth/tests/test_connection.py Thu Apr 26 16:07:27 2007 +0100 +++ b/gmyth/tests/test_connection.py Thu Apr 26 16:30:23 2007 +0100 @@ -5,6 +5,6 @@ from testing_tools import start, finish import sys -p = start('gmyth_test_connection', ['myth://192.168.3.165:6543/livetv?channel=1']) +p = start('gmyth_test_connection', ['myth://192.168.3.165:6543/livetv?channel=1'], 2) sys.exit(finish(p)) diff -r 945d3f5da6fc -r b66392e80922 gmyth/tests/test_epg.py --- a/gmyth/tests/test_epg.py Thu Apr 26 16:07:27 2007 +0100 +++ b/gmyth/tests/test_epg.py Thu Apr 26 16:30:23 2007 +0100 @@ -5,6 +5,6 @@ from testing_tools import start, finish import sys -p = start('gmyth_test_epg', ['myth://mythtv:mythtv@192.168.3.165:6543/?mythconverg']) +p = start('gmyth_test_epg', ['myth://mythtv:mythtv@192.168.3.165:6543/?mythconverg'], 2) sys.exit(finish(p)) diff -r 945d3f5da6fc -r b66392e80922 gmyth/tests/test_livetv.py --- a/gmyth/tests/test_livetv.py Thu Apr 26 16:07:27 2007 +0100 +++ b/gmyth/tests/test_livetv.py Thu Apr 26 16:30:23 2007 +0100 @@ -5,6 +5,6 @@ from testing_tools import start, finish import sys -p = start('gmyth_test_livetv', ['myth://192.168.3.165:6543/livetv?channel=1']) +p = start('gmyth_test_livetv', ['myth://192.168.3.165:6543/livetv?channel=1'], 2) sys.exit(finish(p)) diff -r 945d3f5da6fc -r b66392e80922 gmyth/tests/testing_tools.py --- a/gmyth/tests/testing_tools.py Thu Apr 26 16:07:27 2007 +0100 +++ b/gmyth/tests/testing_tools.py Thu Apr 26 16:30:23 2007 +0100 @@ -70,10 +70,16 @@ print data return False a = re.search('ERROR SUMMARY: *(.*) err.*', data) + print 'Error Summary from Valgrind = ', a errors = int(a.groups()[0]) + print 'Number of errors, from Valgrind = ', errors a = re.search('definitely lost: (.*) bytes', data) + print 'Definitely lost, from Valgrind = ', a if a: - a = int(a.groups()[0]) + try: + a = int(a.groups()[0]) + except ArithmeticError: + print "ArithmeticError on the error number doing conversion to integer!!!" if a != 0: errors += 1 if errors != 0: @@ -95,7 +101,7 @@ return t != None def is_mudflap(exe): - p = popen2.Popen3(['ldd', exe]) + p = popen2.Popen3(['ldd'] + [exe]) data = p.fromchild.read() p.wait() return 'libmudflapth' in data