test(tools): add tests for the tools library

- RateLimiter: lower bound of the duration at 200 Hz; rate 0 does not
  sleep
- InstanceLimiter: throws above the limit, counts down on destruction
- Semaphore and SharedSemaphore: counts, blocking Wait(), shared count
- ToString(), StrStartsWith(), StrEndsWith(), ToStrVector()
- Uuid() and UuidHash() are unique
- execute(): output with prefix, stderr, exit code, stdin input,
  signal, timeout
- Skip Tools.NetworkDefaultIP on a machine without a default route

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-11-03 14:53:55 +00:00
committed by Dennis Klein
parent cc3297b2fd
commit 788ca57859
3 changed files with 195 additions and 1 deletions

View File

@@ -263,6 +263,7 @@ add_testsuite(Tools
SOURCES
${CMAKE_CURRENT_BINARY_DIR}/runner.cxx
tools/_network.cxx
tools/_tools.cxx
LINKS FairMQ
INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}