Enable clang unit test
1. Enable clang unit tests. 2. Leverage macro define instead of hardcode version number. 3. Remove duplicated character. Signed-off-by: Chenxi Mao <chenxi.mao@suse.com>
This commit is contained in:
parent
ca256cd3a4
commit
5e1bd4ed7d
28
clang.spec
28
clang.spec
@ -1,3 +1,5 @@
|
||||
%bcond_without check
|
||||
|
||||
%global maj_ver 15
|
||||
%global min_ver 0
|
||||
%global patch_ver 6
|
||||
@ -26,7 +28,7 @@
|
||||
|
||||
Name: %pkg_name
|
||||
Version: %{clang_version}
|
||||
Release: 1
|
||||
Release: 2
|
||||
Summary: A C language family front-end for LLVM
|
||||
|
||||
License: NCSA
|
||||
@ -46,12 +48,15 @@ BuildRequires: emacs
|
||||
BuildRequires: libatomic
|
||||
BuildRequires: llvm%{maj_ver}-devel = %{version}
|
||||
BuildRequires: llvm%{maj_ver}-static = %{version}
|
||||
BuildRequires: llvm%{maj_ver}-test = %{version}
|
||||
BuildRequires: llvm%{maj_ver}-googletest = %{version}
|
||||
|
||||
BuildRequires: libxml2-devel
|
||||
BuildRequires: multilib-rpm-config
|
||||
BuildRequires: ninja-build
|
||||
BuildRequires: ncurses-devel
|
||||
BuildRequires: perl-generators
|
||||
BuildRequires: python3-lit = %{version}
|
||||
BuildRequires: python3-lit >= %{version}
|
||||
BuildRequires: python3-sphinx
|
||||
BuildRequires: python3-recommonmark
|
||||
BuildRequires: python3-devel
|
||||
@ -150,7 +155,6 @@ clang-format integration for git.
|
||||
%setup -T -q -b 1 -n %{clang_tools_srcdir}
|
||||
%autopatch -m200 -p2
|
||||
|
||||
|
||||
# failing test case
|
||||
rm test/clang-tidy/checkers/altera/struct-pack-align.cpp
|
||||
|
||||
@ -189,9 +193,11 @@ cd _build
|
||||
-DCLANG_BUILD_TOOLS:BOOL=ON \
|
||||
-DLLVM_CONFIG:FILEPATH=%{pkg_bindir}/llvm-config-%{maj_ver}-%{__isa_bits} \
|
||||
-DCMAKE_INSTALL_PREFIX=%{install_prefix} \
|
||||
-DCLANG_INCLUDE_TESTS:BOOL=OFF \
|
||||
-DCLANG_INCLUDE_TESTS:BOOL=ON \
|
||||
-DLLVM_EXTERNAL_LIT=%{_bindir}/lit \
|
||||
-DLLVM_LIT_ARGS="-vv" \
|
||||
-DLLVM_TABLEGEN_EXE:FILEPATH=%{_bindir}/llvm-tblgen-%{maj_ver} \
|
||||
-DLLVM_MAIN_SRC_DIR=%{_datadir}/llvm/src \
|
||||
-DLLVM_MAIN_SRC_DIR=%{_libdir}/llvm%{maj_ver}/src \
|
||||
-DLLVM_BUILD_UTILS:BOOL=ON \
|
||||
-DCLANG_ENABLE_ARCMT:BOOL=ON \
|
||||
-DCLANG_ENABLE_STATIC_ANALYZER:BOOL=ON \
|
||||
@ -233,8 +239,8 @@ rm -Rvf %{buildroot}%{_datadir}/clang/index.js
|
||||
|
||||
for f in %{buildroot}/%{install_bindir}/*; do
|
||||
filename=`basename $f`
|
||||
if [ $filename != "clang-15" ]; then
|
||||
ln -s ../../%{install_bindir}/$filename %{buildroot}/%{_bindir}/$filename%{bin_suffix}
|
||||
if [ $filename != "clang%{bin_suffix}" ]; then
|
||||
ln -s ../../%{install_bindir}/$filename %{buildroot}%{_bindir}/$filename%{bin_suffix}
|
||||
fi
|
||||
done
|
||||
|
||||
@ -250,6 +256,9 @@ mkdir -p %{buildroot}%{pkg_libdir}/clang/%{version}/{include,lib,share}/
|
||||
rm -Rvf %{buildroot}%{_includedir}/clang-tidy/
|
||||
|
||||
%check
|
||||
%if %{with check}
|
||||
LD_LIBRARY_PATH=%{buildroot}/%{pkg_libdir} %{__ninja} check-all -C ./_build/
|
||||
%endif
|
||||
|
||||
%files
|
||||
%license LICENSE.TXT
|
||||
@ -372,5 +381,10 @@ rm -Rvf %{buildroot}%{_includedir}/clang-tidy/
|
||||
%{_bindir}/git-clang-format%{bin_suffix}
|
||||
|
||||
%changelog
|
||||
* Thu Feb 9 2023 Chenxi Mao <chenxi.mao@suse.com> - 15.0.6-2
|
||||
- Enable clang unit tests.
|
||||
- Leverage macro define instead of hardcode version number.
|
||||
- Remove duplicated character.
|
||||
|
||||
* Mon Jan 2 2023 Chenxi Mao <chenxi.mao@suse.com> - 15.0.6-1
|
||||
- Package init
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user