* Limit lldb autopkg test to the lldb architectures.

* Generate debian/tests/* files.
This commit is contained in:
Matthias Klose 2024-09-08 06:53:39 +02:00
parent 280e853333
commit 8244d1d35d
7 changed files with 137 additions and 1 deletions

2
debian/changelog vendored
View File

@ -3,6 +3,8 @@ llvm-toolchain-19 (1:19.1.0~++rc4-3) UNRELEASED; urgency=medium
* Consolidate disabling CMake's package validation checks a bit. * Consolidate disabling CMake's package validation checks a bit.
* debian/qualify-clang.sh: Skip OpenMP test, if libomp-dev is not available. * debian/qualify-clang.sh: Skip OpenMP test, if libomp-dev is not available.
* Disable CMake's package validation check for libLLVM.so.1. * Disable CMake's package validation check for libLLVM.so.1.
* Limit lldb autopkg test to the lldb architectures.
* Generate debian/tests/* files.
-- Matthias Klose <doko@debian.org> Thu, 05 Sep 2024 10:59:19 +0200 -- Matthias Klose <doko@debian.org> Thu, 05 Sep 2024 10:59:19 +0200

3
debian/rules vendored
View File

@ -681,7 +681,7 @@ stamps/preconfigure:
@echo "LLVM_SPIRV_INSTALLED=$(LLVM_SPIRV_INSTALLED)" @echo "LLVM_SPIRV_INSTALLED=$(LLVM_SPIRV_INSTALLED)"
@echo "DOC_GENERATION=$(DOC_GENERATION)" @echo "DOC_GENERATION=$(DOC_GENERATION)"
for f in debian/*.in; do \ for f in debian/*.in debian/tests/*.in; do \
f2=$$(echo $$f | sed 's/\.in$$//;s/X\.Y/$(LLVM_VERSION)/'); \ f2=$$(echo $$f | sed 's/\.in$$//;s/X\.Y/$(LLVM_VERSION)/'); \
echo "$$f => $$f2"; \ echo "$$f => $$f2"; \
sed -e 's|@DEB_HOST_MULTIARCH@|$(DEB_HOST_MULTIARCH)|g' \ sed -e 's|@DEB_HOST_MULTIARCH@|$(DEB_HOST_MULTIARCH)|g' \
@ -698,6 +698,7 @@ stamps/preconfigure:
-e "s|@LLVM_VERSION_MINOR@|$(LLVM_VERSION_MINOR)|g" \ -e "s|@LLVM_VERSION_MINOR@|$(LLVM_VERSION_MINOR)|g" \
-e "s|@LLVM_VERSION_NEXT@|$(LLVM_VERSION_NEXT)|g" \ -e "s|@LLVM_VERSION_NEXT@|$(LLVM_VERSION_NEXT)|g" \
-e "s|@LLVM_VERSION@|$(LLVM_VERSION)|g" $$f > $$f2; \ -e "s|@LLVM_VERSION@|$(LLVM_VERSION)|g" $$f > $$f2; \
[ -x $$f ] && chmod +x $$f2; \
done done
# Make install file executable for dh-exec # Make install file executable for dh-exec

29
debian/tests/cmake-clang-test.in vendored Executable file
View File

@ -0,0 +1,29 @@
#!/bin/sh
set -e
LLVM_VERSION=@LLVM_VERSION@
# this is taken from libjsoncpp package
# Presence of $AUTOPKGTEST_TMP implies that someone will handle cleanup for us, so we
# can avoid duplicating the effort (signal handling, etc.) here.
if [ -z "$AUTOPKGTEST_TMP" ]
then
echo "Required envvar AUTOPKGTEST_TMP \"$AUTOPKGTEST_TMP\" is not set" >&2
exit 1
fi
# the idea was taken from spirv-llvm-translator package
cd "$AUTOPKGTEST_TMP"
cat <<EOF > CMakeLists.txt
cmake_minimum_required(VERSION 3.22)
project(cmake-clang-test)
find_package(Clang $LLVM_VERSION.1 REQUIRED)
EOF
mkdir build && cd build
cmake ..

39
debian/tests/cmake-llvm-test.in vendored Executable file
View File

@ -0,0 +1,39 @@
#!/bin/sh
set -e
LLVM_VERSION=@LLVM_VERSION@
# this is taken from libjsoncpp package
# Presence of $AUTOPKGTEST_TMP implies that someone will handle cleanup for us, so we
# can avoid duplicating the effort (signal handling, etc.) here.
if [ -z "$AUTOPKGTEST_TMP" ]
then
echo "Required envvar AUTOPKGTEST_TMP \"$AUTOPKGTEST_TMP\" is not set" >&2
exit 1
fi
# the idea was taken from spirv-llvm-translator package
cd "$AUTOPKGTEST_TMP"
cat <<EOF > CMakeLists.txt
cmake_minimum_required(VERSION 3.22)
project(cmake-llvm-test)
find_package(LLVM $LLVM_VERSION.1 REQUIRED
COMPONENTS
Analysis
BitReader
BitWriter
Core
Support
TransformUtils
llvm-as
llvm-dis
)
EOF
mkdir build && cd build
cmake ..

View File

@ -19,6 +19,7 @@ Depends: gcc, build-essential, cmake, llvm-19-dev, clang-19, libclang-19-dev
Test-Command: python3 -c "import lldb; print(lldb.__file__); print(lldb)" Test-Command: python3 -c "import lldb; print(lldb.__file__); print(lldb)"
Depends: python3-lldb-19 Depends: python3-lldb-19
Architecture: amd64 arm64 armel armhf i386 ppc64el s390x
Test-Command: python3 -c "import clang; print(clang.__file__); print(clang)" Test-Command: python3 -c "import clang; print(clang.__file__); print(clang)"
Depends: python3-clang-19 Depends: python3-clang-19

25
debian/tests/control.in vendored Normal file
View File

@ -0,0 +1,25 @@
Test-Command: bash -v ./debian/qualify-clang.sh
Depends: @, cmake, make, g++, file, dpkg-dev
# Comment the dbgsym package because of bug #917528
# dbgsym packages not being available in testing
# clang-@LLVM_VERSION@-dbgsym, libclang1-@LLVM_VERSION@-dbgsym
Restrictions: allow-stderr
Architecture: amd64 arm64 i386
Tests: integration-test-suite-test
Depends: @, cmake, make, g++, libstdc++-14-dev
Restrictions: allow-stderr
Architecture: amd64 arm64
Tests: cmake-llvm-test
Depends: gcc, build-essential, cmake, llvm-@LLVM_VERSION@-dev
Tests: cmake-clang-test
Depends: gcc, build-essential, cmake, llvm-@LLVM_VERSION@-dev, clang-@LLVM_VERSION@, libclang-@LLVM_VERSION@-dev
Test-Command: python3 -c "import lldb; print(lldb.__file__); print(lldb)"
Depends: python3-lldb-@LLVM_VERSION@
Architecture: amd64 arm64 armel armhf i386 ppc64el s390x
Test-Command: python3 -c "import clang; print(clang.__file__); print(clang)"
Depends: python3-clang-@LLVM_VERSION@

39
debian/tests/integration-test-suite-test.in vendored Executable file
View File

@ -0,0 +1,39 @@
#!/bin/sh
set -e
LLVM_VERSION=@LLVM_VERSION@
# this is taken from libjsoncpp package
# Presence of $AUTOPKGTEST_TMP implies that someone will handle cleanup for us, so we
# can avoid duplicating the effort (signal handling, etc.) here.
if [ -z "$AUTOPKGTEST_TMP" ]
then
echo "Required envvar AUTOPKGTEST_TMP \"$AUTOPKGTEST_TMP\" is not set" >&2
exit 1
fi
# Copy the integration repo to the temp dir
cp -Rv integration-test-suite/* "$AUTOPKGTEST_TMP"/
cd "$AUTOPKGTEST_TMP"
mkdir build
cd build
cmake -DLIT=/usr/lib/llvm-$LLVM_VERSION/build/utils/lit/lit.py \
-DCLANG_BINARY=/usr/bin/clang-$LLVM_VERSION \
-DCLANGXX_BINARY=/usr/bin/clang++-$LLVM_VERSION \
-DCLANG_TIDY_BINARY=/usr/bin/clang-tidy-$LLVM_VERSION \
-DCLANG_FORMAT_BINARY=/usr/bin/clang-format-$LLVM_VERSION \
-DLLD_BINARY=/usr/bin/lld-$LLVM_VERSION \
-DLLDB_BINARY=/usr/bin/lldb-$LLVM_VERSION \
-DLLVMCONFIG_BINARY=/usr/bin/llvm-config-$LLVM_VERSION \
-DOPT_BINARY=/usr/bin/opt-$LLVM_VERSION \
-DSCANBUILD=/usr/bin/scan-build-$LLVM_VERSION \
-DCLANG_TIDY_BINARY=/usr/bin/clang-tidy-$LLVM_VERSION \
-DSCANVIEW=/usr/bin/scan-view-$LLVM_VERSION \
-DLLVMNM=/usr/bin/llvm-nm-$LLVM_VERSION \
-DLLVMPROFDATA=/usr/bin/llvm-profdata-$LLVM_VERSION \
-DENABLE_COMPILER_RT=OFF \
-DENABLE_LIBCXX=ON \
-DLLVM_CMAKE_PREFIX_PATH=/usr/lib/llvm-$LLVM_VERSION/lib/cmake/ ../
make check