From 34e3bf9c86eb3f7b335a399f6a163ccbc65ecb06 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Fri, 8 Sep 2017 15:12:02 -0700 Subject: [PATCH] test: move subsystem_ut to unit test directory Change-Id: I22c4273812922e1a2f7bb7ec0d3e8353e74780a3 Signed-off-by: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/377822 Tested-by: SPDK Automated Test System Reviewed-by: Paul Luse Reviewed-by: Jim Harris --- test/lib/event/Makefile | 2 +- test/lib/event/event.sh | 1 - test/unit/lib/Makefile | 2 +- test/unit/lib/event/Makefile | 44 +++++++++++++++++++ .../lib/event/subsystem.c}/.gitignore | 0 .../lib/event/subsystem.c}/Makefile | 4 +- .../lib/event/subsystem.c}/subsystem_ut.c | 0 unittest.sh | 2 + 8 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 test/unit/lib/event/Makefile rename test/{lib/event/subsystem => unit/lib/event/subsystem.c}/.gitignore (100%) rename test/{lib/event/subsystem => unit/lib/event/subsystem.c}/Makefile (95%) rename test/{lib/event/subsystem => unit/lib/event/subsystem.c}/subsystem_ut.c (100%) diff --git a/test/lib/event/Makefile b/test/lib/event/Makefile index a0a4810c69..e9deaf2987 100644 --- a/test/lib/event/Makefile +++ b/test/lib/event/Makefile @@ -34,7 +34,7 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk -DIRS-y = event_perf reactor reactor_perf subsystem +DIRS-y = event_perf reactor reactor_perf .PHONY: all clean $(DIRS-y) diff --git a/test/lib/event/event.sh b/test/lib/event/event.sh index e829629cff..1c503f2b57 100755 --- a/test/lib/event/event.sh +++ b/test/lib/event/event.sh @@ -8,5 +8,4 @@ timing_enter event $testdir/event_perf/event_perf -m 0xF -t 1 $testdir/reactor/reactor -t 1 $testdir/reactor_perf/reactor_perf -t 1 -$testdir/subsystem/subsystem_ut timing_exit event diff --git a/test/unit/lib/Makefile b/test/unit/lib/Makefile index 7cc192c013..180be1d5aa 100644 --- a/test/unit/lib/Makefile +++ b/test/unit/lib/Makefile @@ -34,7 +34,7 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk -DIRS-y = bdev blob blobfs ioat iscsi json jsonrpc log nvme nvmf scsi util +DIRS-y = bdev blob blobfs event ioat iscsi json jsonrpc log nvme nvmf scsi util ifeq ($(OS),Linux) DIRS-$(CONFIG_VHOST) += vhost endif diff --git a/test/unit/lib/event/Makefile b/test/unit/lib/event/Makefile new file mode 100644 index 0000000000..862db3c0d8 --- /dev/null +++ b/test/unit/lib/event/Makefile @@ -0,0 +1,44 @@ +# +# BSD LICENSE +# +# Copyright (c) Intel Corporation. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Intel Corporation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../..) +include $(SPDK_ROOT_DIR)/mk/spdk.common.mk + +DIRS-y = subsystem.c + +.PHONY: all clean $(DIRS-y) + +all: $(DIRS-y) +clean: $(DIRS-y) + +include $(SPDK_ROOT_DIR)/mk/spdk.subdirs.mk diff --git a/test/lib/event/subsystem/.gitignore b/test/unit/lib/event/subsystem.c/.gitignore similarity index 100% rename from test/lib/event/subsystem/.gitignore rename to test/unit/lib/event/subsystem.c/.gitignore diff --git a/test/lib/event/subsystem/Makefile b/test/unit/lib/event/subsystem.c/Makefile similarity index 95% rename from test/lib/event/subsystem/Makefile rename to test/unit/lib/event/subsystem.c/Makefile index 554fece31f..8e58c53a95 100644 --- a/test/lib/event/subsystem/Makefile +++ b/test/unit/lib/event/subsystem.c/Makefile @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../..) +SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../../..) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk include $(SPDK_ROOT_DIR)/mk/spdk.app.mk @@ -40,7 +40,7 @@ CFLAGS += -I$(SPDK_ROOT_DIR)/lib/event APP = subsystem_ut C_SRCS := subsystem_ut.c -SPDK_LIB_LIST = event trace conf util log +SPDK_LIB_LIST = log LIBS += $(SPDK_LIB_LINKER_ARGS) -lcunit diff --git a/test/lib/event/subsystem/subsystem_ut.c b/test/unit/lib/event/subsystem.c/subsystem_ut.c similarity index 100% rename from test/lib/event/subsystem/subsystem_ut.c rename to test/unit/lib/event/subsystem.c/subsystem_ut.c diff --git a/unittest.sh b/unittest.sh index 6099780922..4e8a5f5cc0 100755 --- a/unittest.sh +++ b/unittest.sh @@ -52,6 +52,8 @@ $valgrind test/lib/blobfs/blobfs_async_ut/blobfs_async_ut # blobfs_sync_ut hangs when run under valgrind, so don't use $valgrind test/lib/blobfs/blobfs_sync_ut/blobfs_sync_ut +$valgrind test/unit/lib/event/subsystem.c/subsystem_ut + $valgrind test/unit/lib/nvme/nvme.c/nvme_ut $valgrind test/unit/lib/nvme/nvme_ctrlr.c/nvme_ctrlr_ut $valgrind test/unit/lib/nvme/nvme_ctrlr_cmd.c/nvme_ctrlr_cmd_ut