diff options
author | Oneric <oneric@oneric.stub> | 2022-05-13 21:41:15 +0200 |
---|---|---|
committer | Oneric <oneric@oneric.stub> | 2022-07-29 17:51:57 +0200 |
commit | 52004898e16c7b33217bb1363aaac65f3d397ba5 (patch) | |
tree | ce6b7c9a189a3027fe1acc1d5fae85ed33390f72 | |
parent | a28e2c1390df7f9b3069650bd60de26077074f97 (diff) | |
download | libass-52004898e16c7b33217bb1363aaac65f3d397ba5.tar.bz2 libass-52004898e16c7b33217bb1363aaac65f3d397ba5.tar.xz |
make: integrate regression tests
Use `-j 1` in CI for unmangled output.
In the future this could be improved by integrating with Automake's
test support to get better output with multiple jobs. Considering
the layour of the crash tests will likely change and that currently
the tests run in less 15 seconds even with just a single thread,
this should be good enough for now.
-rw-r--r-- | .github/workflows/ghci.yml | 39 | ||||
-rw-r--r-- | Makefile.am | 25 | ||||
-rw-r--r-- | configure.ac | 2 |
3 files changed, 57 insertions, 9 deletions
diff --git a/.github/workflows/ghci.yml b/.github/workflows/ghci.yml index 47a8497..e9db11c 100644 --- a/.github/workflows/ghci.yml +++ b/.github/workflows/ghci.yml @@ -37,12 +37,15 @@ jobs: cc: gcc docker_image: alpine:latest shell: '/usr/bin/docker exec dockerciimage sh -e {0}' + art_reg_skip: 'font_nonunicode' # Add docker-build with minimum version of dependencies - os: ubuntu-latest cc: gcc docker_image: oldlibs docker_pullprefix: 'ghcr.io/theoneric/libass-containers/' shell: '/usr/bin/docker exec dockerciimage sh -e {0}' + # various regression test fail, supposedly due to older deps + skip_tests: yes # Add a Windows build (MinGW-gcc via MSYS2) with no extras - os: windows-2019 msystem: MINGW32 @@ -63,9 +66,18 @@ jobs: run: shell: ${{ matrix.shell || 'bash' }} + env: + ART_SAMPLES: ext_art-samples + steps: - name: checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 + + - name: download test samples + uses: actions/checkout@v3 + with: + repository: libass/libass-tests + path: ${{ env.ART_SAMPLES }} - name: Start Docker if: matrix.docker_image @@ -102,12 +114,14 @@ jobs: pacman --noconfirm -S \ automake autoconf libtool nasm make \ $pre-pkg-config $pre-gcc \ - $pre-fribidi $pre-freetype $pre-harfbuzz $pre-fontconfig + $pre-fribidi $pre-freetype $pre-harfbuzz $pre-fontconfig \ + $pre-libpng ;; alpine:*) apk add nasm ${{ matrix.cc }} musl-dev \ make automake autoconf libtool pkgconf \ - fontconfig-dev freetype-dev fribidi-dev harfbuzz-dev + fontconfig-dev freetype-dev fribidi-dev harfbuzz-dev \ + libpng-dev ;; oldlibs) : # Everything is preinstalled @@ -117,7 +131,8 @@ jobs: sudo apt-get install -y --no-install-recommends \ autoconf automake make libtool \ libfontconfig1-dev libfreetype6-dev libfribidi-dev \ - libharfbuzz-dev nasm ${{ matrix.cc }} + libharfbuzz-dev nasm ${{ matrix.cc }} \ + libpng-dev ;; esac @@ -134,18 +149,24 @@ jobs: export CC="${{ matrix.cc }}\ ${{ matrix.extra_cflags && ' ' }}${{ matrix.extra_cflags }}" export LD="${{ matrix.ld }}" + export ART_SAMPLES="${{ env.ART_SAMPLES }}" ./autogen.sh - ./configure - - - name: compile - if: matrix.do_distc != 'yes' - run: make -j 2 + ./configure --enable-compare --enable-fuzz - name: distcheck if: matrix.do_distc == 'yes' run: make -j 2 distcheck + - name: compile + run: make -j 2 + + - name: run tests + if: matrix.skip_tests != 'yes' + run: | + ART_REG_SKIP="${{ matrix.art_reg_skip }}" make -j 1 check + + - name: Coverity scan if: > matrix.do_coverity == 'yes' diff --git a/Makefile.am b/Makefile.am index 0c1a5b4..d814e86 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,3 +14,28 @@ noinst_PROGRAMS = include libass/Makefile_library.am include Makefile_util.am + +# Tests +if ENABLE_FUZZ +check: check-art-fuzz +.PHONY: check-art-fuzz +check-art-fuzz: fuzz/fuzz + @if [ -z '$(ART_SAMPLES)' ] ; then \ + echo "ART_SAMPLES location not set; cannot run regression tests!"; \ + else \ + cd '$(ART_SAMPLES)'/crash/ ; \ + ./run-all.sh '$(abs_top_builddir)'/fuzz/fuzz ; \ + fi +endif + +if ENABLE_COMPARE +check: check-art-compare +.PHONY: check-art-compare +check-art-compare: compare/compare + @if [ -z '$(ART_SAMPLES)' ] ; then \ + echo "ART_SAMPLES location not set; cannot run regression tests!"; \ + else \ + cd '$(ART_SAMPLES)'/regression/ ; \ + ./run-all.sh '$(abs_top_builddir)'/compare/compare ; \ + fi +endif diff --git a/configure.ac b/configure.ac index f87f855..42b5a81 100644 --- a/configure.ac +++ b/configure.ac @@ -37,6 +37,8 @@ AC_ARG_ENABLE([asm], AS_HELP_STRING([--disable-asm], AC_ARG_ENABLE([large-tiles], AS_HELP_STRING([--enable-large-tiles], [use larger tiles in the rasterizer (better performance, slightly worse quality) @<:@default=disabled@:>@])) +AC_ARG_VAR([ART_SAMPLES], + [Path to the root of libass' regression testing sample repository. If set, it is used in make check.]) AC_ARG_VAR([FUZZ_LDFLAGS], [Optional special linking flags only used for the fuzzer binary.]) AC_ARG_VAR([FUZZ_CPPFLAGS], |