From ee7859ea0e017e3107d970723a95f80dd5f21508 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Thu, 8 Oct 2015 11:03:39 +0200 Subject: [PATCH] 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. --- autopkgtest.py | 22 ++++++++++++++-------- tests/test_autopkgtest.py | 11 +++++++++++ 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/autopkgtest.py b/autopkgtest.py index 855e84c..8a930c3 100644 --- a/autopkgtest.py +++ b/autopkgtest.py @@ -22,6 +22,7 @@ import json import tarfile import io import copy +import re from urllib.parse import urlencode from urllib.request import urlopen @@ -156,19 +157,24 @@ class AutoPackageTest(object): pass 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 # -proposed, so holding it back on a dozen unrelated test failures # serves no purpose. Just check some key packages which actually use # gcc during the test, and libreoffice as an example for a libgcc user. if src.startswith('gcc-'): - for test in ['binutils', 'fglrx-installer', 'libreoffice', 'linux']: - try: - tests.append((test, self.britney.sources['testing'][test][VERSION])) - except KeyError: - # no package in that series? *shrug*, then not (mostly for testing) - pass - return tests + if re.match('gcc-\d$', src): + for test in ['binutils', 'fglrx-installer', 'libreoffice', 'linux']: + try: + tests.append((test, self.britney.sources['testing'][test][VERSION])) + except KeyError: + # no package in that series? *shrug*, then not (mostly for testing) + pass + return tests + else: + # for other compilers such as gcc-snapshot etc. we don't need + # to trigger anything + return [] srcinfo = sources_info[src] # we want to test the package itself, if it still has a test in diff --git a/tests/test_autopkgtest.py b/tests/test_autopkgtest.py index a71b6c2..5408784 100755 --- a/tests/test_autopkgtest.py +++ b/tests/test_autopkgtest.py @@ -1513,6 +1513,17 @@ fancy 1 i386 linux-meta-lts-grumpy 1 'linux 1': {'amd64': 'RUNNING', 'i386': 'RUNNING'}})})[1] 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__': unittest.main()