From c89b424b993b1f7c58ffddf46a15a52d5d737f1f Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 30 Dec 2021 12:27:03 -0800 Subject: [PATCH] ... --- test/unit/Makefile.am | 4 +++- test/unit/meta.tests.c | 6 +++++- test/unit/test_utils.h | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/test/unit/Makefile.am b/test/unit/Makefile.am index dc6cc48..dd4f862 100644 --- a/test/unit/Makefile.am +++ b/test/unit/Makefile.am @@ -66,10 +66,12 @@ meta_tests_SOURCES = \ meta.tests.c \ $(top_srcdir)/src/fs/concat.c \ $(top_srcdir)/src/fs/dir.c \ - $(top_srcdir)/src/meta.c \ $(top_srcdir)/src/rss/free.c \ $(top_srcdir)/src/rss/init.c +meta_tests_CPPFLAGS = $(AM_CPPFLAGS) \ + -DMETA_SRC_FILE="$(top_srcdir)/src/meta.c" + rss_tests_SOURCES = \ $(common_SOURCES) \ rss.tests.c \ diff --git a/test/unit/meta.tests.c b/test/unit/meta.tests.c index b1f17bd..f3c1348 100644 --- a/test/unit/meta.tests.c +++ b/test/unit/meta.tests.c @@ -1,6 +1,10 @@ #include -#include +char *strptime(const char *s, const char *format, struct tm *tm) { + return (char*)s; +} + +#include INCLUDE(META_SRC_FILE) int main(); static void meta_entry_basic_test(); diff --git a/test/unit/test_utils.h b/test/unit/test_utils.h index c7577b2..1cb13a3 100644 --- a/test/unit/test_utils.h +++ b/test/unit/test_utils.h @@ -11,6 +11,10 @@ #include #include +#define __include(x) #x +#define _include(x) __include(x) +#define INCLUDE(x) _include(x) + #define TEST_DIRECTORY PREFIX #define TEST_FILE_1 PREFIX "/test" #define TEST_FILE_1_CONTENTS "asldfkjaslkdfjalskdjf" -- 2.39.5