Timo Aaltonen pushed to branch debian-unstable at X Strike Force / vulkan / 
glslang


Commits:
1271e17f by Simon McVittie at 2019-11-25T08:04:38Z
d/tests: Add superficial autopkgtests

The glslang-dev test is not at all thorough, but it should detect at
least some changes to the build machinery and dependencies that would
otherwise make dependent packages like renderdoc FTBFS.

Similarly, the glslang-tools test just screen-scrapes the --help output
rather than verifying that a real shader can be compiled, but that's
better than nothing.

Signed-off-by: Simon McVittie <[email protected]>
Closes: #940488

- - - - -


3 changed files:

- + debian/tests/control
- + debian/tests/glslang-dev
- + debian/tests/glslang-tools


Changes:

=====================================
debian/tests/control
=====================================
@@ -0,0 +1,10 @@
+Tests: glslang-dev
+Restrictions: allow-stderr, superficial
+Depends:
+ build-essential,
+ glslang-dev,
+
+Tests: glslang-tools
+Restrictions: allow-stderr, superficial
+Depends:
+ glslang-tools,


=====================================
debian/tests/glslang-dev
=====================================
@@ -0,0 +1,37 @@
+#!/bin/sh
+# Copyright  2019 Collabora Ltd.
+# SPDX-License-Identifier: MIT
+# (see debian/copyright)
+
+# Check that the library can be linked.
+
+set -e
+set -u
+set -x
+
+tempdir="$(mktemp -d)"
+cd "$tempdir"
+
+cat > trivial.cpp <<'EOF'
+#undef NDEBUG
+#include <cassert>
+
+#include <glslang/Public/ShaderLang.h>
+
+int main (void)
+{
+  ShHandle handle;
+  handle = ShConstructUniformMap();
+  ShDestruct(handle);
+  return 0;
+}
+EOF
+
+# This is hard-coded because there's no pkg-config, but that matches
+# what renderdoc does...
+c++ -std=c++11 -o trivial trivial.cpp -lglslang -lHLSL -lOGLCompiler 
-lOSDependent -lSPIRV -lpthread
+test -x trivial
+./trivial
+
+cd /
+rm -fr "$tempdir"


=====================================
debian/tests/glslang-tools
=====================================
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# Copyright  2019 Collabora Ltd.
+# SPDX-License-Identifier: MIT
+# (see debian/copyright)
+
+set -eux
+export LC_ALL=C.UTF-8
+
+# For now just check that the executables can run at all. They exit
+# unsuccessfully when asked for help, so screen-scrape the help...
+
+spirv-remap --help 2>&1 | tee "$AUTOPKGTEST_TMP/help"
+grep -q Usage: "$AUTOPKGTEST_TMP/help"
+
+glslangValidator --help 2>&1 | tee "$AUTOPKGTEST_TMP/help"
+grep -q Usage: "$AUTOPKGTEST_TMP/help"



View it on GitLab: 
https://salsa.debian.org/xorg-team/vulkan/glslang/commit/1271e17f641c679156ba21b6a5996adad29b2531

-- 
View it on GitLab: 
https://salsa.debian.org/xorg-team/vulkan/glslang/commit/1271e17f641c679156ba21b6a5996adad29b2531
You're receiving this email because of your account on salsa.debian.org.


Reply via email to