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-02-02 15:39:17 +00:00
UNIT_SOURCE = \
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 \
test/unit/io_engine_t.c \
2018-05-11 06:10:01 +01:00
test/unit/radix_tree_t.c \
2018-04-27 16:55:07 +01:00
test/unit/matcher_t.c \
test/unit/framework.c \
test/unit/percent_t.c \
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
UNIT_DEPENDS = $( subst .c,.d,$( UNIT_SOURCE) )
2018-02-02 15:39:17 +00:00
UNIT_OBJECTS = $( UNIT_SOURCE:%.c= %.o)
2018-04-26 11:59:39 +01:00
CLEAN_TARGETS += $( UNIT_DEPENDS) $( UNIT_OBJECTS)
2018-02-02 15:39:17 +00:00
2018-06-07 16:15:04 +01:00
test/unit/unit-test : $( UNIT_OBJECTS ) lib /liblvm -internal .a libdaemon /client /libdaemonclient .a $( INTERNAL_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-07-09 10:05:19 +02:00
-o $@ $+ $( LIBS) $( DMEVENT_LIBS) $( SYSTEMD_LIBS) -lm -ldl -laio
2015-11-27 10:54:57 +01:00
2018-04-26 11:59:39 +01:00
.PHONEY : run -unit -test
2018-04-27 16:55:07 +01:00
run-unit-test : test /unit /unit -test
2011-11-23 12:21:41 +00:00
@echo Running unit tests
2018-04-27 16:55:07 +01:00
LD_LIBRARY_PATH = libdm test/unit/unit-test run
2018-04-26 11:59:39 +01:00
2018-07-01 15:16:18 +02:00
i f e q ( "$(USE_TRACKING)" , "yes" )
i f e q ( , $( findstring $ ( MAKECMDGOALS ) ,cscope .out cflow clean distclean lcov \
2018-07-09 10:05:19 +02:00
help check check_local check_cluster check_lvmetad check_lvmpolld run-unit-test) )
2018-07-01 15:16:18 +02:00
-include $( UNIT_DEPENDS)
e n d i f
e n d i f