Overhaul testing library constructors

We want to make it easier to test a bunch of different functions that
might be invoked in constructors of other libraries.

It seems conceivable that with these snippets, we could design other
tests that also work across a wide range of intercepted functions.
This commit is contained in:
Daniel Kahn Gillmor
2021-02-25 14:07:17 -05:00
parent 01f6bc76c9
commit 17522c5ba1
16 changed files with 90 additions and 74 deletions

8
test/_libtest.c Normal file
View File

@@ -0,0 +1,8 @@
#include "snippets/include_headers.h"
#define where "library"
void FUNC_NAME_as_needed() {
printf(" called FUNC_NAME_as_needed() \n");
}
static __attribute__((constructor)) void init_FUNC_NAME() {
#include "snippets/FUNC_NAME.c"
}