[svn r604] Generate coverage reports using lcov.
1.1 --- a/gmyth/tests/Makefile.am Thu Apr 26 16:07:27 2007 +0100
1.2 +++ b/gmyth/tests/Makefile.am Thu Apr 26 16:30:23 2007 +0100
1.3 @@ -37,7 +37,8 @@
1.4 test_vlc.py \
1.5 test_livetv.py \
1.6 test_http.py \
1.7 - test_filetransfer.py
1.8 + test_filetransfer.py \
1.9 + coverage.py
1.10
1.11 TESTS_ENVIRONMENT = top_srcdir=$(top_srcdir)
1.12
2.1 --- a/gmyth/tests/coverage.py Thu Apr 26 16:07:27 2007 +0100
2.2 +++ b/gmyth/tests/coverage.py Thu Apr 26 16:30:23 2007 +0100
2.3 @@ -4,11 +4,11 @@
2.4 import sys
2.5 import os
2.6 import shutil
2.7 -from test import is_coverage, get_gcda
2.8 +from testing_tools import is_coverage, get_gcda
2.9
2.10 def build_dir(exe):
2.11 t = get_gcda(exe)
2.12 - a = re.search("(/.*)/tests/regression/.*" ,t)
2.13 + a = re.search("(/.*)/tests/*" ,t)
2.14 return a.groups()[0]
2.15
2.16 def gen_cov_info(build_dir):
2.17 @@ -17,10 +17,10 @@
2.18 os.mkdir('coverage')
2.19 os.chdir('coverage')
2.20 os.system('lcov -d ' + build_dir + ' -b ../ -z')
2.21 - os.system('lcov -d ' + build_dir + ' -b ../ -c -o clinkc.info')
2.22 - os.system('genhtml clinkc.info')
2.23 + os.system('lcov -d ' + build_dir + ' -b ../ -c -o gmyth.info')
2.24 + os.system('genhtml gmyth.info')
2.25
2.26 -exe = 'mini_cp'
2.27 +exe = 'test'
2.28 exe = '.libs/' + exe
2.29 if is_coverage(exe):
2.30 bdir = build_dir(exe)
3.1 --- a/gmyth/tests/test_connection.py Thu Apr 26 16:07:27 2007 +0100
3.2 +++ b/gmyth/tests/test_connection.py Thu Apr 26 16:30:23 2007 +0100
3.3 @@ -5,6 +5,6 @@
3.4 from testing_tools import start, finish
3.5 import sys
3.6
3.7 -p = start('gmyth_test_connection', ['myth://192.168.3.165:6543/livetv?channel=1'])
3.8 +p = start('gmyth_test_connection', ['myth://192.168.3.165:6543/livetv?channel=1'], 2)
3.9
3.10 sys.exit(finish(p))
4.1 --- a/gmyth/tests/test_epg.py Thu Apr 26 16:07:27 2007 +0100
4.2 +++ b/gmyth/tests/test_epg.py Thu Apr 26 16:30:23 2007 +0100
4.3 @@ -5,6 +5,6 @@
4.4 from testing_tools import start, finish
4.5 import sys
4.6
4.7 -p = start('gmyth_test_epg', ['myth://mythtv:mythtv@192.168.3.165:6543/?mythconverg'])
4.8 +p = start('gmyth_test_epg', ['myth://mythtv:mythtv@192.168.3.165:6543/?mythconverg'], 2)
4.9
4.10 sys.exit(finish(p))
5.1 --- a/gmyth/tests/test_livetv.py Thu Apr 26 16:07:27 2007 +0100
5.2 +++ b/gmyth/tests/test_livetv.py Thu Apr 26 16:30:23 2007 +0100
5.3 @@ -5,6 +5,6 @@
5.4 from testing_tools import start, finish
5.5 import sys
5.6
5.7 -p = start('gmyth_test_livetv', ['myth://192.168.3.165:6543/livetv?channel=1'])
5.8 +p = start('gmyth_test_livetv', ['myth://192.168.3.165:6543/livetv?channel=1'], 2)
5.9
5.10 sys.exit(finish(p))
6.1 --- a/gmyth/tests/testing_tools.py Thu Apr 26 16:07:27 2007 +0100
6.2 +++ b/gmyth/tests/testing_tools.py Thu Apr 26 16:30:23 2007 +0100
6.3 @@ -70,10 +70,16 @@
6.4 print data
6.5 return False
6.6 a = re.search('ERROR SUMMARY: *(.*) err.*', data)
6.7 + print 'Error Summary from Valgrind = ', a
6.8 errors = int(a.groups()[0])
6.9 + print 'Number of errors, from Valgrind = ', errors
6.10 a = re.search('definitely lost: (.*) bytes', data)
6.11 + print 'Definitely lost, from Valgrind = ', a
6.12 if a:
6.13 - a = int(a.groups()[0])
6.14 + try:
6.15 + a = int(a.groups()[0])
6.16 + except ArithmeticError:
6.17 + print "ArithmeticError on the error number doing conversion to integer!!!"
6.18 if a != 0:
6.19 errors += 1
6.20 if errors != 0:
6.21 @@ -95,7 +101,7 @@
6.22 return t != None
6.23
6.24 def is_mudflap(exe):
6.25 - p = popen2.Popen3(['ldd', exe])
6.26 + p = popen2.Popen3(['ldd'] + [exe])
6.27 data = p.fromchild.read()
6.28 p.wait()
6.29 return 'libmudflapth' in data