Add a basic cmake test to see if the package is imported correctly

This commit is contained in:
Gianfranco Costamagna 2019-10-05 10:29:57 +02:00
parent df60d67098
commit 4030c3a37c
2 changed files with 37 additions and 0 deletions

33
debian/tests/cmake-test vendored Executable file
View File

@ -0,0 +1,33 @@
#!/bin/sh
set -e
# Presence of $ADTTMP implies that someone will handle cleanup for us, so we
# can avoid duplicating the effort (signal handling, etc.) here.
if [ -z "$ADTTMP" ]
then
echo "Required envvar ADTTMP \"$ADTTMP\" is not set" >&2
exit 1
fi
cd "$ADTTMP"
cat <<EOF > CMakeLists.txt
cmake_minimum_required(VERSION 2.6.2)
find_package(LLVM 9.0.0 REQUIRED
COMPONENTS
Analysis
BitReader
BitWriter
Core
Support
TransformUtils
llvm-as
llvm-dis
)
EOF
mkdir build && cd build
cmake ..

View File

@ -4,3 +4,7 @@ Depends: @, cmake, g++, file, dpkg-dev
# dbgsym packages not being available in testing
# clang-9-dbgsym, libclang1-9-dbgsym
Restrictions: allow-stderr
Test: cmake-test
Depends: gcc, build-essential, cmake, llvm-9-dev, libclang-common-9-dev