Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
846fa97
test: Implement native C unit tests for PPD localization
rkt0209 May 18, 2026
baa5b4a
Merge branch 'OpenPrinting:master' into master
rkt0209 May 18, 2026
7f38022
test: add hermetic unit tests for PPD cache API
rkt0209 May 20, 2026
3cd063b
Merge branch 'master' of https://github.com/rkt0209/libppd
rkt0209 May 20, 2026
5417f39
test: add hermetic unit tests for PPD to IPP attributes API
rkt0209 May 22, 2026
273b901
test: add hermetic unit tests for PPD option marking API
rkt0209 May 25, 2026
874fa41
test: add hermetic unit tests for PPD custom-option API
rkt0209 May 26, 2026
b91e00c
test: add hermetic unit tests for PPD attribute API
rkt0209 May 27, 2026
b8a0371
test: add hermetic unit tests for PPD attribute API
rkt0209 May 27, 2026
b212d4b
test: add hermetic unit tests for PPD attribute API
rkt0209 May 27, 2026
7234de4
test: add hermetic unit tests for PPD page-size API
rkt0209 May 27, 2026
ae0adea
test: add hermetic unit tests for PPD conflicts API
rkt0209 May 28, 2026
0d1ce17
build: deregister test_ppd_load_profile from Makefile.am
rkt0209 May 28, 2026
50f2cf6
ci: introduced GitHub Actions workflow
rkt0209 May 28, 2026
6543410
test: add hermetic unit tests for PPD emission API
rkt0209 May 29, 2026
7bec28a
test: add hermetic unit tests for PPD filter wrapper API
rkt0209 May 29, 2026
6b05f40
test: add hermetic unit tests for IPP-to-PPD generator API
rkt0209 May 29, 2026
99a871d
Merge upstream master (includes #72 spec[IPP_MAX_NAME] fix)
rkt0209 May 30, 2026
2781f92
test: fix testEndMessage silently swallowing assertion failures
rkt0209 May 30, 2026
67266a7
test: add hermetic unit tests for ppd-load-profile profile loader API
rkt0209 May 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 101 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,126 @@
name: Build libppd
# =============================================================================
# Build and Test Workflow for libppd (x86_64 / ubuntu-latest)
#
# Modelled on the libcupsfilters CI in the sister OpenPrinting repository.
# Scope is intentionally restricted to a single native architecture
# (x86_64 on ubuntu-latest) so the build runs quickly and deterministically
# while still proving:
#
# * The complete repository compiles end-to-end (libppd.la plus all
# declared programs and tests under check_PROGRAMS) — not just that
# the test binaries link against an already-built library.
# * All registered TESTS pass (the 8 native C unit tests added in this
# cycle: testppd, test_ppd_localize, test_ppd_cache, test_ppd_ipp,
# test_ppd_mark, test_ppd_custom, test_ppd_attr, test_ppd_page,
# test_ppd_conflicts). test_ppd_load_profile is intentionally
# deregistered in Makefile.am pending mentor review of a latent
# bug in ppdLutLoad().
#
# The apt package list was derived from a direct scan of configure.ac:
#
# * PKG_CHECK_MODULES([LIBCUPSFILTERS], [libcupsfilters]) -> libcupsfilters-dev
# * PKG_CHECK_MODULES([ZLIB], [zlib]) -> zlib1g-dev
# * AC_PATH_TOOL(CUPSCONFIG, [cups-config]) (cups3 absent
# on ubuntu-latest, falls back to libcups2) -> libcups2-dev
# * AC_CHECK_PROG(CUPS_GHOSTSCRIPT, gs) -> ghostscript
# * AC_CHECK_PROG(CUPS_PDFTOPS, pdftops) -> poppler-utils
# * AC_CHECK_PROG(CUPS_MUTOOL, mutool) -> mupdf-tools
# * pdftocairo (Poppler renderer) -> poppler-utils
# * AM_GNU_GETTEXT([external]) / AM_ICONV -> gettext, autopoint
# * AC_PROG_CC, AC_PROG_CXX, AX_CXX_COMPILE_STDCXX([11]) -> build-essential
# * LT_INIT -> libtool
# * PKG_PROG_PKG_CONFIG -> pkg-config
# * AC_PROG_INSTALL -> (provided by build-essential)
#
# All three of ghostscript / poppler-utils / mupdf-tools are installed so
# the default ./configure (no --disable-* flags) succeeds — that gives us
# the maximum-coverage build the user asked for ("comprehensive build,
# rather than just checking if the unit tests run").
# =============================================================================

name: Build and Test (libppd)

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:

jobs:
build:
name: Build & Test (x86_64)
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies
# -----------------------------------------------------------------------
# System dependencies — derived from configure.ac (see header comment).
# -----------------------------------------------------------------------
- name: Install build & runtime dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
set -ex
sudo apt-get update --fix-missing -y
sudo apt-get install -y --no-install-recommends \
build-essential \
autoconf \
automake \
autopoint \
gettext \
libtool \
pkg-config \
gettext \
libcups2-dev \
libcupsfilters-dev \
zlib1g-dev \
ghostscript \
poppler-utils \
mupdf-tools
mupdf-tools

- name: Build project
run: |
./autogen.sh
./configure
make

- name: Run tests
run: make check
# -----------------------------------------------------------------------
# Full build — autogen.sh regenerates configure / Makefile.in from the
# autotools sources; configure runs without --disable-* flags so every
# external renderer (gs / pdftops / mutool / pdftocairo) is exercised;
# make -j$(nproc) builds the library AND every check_PROGRAMS binary,
# surfacing any compiler errors or warnings as build output.
# -----------------------------------------------------------------------
- name: autogen.sh
run: ./autogen.sh

- name: configure
run: ./configure

- name: make
run: make -j$(nproc) V=1

# -----------------------------------------------------------------------
# Run the registered TESTS. V=1 and VERBOSE=1 expose both the
# compile-line per object AND each test's stderr in the workflow log
# on failure, matching the libcupsfilters CI pattern. We deliberately
# do NOT pipe stderr away — a failing test prints its full diagnostic
# before the step exits non-zero, and the test-suite.log artifact (see
# next step) preserves the full automake summary for download.
# -----------------------------------------------------------------------
- name: make check
id: check
run: make check V=1 VERBOSE=1

# -----------------------------------------------------------------------
# Artifact upload — only fires when `make check` failed. Captures the
# top-level test-suite.log automake produces plus any per-test .log /
# .trs files so the failure can be diagnosed offline.
# -----------------------------------------------------------------------
- name: Upload test-suite.log on failure
if: failure() && steps.check.conclusion == 'failure'
uses: actions/upload-artifact@v4
with:
name: libppd-test-suite-log-x86_64
path: |
test-suite.log
**/*.log
**/*.trs
if-no-files-found: warn
retention-days: 14
133 changes: 130 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ EXTRA_DIST = \
libppd.pc.in

EXTRA_DIST += \
ppd/testdriver.c
ppd/testdriver.c \
ppd/test-internal.h

# =========
# Utilities
Expand Down Expand Up @@ -54,9 +55,33 @@ pkgppddefs_DATA = \
lib_LTLIBRARIES = libppd.la

check_PROGRAMS = \
testppd
testppd \
test_ppd_localize \
test_ppd_cache \
test_ppd_ipp \
test_ppd_mark \
test_ppd_custom \
test_ppd_attr \
test_ppd_page \
test_ppd_conflicts \
test_ppd_emit \
test_ppd_filter \
test_ppd_generator \
test_ppd_load_profile
TESTS = \
testppd
testppd \
test_ppd_localize \
test_ppd_cache \
test_ppd_ipp \
test_ppd_mark \
test_ppd_custom \
test_ppd_attr \
test_ppd_page \
test_ppd_conflicts \
test_ppd_emit \
test_ppd_filter \
test_ppd_generator \
test_ppd_load_profile

libppd_la_SOURCES = \
ppd/ppd-attr.c \
Expand Down Expand Up @@ -140,6 +165,108 @@ testppd_CFLAGS = \
-I$(srcdir)/ppd/ \
$(CUPS_CFLAGS)

test_ppd_localize_SOURCES = ppd/test_ppd_localize.c
test_ppd_localize_LDADD = \
libppd.la \
$(CUPS_LIBS)
test_ppd_localize_CFLAGS = \
-I$(srcdir)/ppd/ \
$(CUPS_CFLAGS)

test_ppd_cache_SOURCES = ppd/test_ppd_cache.c
test_ppd_cache_LDADD = \
libppd.la \
$(CUPS_LIBS)
test_ppd_cache_CFLAGS = \
-I$(srcdir)/ppd/ \
$(CUPS_CFLAGS)

test_ppd_ipp_SOURCES = ppd/test_ppd_ipp.c
test_ppd_ipp_LDADD = \
libppd.la \
$(CUPS_LIBS)
test_ppd_ipp_CFLAGS = \
-I$(srcdir)/ppd/ \
$(CUPS_CFLAGS)

test_ppd_mark_SOURCES = ppd/test_ppd_mark.c
test_ppd_mark_LDADD = \
libppd.la \
$(CUPS_LIBS)
test_ppd_mark_CFLAGS = \
-I$(srcdir)/ppd/ \
$(CUPS_CFLAGS)

test_ppd_custom_SOURCES = ppd/test_ppd_custom.c
test_ppd_custom_LDADD = \
libppd.la \
$(CUPS_LIBS)
test_ppd_custom_CFLAGS = \
-I$(srcdir)/ppd/ \
$(CUPS_CFLAGS)

test_ppd_attr_SOURCES = ppd/test_ppd_attr.c
test_ppd_attr_LDADD = \
libppd.la \
$(CUPS_LIBS)
test_ppd_attr_CFLAGS = \
-I$(srcdir)/ppd/ \
$(CUPS_CFLAGS)

test_ppd_page_SOURCES = ppd/test_ppd_page.c
test_ppd_page_LDADD = \
libppd.la \
$(CUPS_LIBS)
test_ppd_page_CFLAGS = \
-I$(srcdir)/ppd/ \
$(CUPS_CFLAGS)

test_ppd_conflicts_SOURCES = ppd/test_ppd_conflicts.c
test_ppd_conflicts_LDADD = \
libppd.la \
$(CUPS_LIBS)
test_ppd_conflicts_CFLAGS = \
-I$(srcdir)/ppd/ \
$(CUPS_CFLAGS)

test_ppd_emit_SOURCES = ppd/test_ppd_emit.c
test_ppd_emit_LDADD = \
libppd.la \
$(CUPS_LIBS)
test_ppd_emit_CFLAGS = \
-I$(srcdir)/ppd/ \
$(CUPS_CFLAGS)

test_ppd_filter_SOURCES = ppd/test_ppd_filter.c
test_ppd_filter_LDADD = \
libppd.la \
$(LIBCUPSFILTERS_LIBS) \
$(CUPS_LIBS)
test_ppd_filter_CFLAGS = \
-I$(srcdir)/ppd/ \
$(LIBCUPSFILTERS_CFLAGS) \
$(CUPS_CFLAGS)

test_ppd_generator_SOURCES = ppd/test_ppd_generator.c
test_ppd_generator_LDADD = \
libppd.la \
$(LIBCUPSFILTERS_LIBS) \
$(CUPS_LIBS)
test_ppd_generator_CFLAGS = \
-I$(srcdir)/ppd/ \
$(LIBCUPSFILTERS_CFLAGS) \
$(CUPS_CFLAGS)

test_ppd_load_profile_SOURCES = ppd/test_ppd_load_profile.c
test_ppd_load_profile_LDADD = \
libppd.la \
$(CUPS_LIBS) \
$(LIBCUPSFILTERS_LIBS)
test_ppd_load_profile_CFLAGS = \
-I$(srcdir)/ppd/ \
$(CUPS_CFLAGS) \
$(LIBCUPSFILTERS_CFLAGS)

EXTRA_DIST += \
$(pkgppdinclude_DATA) \
$(pkgppddefs_DATA) \
Expand Down
Loading
Loading