diff options
-rw-r--r-- | test/Makefile | 14 | ||||
-rw-r--r-- | test/_libtest.c | 8 | ||||
-rw-r--r-- | test/_run_test.c | 2 | ||||
-rw-r--r-- | test/_use_lib_test.c | 6 |
4 files changed, 15 insertions, 15 deletions
diff --git a/test/Makefile b/test/Makefile index fc663c2..e0086be 100644 --- a/test/Makefile +++ b/test/Makefile @@ -6,7 +6,7 @@ LDFLAGS = -lrt -lpthread SRC = timetest.c OBJ = ${SRC:.c=.o} -TESTFUNCS = $(notdir $(basename $(wildcard snippets/*.c))) +TEST_SNIPPETS = $(notdir $(basename $(wildcard snippets/*.c))) EXPECTATIONS= $(notdir $(basename $(wildcard snippets/*.variable))) all: timetest test @@ -37,24 +37,24 @@ test_variable_data: test_variable_data.sh $(foreach f,${EXPECTATIONS},run_${f}) ./test_variable_data.sh ${EXPECTATIONS} run_%: _run_test.c snippets/%.c - sed s/FUNC_NAME/$*/g < _run_test.c | ${CC} -o $@ ${CFLAGS} -x c - + sed s/SNIPPET_NAME/$*/g < _run_test.c | ${CC} -o $@ ${CFLAGS} -x c - ## testing when interception points get called in library constructors: -test_library_constructors: test_constructors.sh $(foreach f,${TESTFUNCS},use_lib_${f} lib${f}.so) - true $(foreach f,${TESTFUNCS},&& ./test_constructors.sh ${f}) +test_library_constructors: test_constructors.sh $(foreach f,${TEST_SNIPPETS},use_lib_${f} lib${f}.so) + true $(foreach f,${TEST_SNIPPETS},&& ./test_constructors.sh ${f}) lib%.so: _libtest.c snippets/%.c - sed s/FUNC_NAME/$*/g < _libtest.c | ${CC} -shared -o $@ -fpic ${CFLAGS} -x c - + sed s/SNIPPET_NAME/$*/g < _libtest.c | ${CC} -shared -o $@ -fpic ${CFLAGS} -x c - use_lib_%: _use_lib_test.c snippets/%.c lib%.so - sed s/FUNC_NAME/$*/g < _use_lib_test.c | ${CC} -L. -o $@ ${CFLAGS} -x c - -l$* + sed s/SNIPPET_NAME/$*/g < _use_lib_test.c | ${CC} -L. -o $@ ${CFLAGS} -x c - -l$* ## cleanup and metainformation clean: - @rm -f ${OBJ} timetest getrandom_test syscall_test $(foreach f,${TESTFUNCS},use_lib_${f} lib${f}.so run_${f}) + @rm -f ${OBJ} timetest getrandom_test syscall_test $(foreach f,${TEST_SNIPPETS},use_lib_${f} lib${f}.so run_${f}) distclean: clean @echo diff --git a/test/_libtest.c b/test/_libtest.c index 2fa0bc9..886e313 100644 --- a/test/_libtest.c +++ b/test/_libtest.c @@ -1,8 +1,8 @@ #include "snippets/include_headers.h" #define where "library" -void FUNC_NAME_as_needed() { - printf(" called FUNC_NAME_as_needed() \n"); +void SNIPPET_NAME_as_needed() { + printf(" called SNIPPET_NAME_as_needed() \n"); } -static __attribute__((constructor)) void init_FUNC_NAME() { -#include "snippets/FUNC_NAME.c" +static __attribute__((constructor)) void init_SNIPPET_NAME() { +#include "snippets/SNIPPET_NAME.c" } diff --git a/test/_run_test.c b/test/_run_test.c index 63672f9..7cbaffb 100644 --- a/test/_run_test.c +++ b/test/_run_test.c @@ -1,5 +1,5 @@ #include "snippets/include_headers.h" #define where "direct" int main() { -#include "snippets/FUNC_NAME.c" +#include "snippets/SNIPPET_NAME.c" } diff --git a/test/_use_lib_test.c b/test/_use_lib_test.c index 24d8cc7..5a21d17 100644 --- a/test/_use_lib_test.c +++ b/test/_use_lib_test.c @@ -1,7 +1,7 @@ #include "snippets/include_headers.h" -extern void FUNC_NAME_as_needed(); +extern void SNIPPET_NAME_as_needed(); #define where "program" int main() { - FUNC_NAME_as_needed(); -#include "snippets/FUNC_NAME.c" + SNIPPET_NAME_as_needed(); +#include "snippets/SNIPPET_NAME.c" } |