From c3f8781fc3f0c70cdbcaf95e5cdae04a72f64593 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Tue, 13 Feb 2018 08:42:50 -0700 Subject: [PATCH] test: use spdk.unittest.mk for event and log unit tests Signed-off-by: Jim Harris Change-Id: I85838adb25505c793f09e956740ee66723fe4493 Reviewed-on: https://review.gerrithub.io/399747 Tested-by: SPDK Automated Test System Reviewed-by: Daniel Verkamp --- test/unit/lib/event/subsystem.c/Makefile | 19 ++----------------- .../unit/lib/event/subsystem.c/subsystem_ut.c | 2 +- test/unit/lib/log/log.c/Makefile | 18 ++---------------- test/unit/lib/log/log.c/log_ut.c | 4 ++-- 4 files changed, 7 insertions(+), 36 deletions(-) diff --git a/test/unit/lib/event/subsystem.c/Makefile b/test/unit/lib/event/subsystem.c/Makefile index 8e58c53a9..ef76f4fe0 100644 --- a/test/unit/lib/event/subsystem.c/Makefile +++ b/test/unit/lib/event/subsystem.c/Makefile @@ -35,21 +35,6 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../../..) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk include $(SPDK_ROOT_DIR)/mk/spdk.app.mk -CFLAGS += -I$(SPDK_ROOT_DIR)/test -CFLAGS += -I$(SPDK_ROOT_DIR)/lib/event -APP = subsystem_ut -C_SRCS := subsystem_ut.c +TEST_FILE = subsystem_ut.c -SPDK_LIB_LIST = log - -LIBS += $(SPDK_LIB_LINKER_ARGS) -lcunit - -all : $(APP) - -$(APP) : $(OBJS) $(SPDK_LIB_FILES) - $(LINK_C) - -clean : - $(CLEAN_C) $(APP) - -include $(SPDK_ROOT_DIR)/mk/spdk.deps.mk +include $(SPDK_ROOT_DIR)/mk/spdk.unittest.mk diff --git a/test/unit/lib/event/subsystem.c/subsystem_ut.c b/test/unit/lib/event/subsystem.c/subsystem_ut.c index 12308240b..72f26b4af 100644 --- a/test/unit/lib/event/subsystem.c/subsystem_ut.c +++ b/test/unit/lib/event/subsystem.c/subsystem_ut.c @@ -35,7 +35,7 @@ #include "spdk_cunit.h" -#include "subsystem.c" +#include "event/subsystem.c" static struct spdk_subsystem g_ut_subsystems[8]; static struct spdk_subsystem_depend g_ut_subsystem_deps[8]; diff --git a/test/unit/lib/log/log.c/Makefile b/test/unit/lib/log/log.c/Makefile index e840ff343..deedd9fbf 100644 --- a/test/unit/lib/log/log.c/Makefile +++ b/test/unit/lib/log/log.c/Makefile @@ -35,20 +35,6 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../../..) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk include $(SPDK_ROOT_DIR)/mk/spdk.app.mk -APP = log_ut +TEST_FILE = log_ut.c -C_SRCS := log_ut.c -CFLAGS += -I$(SPDK_ROOT_DIR)/test -CFLAGS += -I$(SPDK_ROOT_DIR)/lib/log - -LIBS += $(SPDK_LIBS) -lcunit - -all : $(APP) - -$(APP) : $(OBJS) $(SPDK_LIBS) - $(LINK_C) - -clean : - $(CLEAN_C) $(APP) - -include $(SPDK_ROOT_DIR)/mk/spdk.deps.mk +include $(SPDK_ROOT_DIR)/mk/spdk.unittest.mk diff --git a/test/unit/lib/log/log.c/log_ut.c b/test/unit/lib/log/log.c/log_ut.c index aa2c3a0e7..8589c9e95 100644 --- a/test/unit/lib/log/log.c/log_ut.c +++ b/test/unit/lib/log/log.c/log_ut.c @@ -36,8 +36,8 @@ #include "spdk_cunit.h" #include "spdk/log.h" -#include "log.c" -#include "log_flags.c" +#include "log/log.c" +#include "log/log_flags.c" static void log_test(void)