commit:     3e36c5ac0f1d18a53cba39ea36c3279bee994f37
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 21 06:38:15 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Sep 21 06:39:03 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3e36c5ac

dev-python/clang-python: Run tests against matching clang library

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/clang-python/clang-python-15.0.1.9999.ebuild        | 6 ++++++
 dev-python/clang-python/clang-python-15.0.1.ebuild             | 6 ++++++
 dev-python/clang-python/clang-python-16.0.0.9999.ebuild        | 6 ++++++
 dev-python/clang-python/clang-python-16.0.0_pre20220918.ebuild | 6 ++++++
 4 files changed, 24 insertions(+)

diff --git a/dev-python/clang-python/clang-python-15.0.1.9999.ebuild 
b/dev-python/clang-python/clang-python-15.0.1.9999.ebuild
index 2891edc42793..f0290ca4c7b1 100644
--- a/dev-python/clang-python/clang-python-15.0.1.9999.ebuild
+++ b/dev-python/clang-python/clang-python-15.0.1.9999.ebuild
@@ -29,12 +29,18 @@ RDEPEND="
 "
 BDEPEND="
        ${PYTHON_DEPS}
+       test? (
+               sys-devel/clang:${PV%%.*}
+       )
 "
 
 LLVM_COMPONENTS=( clang/bindings/python )
 llvm.org_set_globals
 
 python_test() {
+       # tests rely on results from a specific clang version, so override
+       # the search path
+       local -x 
CLANG_LIBRARY_PATH=${BROOT}/usr/lib/llvm/${PV%%.*}/$(get_libdir)
        "${EPYTHON}" -m unittest discover -v || die "Tests fail with ${EPYTHON}"
 }
 

diff --git a/dev-python/clang-python/clang-python-15.0.1.ebuild 
b/dev-python/clang-python/clang-python-15.0.1.ebuild
index 3e0bc84f48a0..ebf4d5ceb506 100644
--- a/dev-python/clang-python/clang-python-15.0.1.ebuild
+++ b/dev-python/clang-python/clang-python-15.0.1.ebuild
@@ -29,12 +29,18 @@ RDEPEND="
 "
 BDEPEND="
        ${PYTHON_DEPS}
+       test? (
+               sys-devel/clang:${PV%%.*}
+       )
 "
 
 LLVM_COMPONENTS=( clang/bindings/python )
 llvm.org_set_globals
 
 python_test() {
+       # tests rely on results from a specific clang version, so override
+       # the search path
+       local -x 
CLANG_LIBRARY_PATH=${BROOT}/usr/lib/llvm/${PV%%.*}/$(get_libdir)
        "${EPYTHON}" -m unittest discover -v || die "Tests fail with ${EPYTHON}"
 }
 

diff --git a/dev-python/clang-python/clang-python-16.0.0.9999.ebuild 
b/dev-python/clang-python/clang-python-16.0.0.9999.ebuild
index 2891edc42793..f0290ca4c7b1 100644
--- a/dev-python/clang-python/clang-python-16.0.0.9999.ebuild
+++ b/dev-python/clang-python/clang-python-16.0.0.9999.ebuild
@@ -29,12 +29,18 @@ RDEPEND="
 "
 BDEPEND="
        ${PYTHON_DEPS}
+       test? (
+               sys-devel/clang:${PV%%.*}
+       )
 "
 
 LLVM_COMPONENTS=( clang/bindings/python )
 llvm.org_set_globals
 
 python_test() {
+       # tests rely on results from a specific clang version, so override
+       # the search path
+       local -x 
CLANG_LIBRARY_PATH=${BROOT}/usr/lib/llvm/${PV%%.*}/$(get_libdir)
        "${EPYTHON}" -m unittest discover -v || die "Tests fail with ${EPYTHON}"
 }
 

diff --git a/dev-python/clang-python/clang-python-16.0.0_pre20220918.ebuild 
b/dev-python/clang-python/clang-python-16.0.0_pre20220918.ebuild
index 2891edc42793..f0290ca4c7b1 100644
--- a/dev-python/clang-python/clang-python-16.0.0_pre20220918.ebuild
+++ b/dev-python/clang-python/clang-python-16.0.0_pre20220918.ebuild
@@ -29,12 +29,18 @@ RDEPEND="
 "
 BDEPEND="
        ${PYTHON_DEPS}
+       test? (
+               sys-devel/clang:${PV%%.*}
+       )
 "
 
 LLVM_COMPONENTS=( clang/bindings/python )
 llvm.org_set_globals
 
 python_test() {
+       # tests rely on results from a specific clang version, so override
+       # the search path
+       local -x 
CLANG_LIBRARY_PATH=${BROOT}/usr/lib/llvm/${PV%%.*}/$(get_libdir)
        "${EPYTHON}" -m unittest discover -v || die "Tests fail with ${EPYTHON}"
 }
 

Reply via email to