Page MenuHomeFreeBSD

glob: Add tests for error callback functions and blocks
ClosedPublic

Authored by bnovkov on May 23 2025, 2:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 26, 6:56 PM
Unknown Object (File)
Tue, Nov 25, 2:10 AM
Unknown Object (File)
Sun, Nov 23, 5:22 PM
Unknown Object (File)
Sat, Nov 22, 1:49 AM
Unknown Object (File)
Sat, Nov 22, 1:48 AM
Unknown Object (File)
Sat, Nov 22, 1:47 AM
Unknown Object (File)
Sat, Nov 22, 1:46 AM
Unknown Object (File)
Sat, Nov 22, 1:41 AM
Subscribers

Details

Summary

This change adds tests that check basic callback functionality for
blocks and function pointers. The tests also make sure that GLOB_ERR
overrides the callback's return value.

Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Add test for matching files that start with a period

des requested changes to this revision.May 26 2025, 3:40 PM
des added a subscriber: des.
des added inline comments.
lib/libc/tests/gen/Makefile
17–20

This now needs to be conditional on ${COMPILER_FEATURES:Mblocks}, which means that if built with gcc, we don't test glob(3) at all, so perhaps the block-specific tests should go in a separate glob_blocks_test.

lib/libc/tests/gen/glob2_test.c
30
This revision now requires changes to proceed.May 26 2025, 3:40 PM
bnovkov retitled this revision from glob2_test: Add tests for error callback functions and blocks to glob: Add tests for error callback functions and blocks.
bnovkov marked 2 inline comments as done.
bnovkov added inline comments.
lib/libc/tests/gen/Makefile
17–20

good catch, thanks!
I've moved the blocks-specific tests into a separate file.

This revision is now accepted and ready to land.May 28 2025, 4:20 PM
This revision was automatically updated to reflect the committed changes.
bnovkov marked an inline comment as done.