Improving test coverage is one of the most valuable contributions you can make to musl. Insufficient testing makes it hard to ensure that new ports are correct, and hard to overhaul existing code.
The official test suite for musl is the libc-agnostic
repository, available at http://nsz.repo.hu/git/?p=libc-test.
The following is an incomplete list of missing test coverage that would be nice to have:
strftime- Basic functional tests for all format specifiers, corner case values.
iconv- Round trips to/from all supported character encodings.
DNS stub resolver - User+mount+network namespace based tests to hook the resolver up to a fake nameserver listening on localhost:53. Should test malformed response packets (particularly forms that triggered bugs in the past), well-formed corner cases,
Unicode properties - Verify that the properties reported by
isw*functions, and the case mappings performed by
towlower, are consistent/reasonable with particular Unicode versions.
UTF-8/16/32 encoders/decoders - Multibyte,
char32_tfunctions accept and correctly convert all valid inputs, reject all invalid ones.
open_wmemstream- Line-by-line tests for the properties the POSIX spec requires. The musl implementations of these are all likely to have subtle conformance bugs.
Arch bits & sycall conventions - Simple checks using all of the user/kernel boundary structures and syscalls that vary per arch (
stat, etc.) to see that both sides are interpreting the data consistently.
Environment manipulation functions - Various well-defined combinations of editing the environment via
unsetenv, checking consistency of the results.
siglongjmp- Use under conditions that are expected to have most/all registers in use and, for the
sig*versions, where the correctness of signal mask saving/restoration is visible. Also that
fenvis not restored by
siglongjmp(a common bug).
gettext- Basic lookup functionality, domain binding, plural rules. Existing musl-specific
__plevaltests could be reformulated as libc-agnostic using
.mofiles containing the plural rules.