From: Stuart Prescott Date: Sat, 28 Mar 2026 05:24:42 +0000 (+1100) Subject: Add tests that show and test include paths X-Git-Tag: archive/raspbian/6.10.3-2+rpi1^2~26 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=f1e5e75245ff3e50607d6e97810b3c28050511f6;p=pyside6.git Add tests that show and test include paths Checking for #1131536 --- diff --git a/debian/clean b/debian/clean index 007fd642..91f96f1a 100644 --- a/debian/clean +++ b/debian/clean @@ -4,3 +4,4 @@ pyside3_install/ sources/pyside2/doc/pyside-config.qdocconf sources/pyside2/doc/pyside.qdocconf.in sources/pyside2/doc/qtmodules/pyside-*.qdocconf +debian/tests/test-cmake-variables/build/ diff --git a/debian/tests/control.gen b/debian/tests/control.gen index e730967f..9eb84322 100755 --- a/debian/tests/control.gen +++ b/debian/tests/control.gen @@ -7,6 +7,11 @@ rm -f $C echo "## AUTOGENERATED FILE: SEE debian/tests/control.gen\n\n" > $C +cat $C.in >> $C + +echo "\n\n# Automatically generated tests from debian/tests/control.gen\n\n" >> $C + + # Create the basic (import) test for Python 3 modules for binary_package in $(dh_listpackages|grep "python3-pyside6.qt"); do module_name=$(echo $binary_package|awk -F. '{print $2}') diff --git a/debian/tests/control.in b/debian/tests/control.in new file mode 100644 index 00000000..8da0bcc3 --- /dev/null +++ b/debian/tests/control.in @@ -0,0 +1,17 @@ +# Manually written tests from debian/tests/control.in + +Tests: test-cmake-variables.sh +Depends: + cmake, + libpyside6-dev, + libshiboken6-dev, +Restrictions: allow-stderr, superficial + + +Tests: test-pkgconf-variables.sh +Depends: + libpyside6-dev, + libshiboken6-dev, + pkgconf, + python3-dev, +Restrictions: allow-stderr, superficial diff --git a/debian/tests/test-cmake-variables.sh b/debian/tests/test-cmake-variables.sh new file mode 100755 index 00000000..16be115e --- /dev/null +++ b/debian/tests/test-cmake-variables.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e +set -u + +cp -a debian/tests/test-cmake-variables/ "$AUTOPKGTEST_TMP/" + +cd "$AUTOPKGTEST_TMP/test-cmake-variables" + +# Run simple cmake code to check that the cmake config is importable +# and print all the variables that these imports set for manual checking + +cmake -S . -B build diff --git a/debian/tests/test-cmake-variables/CMakeLists.txt b/debian/tests/test-cmake-variables/CMakeLists.txt new file mode 100644 index 00000000..e114d071 --- /dev/null +++ b/debian/tests/test-cmake-variables/CMakeLists.txt @@ -0,0 +1,52 @@ +cmake_minimum_required(VERSION 3.20) +project(trace_pyside CXX) + +message(STATUS "==== IMPORTING PACKAGES ====") +find_package(PySide6 REQUIRED) +find_package(Shiboken6 REQUIRED) +find_package(Shiboken6Tools REQUIRED) + +message(STATUS "") +message(STATUS "==== VARIABLES ====") +get_cmake_property(allvars VARIABLES) +list(SORT allvars) +foreach(v IN LISTS allvars) + if(v MATCHES "^(PYSIDE|PySide|SHIBOKEN|Shiboken|_pyside|_shiboken|Python)") + message(STATUS " ${v} = [${${v}}]") + endif() +endforeach() + + +message(STATUS "") +message(STATUS "==== TARGET PROPERTIES ====") + +foreach(t + PySide6::pyside6 + Shiboken6::libshiboken + Shiboken6::shiboken6 +) + if(TARGET "${t}") + message(STATUS "--- ${t} ---") + + foreach(prop + INTERFACE_INCLUDE_DIRECTORIES + INTERFACE_LINK_LIBRARIES + INTERFACE_COMPILE_DEFINITIONS + INTERFACE_COMPILE_OPTIONS + IMPORTED_CONFIGURATIONS + IMPORTED_LOCATION + IMPORTED_LOCATION_RELEASE + IMPORTED_IMPLIB + IMPORTED_IMPLIB_RELEASE + ) + get_target_property(val "${t}" "${prop}") + if(val STREQUAL "val-NOTFOUND") + message(STATUS " ${prop} = ") + else() + message(STATUS " ${prop} = [${val}]") + endif() + endforeach() + else() + message(STATUS "--- ${t} does not exist ---") + endif() +endforeach() diff --git a/debian/tests/test-pkgconf-variables.sh b/debian/tests/test-pkgconf-variables.sh new file mode 100755 index 00000000..56e7ee4a --- /dev/null +++ b/debian/tests/test-pkgconf-variables.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +set -e +set -u + +cd "$AUTOPKGTEST_TMP" + +error=0 + +for pkg in pyside6 shiboken6; do + echo "========== $pkg ==========" + echo "path = $(pkg-config --path "$pkg")" + echo "modversion = $(pkg-config --modversion "$pkg")" + echo + + echo "-- variables --" + for v in $(pkg-config --print-variables "$pkg"); do + val=$(pkg-config --variable="$v" "$pkg") + echo -n "$v = $val" + if [ ! -d "$val" -a ! -f "$val" ]; then + echo " <== ERROR: doesn't exist" + error=1 + else + echo + fi + done + echo + + echo "-- cflags --" + pkg-config --cflags "$pkg" + echo + + echo "-- libs --" + pkg-config --libs "$pkg" + echo +done + +if [ $error -gt 0 ]; then + echo "Exiting with error: errors detected above" + exit 1 +fi