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)
Sun, Oct 12, 6:22 PM
Unknown Object (File)
Sun, Oct 5, 9:25 PM
Unknown Object (File)
Sun, Sep 28, 4:14 AM
Unknown Object (File)
Fri, Sep 26, 8:26 AM
Unknown Object (File)
Wed, Sep 24, 1:08 AM
Unknown Object (File)
Thu, Sep 18, 8:23 PM
Unknown Object (File)
Thu, Sep 18, 3:13 AM
Unknown Object (File)
Wed, Sep 17, 4:39 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 Not Applicable
Unit
Tests Not Applicable

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.