From d643b47d9b230158c5faae1c52dd4c841832a224 Mon Sep 17 00:00:00 2001 From: Tomasz Zawadzki Date: Fri, 27 Mar 2020 03:37:57 -0400 Subject: [PATCH] ut/blob: disable compilation of UT for CUnit other than 2.1-3 This unittest uses CU_add_suite_with_setup_and_teardown() which was added in CUnit 2.1-3 released over 5 years ago. This is the most commonly packaged version of CUnit on not EOL'd distributions. Unfortunetly there is incorrectly created package on CentOS7. CUnit-devel-2.1.3-8.el7.x86_64.rpm despite its name contains CUnit 2.1-2. Signed-off-by: Tomasz Zawadzki Change-Id: I5ebf9973b1f3df9ff6cc1f0dc61dcf691096605e Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1530 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- test/unit/lib/blob/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/unit/lib/blob/Makefile b/test/unit/lib/blob/Makefile index c57d0b1cc..019f966d0 100644 --- a/test/unit/lib/blob/Makefile +++ b/test/unit/lib/blob/Makefile @@ -34,7 +34,12 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../..) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk +CUNIT_VERSION = $(shell sed -n -e 's/.*VERSION "\([0-9\.\-]*\).*/\1/p' /usr/include/CUnit/CUnit.h) +ifeq ($(CUNIT_VERSION),2.1-3) DIRS-y = blob.c +else +$(warning "blob_ut.c compilation skipped, only CUnit version 2.1-3 is supported") +endif .PHONY: all clean $(DIRS-y)