Add tests that show and test include paths
authorStuart Prescott <stuart@debian.org>
Sat, 28 Mar 2026 05:24:42 +0000 (16:24 +1100)
committerStuart Prescott <stuart@debian.org>
Sun, 29 Mar 2026 01:46:39 +0000 (12:46 +1100)
Checking for #1131536

debian/clean
debian/tests/control.gen
debian/tests/control.in [new file with mode: 0644]
debian/tests/test-cmake-variables.sh [new file with mode: 0755]
debian/tests/test-cmake-variables/CMakeLists.txt [new file with mode: 0644]
debian/tests/test-pkgconf-variables.sh [new file with mode: 0755]

index 007fd642e997a5f484b12d74c5093696631cafa3..91f96f1a54480094f4e6f6241fc5ca676aabb92d 100644 (file)
@@ -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/
index e730967f7293c2d61f2da7bd8b7f0f2def8bd3d6..9eb84322974938890060a55471cf2ef53a210f1a 100755 (executable)
@@ -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 (file)
index 0000000..8da0bcc
--- /dev/null
@@ -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 (executable)
index 0000000..16be115
--- /dev/null
@@ -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 (file)
index 0000000..e114d07
--- /dev/null
@@ -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} = <UNSET>")
+      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 (executable)
index 0000000..56e7ee4
--- /dev/null
@@ -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