[neomutt-devel] Building and running tests
Stuart Henderson
stu at spacehopper.org
Wed Sep 10 18:39:29 CEST 2025
On 2025/09/10 18:28, Filippo Bonazzi wrote:
> Hi,
>
> I am trying to build and run tests as part of the neomutt build for openSUSE
> Tumbleweed on OBS [0].
>
> I thought it would be as easy as adding this in the spec file:
> > %check
> > %make_build test
> as sort of described on [1], but this fails to compile with a few errors like
> this one:
>
> > [ 33s] ccache cc -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -std=c11 -fno-delete-null-pointer-checks -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D__EXTENSIONS__ -D_XOPEN_SOURCE_EXTENDED -I/usr/include/lua5.4 -I/usr/include -I/usr/include -I/usr/include -DNCURSES_WIDECHAR -I/usr/include -I/usr/include/p11-kit-1 -I/usr/include -O2 -I. -I. -Wall -I./test -MT test/color/ansi.o -MD -MP -MF test/color/ansi.Tpo -c -o test/color/ansi.o test/color/ansi.c
> > [ 33s] test/color/ansi.c: In function ‘test_ansi_color’:
> > [ 33s] test/color/ansi.c:50:15: error: lvalue required as left operand of assignment
> > [ 33s] 50 | COLOR_PAIRS = 256;
> > [ 33s] | ^
> > [ 33s] make: *** [Makefile:789: test/color/ansi.o] Error 1
>
> I tried compiling manually with ./configure and make test and I get the same
> errors.
>
> Is there something obvious I'm missing? Are these not the right tests to run?
> I checked a couple of other distros and they are not running these tests as
> part of their build, so maybe I'm the one doing something wrong.
>
> Thank you,
>
> Filippo
>
> [0] https://build.opensuse.org/package/show/server:mail/neomutt
> [1] https://neomutt.org/dev/build/build
I do have tests enabled in the OpenBSD port. (We don't run them by
default when building from the port, but generally try to set things up
so that "make test" in the port dir works, where sanely possible).
General hints: You need to fetch the neomutt-test-files repo to some
dir, run setup.sh from it, and run tests with NEOMUTT_TEST_DIR pointed
at that dir.
More info in the readme in neomutt-test-files.
More information about the neomutt-devel
mailing list