2018-02-02 15:39:17 +00:00
# Copyright (C) 2011-2018 Red Hat, Inc. All rights reserved.
2011-11-20 21:43:20 +00:00
#
# This file is part of LVM2.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
2016-01-21 11:49:46 +01:00
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2011-11-20 21:43:20 +00:00
2018-12-15 01:55:11 +01:00
# NOTE: this Makefile only works as 'include' for toplevel Makefile
# which defined all top_* variables
2018-02-02 15:39:17 +00:00
UNIT_SOURCE = \
2018-07-09 10:37:39 +02:00
device_mapper/vdo/status.c \
\
2018-06-07 16:15:04 +01:00
test/unit/activation-generator_t.c \
2018-04-27 16:55:07 +01:00
test/unit/bcache_t.c \
2018-05-03 20:13:13 +01:00
test/unit/bcache_utils_t.c \
2018-04-27 16:55:07 +01:00
test/unit/bitset_t.c \
test/unit/config_t.c \
test/unit/dmlist_t.c \
test/unit/dmstatus_t.c \
2018-12-14 21:50:09 +01:00
test/unit/framework.c \
2018-04-27 16:55:07 +01:00
test/unit/io_engine_t.c \
test/unit/matcher_t.c \
test/unit/percent_t.c \
2018-12-14 21:50:09 +01:00
test/unit/radix_tree_t.c \
2018-04-27 16:55:07 +01:00
test/unit/run.c \
2018-05-10 13:01:26 +01:00
test/unit/string_t.c \
test/unit/vdo_t.c
2018-04-26 11:59:39 +01:00
2018-09-20 14:35:45 +01:00
test/unit/radix_tree_t.o : test /unit /rt_case 1.c
2018-12-15 01:55:11 +01:00
UNIT_TARGET = test/unit/unit-test
2018-11-29 21:47:11 +01:00
UNIT_DEPENDS = $( UNIT_SOURCE:%.c= %.d)
UNIT_OBJECTS = $( UNIT_SOURCE:%.c= %.o)
CLEAN_TARGETS += $( UNIT_DEPENDS) $( UNIT_OBJECTS) \
$( UNIT_SOURCE:%.c= %.gcda) \
2018-11-30 12:55:22 +01:00
$( UNIT_SOURCE:%.c= %.gcno) \
2018-12-15 01:55:11 +01:00
$( UNIT_TARGET)
2018-02-02 15:39:17 +00:00
2018-12-15 01:55:11 +01:00
$(UNIT_TARGET) : $( UNIT_OBJECTS ) $( LVMINTERNAL_LIBS )
2018-02-05 16:04:23 +00:00
@echo " [LD] $@ "
2018-05-16 13:43:02 +01:00
$( Q) $( CC) $( CFLAGS) $( LDFLAGS) $( EXTRA_EXEC_LDFLAGS) \
2018-12-17 11:51:17 +01:00
-o $@ $+ $( DMEVENT_LIBS) $( SYSTEMD_LIBS) -L$( top_builddir) /libdm -ldevmapper $( LIBS) -laio
2015-11-27 10:54:57 +01:00
2018-12-01 00:44:22 +01:00
.PHONEY : run -unit -test unit -test
2018-12-15 01:55:11 +01:00
unit-test : $( UNIT_TARGET )
run-unit-test : $( UNIT_TARGET )
@echo "Running unit tests"
LD_LIBRARY_PATH = libdm $( UNIT_TARGET) run
2018-04-26 11:59:39 +01:00
2018-12-15 01:55:11 +01:00
i f e q ( "$(DEPENDS)" , "yes" )
-include $(UNIT_SOURCE : %.c =%.d )
2018-07-01 15:16:18 +02:00
e n d i f