summaryrefslogtreecommitdiff
path: root/test/_libtest.c
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2021-02-25 14:07:17 -0500
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2021-02-25 23:17:25 -0500
commit17522c5ba124c5941e2cd3832a68722d64c6bf4b (patch)
treecdf572286861a1cf1df49a3fa4a06a400259bd5c /test/_libtest.c
parent01f6bc76c9613db70c3ef41c2c62ae3fc8d2d431 (diff)
downloadlibfaketime-17522c5ba124c5941e2cd3832a68722d64c6bf4b.tar.gz
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.
Diffstat (limited to 'test/_libtest.c')
-rw-r--r--test/_libtest.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/_libtest.c b/test/_libtest.c
new file mode 100644
index 0000000..2fa0bc9
--- /dev/null
+++ b/test/_libtest.c
@@ -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"
+}