Timo Aaltonen pushed to branch debian-unstable at X Strike Force / lib / libxcvt


Commits:
432701b2 by Timo Aaltonen at 2022-02-18T12:49:08+02:00
Add a simple autopkgtest that tests the lib is working.

- - - - -
b6dde837 by Timo Aaltonen at 2022-02-18T12:49:17+02:00
release to sid

- - - - -


3 changed files:

- debian/changelog
- + debian/tests/build-test
- + debian/tests/control


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+libxcvt (0.1.1-3) unstable; urgency=medium
+
+  * Add a simple autopkgtest that tests the lib is working.
+
+ -- Timo Aaltonen <[email protected]>  Fri, 18 Feb 2022 12:49:09 +0200
+
 libxcvt (0.1.1-2) unstable; urgency=medium
 
   * rules: Override dh_missing, add --fail-.missing.


=====================================
debian/tests/build-test
=====================================
@@ -0,0 +1,80 @@
+#!/bin/sh
+set -eu
+
+if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
+    CROSS_COMPILE="$DEB_HOST_GNU_TYPE-"
+else
+    CROSS_COMPILE=
+fi
+
+cd "$AUTOPKGTEST_TMP"
+
+# stolen from cvt/cvt.c
+# Copyright 2005-2006 Luc Verhaegen.
+cat <<EOF > libtest.c
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#include <libxcvt/libxcvt.h>
+
+/*
+ * Originally grabbed from xf86Mode.c.
+ *
+ * Ignoring the actual mode_info->name, as the user will want something solid
+ * to grab hold of.
+ */
+static void
+print_mode_line(struct libxcvt_mode_info *mode_info, int hdisplay, int 
vdisplay, float vrefresh,
+              bool reduced)
+{
+    if (reduced)
+        printf("Modeline \"%dx%dR\"  ", hdisplay, vdisplay);
+    else
+        printf("Modeline \"%dx%d_%.2f\"  ", hdisplay, vdisplay, vrefresh);
+
+    printf("%6.2f  %i %i %i %i  %i %i %i %i", mode_info->dot_clock / 1000.,
+           mode_info->hdisplay, mode_info->hsync_start, mode_info->hsync_end, 
mode_info->htotal,
+           mode_info->vdisplay, mode_info->vsync_start, mode_info->vsync_end, 
mode_info->vtotal);
+
+    if (mode_info->mode_flags & LIBXCVT_MODE_FLAG_INTERLACE)
+        printf(" interlace");
+    if (mode_info->mode_flags & LIBXCVT_MODE_FLAG_HSYNC_POSITIVE)
+        printf(" +hsync");
+    if (mode_info->mode_flags & LIBXCVT_MODE_FLAG_HSYNC_NEGATIVE)
+        printf(" -hsync");
+    if (mode_info->mode_flags & LIBXCVT_MODE_FLAG_VSYNC_POSITIVE)
+        printf(" +vsync");
+    if (mode_info->mode_flags & LIBXCVT_MODE_FLAG_VSYNC_NEGATIVE)
+        printf(" -vsync");
+
+    printf("\n");
+}
+
+int
+main (int argc, char *argv[])
+{
+    struct libxcvt_mode_info *mode_info;
+    int hdisplay = 1024, vdisplay = 768;
+    float vrefresh = 60.0;
+    bool reduced = false, verbose = false;
+    bool interlaced = false;
+
+    mode_info = libxcvt_gen_mode_info(hdisplay, vdisplay, vrefresh, reduced, 
interlaced);
+    if (!mode_info) {
+        fprintf(stderr, "Out of memory!\n");
+            return 0;
+    }
+    print_mode_line(mode_info, hdisplay, vdisplay, vrefresh, reduced);
+    free(mode_info);
+
+    return 0;
+}
+EOF
+
+${CROSS_COMPILE}gcc -o libtest libtest.c $(${CROSS_COMPILE}pkg-config --cflags 
--libs libxcvt)
+echo "build ok"
+[ -x libtest ]
+./libtest
+echo "starts ok"


=====================================
debian/tests/control
=====================================
@@ -0,0 +1,6 @@
+Tests: build-test
+Depends: libxcvt-dev, build-essential, pkg-config
+
+Test-Command: dh_auto_configure; dh_auto_build; dh_auto_test
+Depends: @builddeps@
+Restrictions: allow-stderr



View it on GitLab: 
https://salsa.debian.org/xorg-team/lib/libxcvt/-/compare/7150187d0ad53e5caf69c08ceef3c80fc8056c51...b6dde837ea6808e86209c1f41a85143414a2cede

-- 
View it on GitLab: 
https://salsa.debian.org/xorg-team/lib/libxcvt/-/compare/7150187d0ad53e5caf69c08ceef3c80fc8056c51...b6dde837ea6808e86209c1f41a85143414a2cede
You're receiving this email because of your account on salsa.debian.org.


Reply via email to