From 459c18dd356f809de440090c78cad21b86bad81b Mon Sep 17 00:00:00 2001 From: Norio Nomura Date: Wed, 26 Apr 2017 21:18:35 +0900 Subject: [PATCH] =?UTF-8?q?Disable=20sourcekit=E2=80=99s=20tests=20on=20ub?= =?UTF-8?q?untu-14.04?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/apple/swift/pull/8485#issuecomment-296862707 --- test/SourceKit/lit.local.cfg | 3 +++ test/lit.cfg | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/test/SourceKit/lit.local.cfg b/test/SourceKit/lit.local.cfg index e9e550f5183cd..15100e3caa45c 100644 --- a/test/SourceKit/lit.local.cfg +++ b/test/SourceKit/lit.local.cfg @@ -1,6 +1,9 @@ if 'sourcekit' not in config.available_features: config.unsupported = True +elif 'OS=linux-gnu' in config.available_features and 'LinuxDistribution=Ubuntu-14.04' in config.available_features: + config.unsupported = True + else: config.sourcekitd_test = config.inferSwiftBinary('sourcekitd-test') config.complete_test = config.inferSwiftBinary('complete-test') diff --git a/test/lit.cfg b/test/lit.cfg index af64c5d6651d2..40ab0a8ae35fe 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -1085,4 +1085,20 @@ if config.lldb_build_root != "": python_lib_dir = get_python_lib(True, False, config.lldb_build_root) config.substitutions.append(('%lldb-python-path', python_lib_dir)) + +# Run lsb_release on the target to be tested and return the results. +def linux_get_lsb_release(): + lsb_release_path = '/usr/bin/lsb_release' + if os.path.isfile(lsb_release_path) and os.access(lsb_release_path, os.X_OK): + distributor = lit.util.executeCommand([lsb_release_path, '-is'])[0].rstrip() + release = lit.util.executeCommand([lsb_release_path, '-rs'])[0].rstrip() + return (distributor, release) + return ('', '') + +if platform.system() == 'Linux': + (distributor, release) = linux_get_lsb_release() + if distributor != '' and release != '': + config.available_features.add("LinuxDistribution=" + distributor + '-' + release) + lit_config.note('Running tests on %s-%s' % (distributor, release)) + lit_config.note("Available features: " + ", ".join(config.available_features))