Skip to content

Latest commit

 

History

History
97 lines (68 loc) · 1.82 KB

README.md

File metadata and controls

97 lines (68 loc) · 1.82 KB

Test Rigs

NeoMutt comes with a set of unit tests that test individual functions.

Sometimes, though, it's helpful to test the behaviour of large blocks of code. This repo contains three programs to do just that.

They were useful once; they may not be useful again :-)

For each of them, first build NeoMutt, then compile the program in the NeoMutt source dir.

ANSI

Test the ANSI escape sequence parsing: ansi_color_parse()

Build:

gcc -Wall -ggdb3 -O0 -I. -o test-ansi{,.c} libcolor.a libconfig.a libmutt.a -lpcre2-8 -lncursesw

Run:

./test-ansi SEQUENCE

Header Cache packing

Test packing and unpacking flag members from struct Email and struct Body.

Build:

gcc -ggdb3 -O0 -I. -o hcache-packing{,.c}

Run:

./test-maildir MAILDIR

Maildir

Open and parse a Maildir mailbox

Build:

gcc -ggdb3 -O0 -I. -o test-maildir{,.c} libmaildir.a libhcache.a libemail.a libaddress.a libcore.a libconfig.a libmutt.a -lidn2 -lpcre2-8

Run:

./test-maildir MAILDIR

Menu

Test the Menu code (work in progress)

Build:

gcc -Wall -ggdb3 -O0 -I. -o test-menu{,.c} libmenu.a libcore.a libemail.a libconfig.a libaddress.a libmutt.a -lidn2

Run:

./test-menu

Msgset

Test the IMAP message set

Build:

gcc -Wall -ggdb3 -O0 -I. -o test-msgset{,.c} libcore.a libimap.a libemail.a libaddress.a libconfig.a libmutt.a -lidn2 -lpcre2-8

Run:

./test-msgset [RANDOM-SEED]

MX Alloc Memory

Test mx_alloc_memory(), which allocates space in the Mailbox for emails and v2r.

Build:

gcc -Wall -ggdb3 -O0 -I. -o test-mx-alloc{,.c} libcore.a libemail.a libaddress.a libconfig.a libmutt.a -lpcre2-8 -lidn2

Run:

./test-mx-alloc SIZE1 SIZE2