From e37b070a2e5057a626407d3a61f9760d40d8113f Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Mon, 19 Jun 2017 12:52:01 -0700 Subject: [PATCH] test: move lib/util unit tests to test/unit Change-Id: I3f5bc75913dc9c8ec19911f48661026cccf10780 Signed-off-by: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/366159 Tested-by: SPDK Automated Test System Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- test/lib/Makefile | 2 +- test/lib/util/Makefile | 44 ------------------- test/unit/lib/util/Makefile | 2 +- .../lib/util/io_channel.c}/.gitignore | 0 .../lib/util/io_channel.c}/Makefile | 2 +- .../lib/util/io_channel.c}/io_channel_ut.c | 0 .../lib/util/string.c}/.gitignore | 0 .../lib/util/string.c}/Makefile | 2 +- .../lib/util/string.c}/string_ut.c | 0 unittest.sh | 4 +- 10 files changed, 6 insertions(+), 50 deletions(-) delete mode 100644 test/lib/util/Makefile rename test/{lib/util/io_channel => unit/lib/util/io_channel.c}/.gitignore (100%) rename test/{lib/util/io_channel => unit/lib/util/io_channel.c}/Makefile (97%) rename test/{lib/util/io_channel => unit/lib/util/io_channel.c}/io_channel_ut.c (100%) rename test/{lib/util/string => unit/lib/util/string.c}/.gitignore (100%) rename test/{lib/util/string => unit/lib/util/string.c}/Makefile (97%) rename test/{lib/util/string => unit/lib/util/string.c}/string_ut.c (100%) diff --git a/test/lib/Makefile b/test/lib/Makefile index 4452a264f..f23b4a165 100644 --- a/test/lib/Makefile +++ b/test/lib/Makefile @@ -34,7 +34,7 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../..) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk -DIRS-y = bdev blob blobfs env event ioat iscsi json jsonrpc log nvme nvmf scsi util +DIRS-y = bdev blob blobfs env event ioat iscsi json jsonrpc log nvme nvmf scsi .PHONY: all clean $(DIRS-y) diff --git a/test/lib/util/Makefile b/test/lib/util/Makefile deleted file mode 100644 index a2c4801d7..000000000 --- a/test/lib/util/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -# -# 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 = io_channel string - -.PHONY: all clean $(DIRS-y) - -all: $(DIRS-y) -clean: $(DIRS-y) - -include $(SPDK_ROOT_DIR)/mk/spdk.subdirs.mk diff --git a/test/unit/lib/util/Makefile b/test/unit/lib/util/Makefile index e8fc71977..668e7aea8 100644 --- a/test/unit/lib/util/Makefile +++ b/test/unit/lib/util/Makefile @@ -34,7 +34,7 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../..) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk -DIRS-y = bit_array.c +DIRS-y = bit_array.c io_channel.c string.c .PHONY: all clean $(DIRS-y) diff --git a/test/lib/util/io_channel/.gitignore b/test/unit/lib/util/io_channel.c/.gitignore similarity index 100% rename from test/lib/util/io_channel/.gitignore rename to test/unit/lib/util/io_channel.c/.gitignore diff --git a/test/lib/util/io_channel/Makefile b/test/unit/lib/util/io_channel.c/Makefile similarity index 97% rename from test/lib/util/io_channel/Makefile rename to test/unit/lib/util/io_channel.c/Makefile index 1e1a54b32..b5838d55c 100644 --- a/test/lib/util/io_channel/Makefile +++ b/test/unit/lib/util/io_channel.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 diff --git a/test/lib/util/io_channel/io_channel_ut.c b/test/unit/lib/util/io_channel.c/io_channel_ut.c similarity index 100% rename from test/lib/util/io_channel/io_channel_ut.c rename to test/unit/lib/util/io_channel.c/io_channel_ut.c diff --git a/test/lib/util/string/.gitignore b/test/unit/lib/util/string.c/.gitignore similarity index 100% rename from test/lib/util/string/.gitignore rename to test/unit/lib/util/string.c/.gitignore diff --git a/test/lib/util/string/Makefile b/test/unit/lib/util/string.c/Makefile similarity index 97% rename from test/lib/util/string/Makefile rename to test/unit/lib/util/string.c/Makefile index 39555dded..8cf82e5b6 100644 --- a/test/lib/util/string/Makefile +++ b/test/unit/lib/util/string.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 CFLAGS += -I$(SPDK_ROOT_DIR)/test diff --git a/test/lib/util/string/string_ut.c b/test/unit/lib/util/string.c/string_ut.c similarity index 100% rename from test/lib/util/string/string_ut.c rename to test/unit/lib/util/string.c/string_ut.c diff --git a/unittest.sh b/unittest.sh index 15ec69ead..8bc206e21 100755 --- a/unittest.sh +++ b/unittest.sh @@ -73,8 +73,8 @@ $valgrind test/lib/iscsi/target_node/target_node_ut test/lib/iscsi/target_node/t $valgrind test/lib/iscsi/pdu/pdu $valgrind test/unit/lib/util/bit_array.c/bit_array_ut -$valgrind test/lib/util/io_channel/io_channel_ut -$valgrind test/lib/util/string/string_ut +$valgrind test/unit/lib/util/io_channel.c/io_channel_ut +$valgrind test/unit/lib/util/string.c/string_ut # local unit test coverage if [ "$cov_avail" = "yes" ]; then