test: add litest_log_group() for easier test log grouping

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1210>
This commit is contained in:
Peter Hutterer 2025-06-03 11:43:49 +10:00 committed by Marge Bot
parent 669bc620aa
commit d5761547da

View file

@ -99,6 +99,14 @@ void _litest_checkpoint(const char *func,
#define litest_checkpoint(...) \
_litest_checkpoint(__func__, __LINE__, ANSI_GREEN, __VA_ARGS__)
#define litest_log_group(...) \
for (bool i_ = ({ \
litest_checkpoint("🭋🬂🬂🬂🬂🬂🬂🬂🬂🬂🬂🬂🬂🬂🬂🬂🬂🬂🬂🬂🬂 %s:%3d 🬂🬂🬂🬂🬂🬂🬂🬂🬂🬂🬂🬂🬂🬂🬂🬂🬂🬂🬂🬂🭀", __func__, __LINE__); \
litest_checkpoint(" " __VA_ARGS__); true; }); \
i_; \
i_ = ({litest_checkpoint("🭦🬭🬭🬭🬭🬭🬭🬭🬭🬭🬭🬭🬭🬭🬭🬭🬭🬭🬭🬭🬭 %s:%3d 🬭🬭🬭🬭🬭🬭🬭🬭🬭🬭🬭🬭🬭🬭🬭🬭🬭🬭🬭🬭🭛", __func__, __LINE__); \
false; }))
/**
* litest itself needs the user_data to store some test-suite-specific
* information. Tests must not override this pointer, any data they need