runners: test: Ripped out stack/heap measurements

The point of having separate test/bench runners is to minimize
complexity when different concerns overlap, and the stack/heap
measurements haven't proven necessary for testing yet.

Keeping them around just adds a maintenance burden, and risks messy
interactions with test features if you ever try to turn them on
(heap + powerloss = memory leaks yay).

So removing for now.

If they are useful in the future (cheaper Valgrind-esque checks?),
copying from bench_runner.c -> test_runner.c is super easy.

---

Note these are still available and enabled by default in the bench
runner.
This commit is contained in:
Christopher Haster
2026-02-07 14:50:34 -06:00
parent 24ed0c2892
commit f62d91c9b5
3 changed files with 29 additions and 444 deletions
-40
View File
@@ -140,46 +140,6 @@ void test_permutation(size_t i, uint32_t *buffer, size_t size);
#define TEST_FACTORIAL(x) test_factorial(x)
#define TEST_PERMUTATION(i, buffer, size) test_permutation(i, buffer, size)
#ifdef TEST_STACK
// get the maximum/current stack usage for this run
extern size_t test_stack_watermark;
__attribute__((noinline)) size_t test_stack_current(void);
__attribute__((noinline)) void test_stack_pause(void);
void test_stack_resume(void);
#define TEST_STACK_WATERMARK() test_stack_watermark
#define TEST_STACK_CURRENT() test_stack_current()
#define TEST_STACK_PAUSE() test_stack_pause()
#define TEST_STACK_RESUME() test_stack_resume()
#else
// stubs if not measuring stack
#define TEST_STACK_PAUSE()
#define TEST_STACK_RESUME()
#endif
#ifdef TEST_HEAP
// get the maximum/current heap usage for this run
extern size_t test_heap_watermark;
extern size_t test_heap_current;
void test_heap_pause(void);
void test_heap_resume(void);
void test_heap_inc(size_t size);
void test_heap_dec(size_t size);
#define TEST_HEAP_WATERMARK() test_heap_watermark
#define TEST_HEAP_CURRENT() test_heap_current
#define TEST_HEAP_PAUSE() test_heap_pause()
#define TEST_HEAP_RESUME() test_heap_resume()
#define TEST_HEAP_INC(size) test_heap_inc(size)
#define TEST_HEAP_DEC(size) test_heap_dec(size)
#else
// stubs if not measuring heap
#define TEST_HEAP_PAUSE()
#define TEST_HEAP_RESUME()
#define TEST_HEAP_INC(size)
#define TEST_HEAP_DEC(size)
#endif
// declare implicit defines as global intmax_ts
#define TEST_DEFINE(k, v) \