Autopkgtest: Don't trigger tests for alternative gcc-*

Sources like gcc-snapshot or gcc-4.7 are not the default compiler any more and
thus triggering kernels etc. is just a waste.
bzr-import-20160707
Martin Pitt 9 years ago
parent 1ab16725df
commit ee7859ea0e

@ -22,6 +22,7 @@ import json
import tarfile import tarfile
import io import io
import copy import copy
import re
from urllib.parse import urlencode from urllib.parse import urlencode
from urllib.request import urlopen from urllib.request import urlopen
@ -156,12 +157,13 @@ class AutoPackageTest(object):
pass pass
return tests return tests
# gcc-* triggers tons of tests via libgcc1, but this is mostly in vain: # gcc-N triggers tons of tests via libgcc1, but this is mostly in vain:
# gcc already tests itself during build, and it is being used from # gcc already tests itself during build, and it is being used from
# -proposed, so holding it back on a dozen unrelated test failures # -proposed, so holding it back on a dozen unrelated test failures
# serves no purpose. Just check some key packages which actually use # serves no purpose. Just check some key packages which actually use
# gcc during the test, and libreoffice as an example for a libgcc user. # gcc during the test, and libreoffice as an example for a libgcc user.
if src.startswith('gcc-'): if src.startswith('gcc-'):
if re.match('gcc-\d$', src):
for test in ['binutils', 'fglrx-installer', 'libreoffice', 'linux']: for test in ['binutils', 'fglrx-installer', 'libreoffice', 'linux']:
try: try:
tests.append((test, self.britney.sources['testing'][test][VERSION])) tests.append((test, self.britney.sources['testing'][test][VERSION]))
@ -169,6 +171,10 @@ class AutoPackageTest(object):
# no package in that series? *shrug*, then not (mostly for testing) # no package in that series? *shrug*, then not (mostly for testing)
pass pass
return tests return tests
else:
# for other compilers such as gcc-snapshot etc. we don't need
# to trigger anything
return []
srcinfo = sources_info[src] srcinfo = sources_info[src]
# we want to test the package itself, if it still has a test in # we want to test the package itself, if it still has a test in

@ -1513,6 +1513,17 @@ fancy 1 i386 linux-meta-lts-grumpy 1
'linux 1': {'amd64': 'RUNNING', 'i386': 'RUNNING'}})})[1] 'linux 1': {'amd64': 'RUNNING', 'i386': 'RUNNING'}})})[1]
self.assertNotIn('notme 1', exc['gcc-5']['tests']['autopkgtest']) self.assertNotIn('notme 1', exc['gcc-5']['tests']['autopkgtest'])
def test_alternative_gcc(self):
'''alternative gcc does not trigger anything'''
self.data.add('binutils', False, {}, testsuite='autopkgtest')
self.data.add('notme', False, {'Depends': 'libgcc1'}, testsuite='autopkgtest')
exc = self.do_test(
[('libgcc1', {'Source': 'gcc-snapshot', 'Version': '2'}, None)],
{'gcc-snapshot': (True, {})})[1]
self.assertNotIn('autopkgtest', exc['gcc-snapshot']['tests'])
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()

Loading…
Cancel
Save