1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
lvm2/test/Makefile.in

118 lines
3.6 KiB
Makefile
Raw Normal View History

# Copyright (C) 2007-2011 Red Hat, Inc. All rights reserved.
#
# 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,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#TEST_OPTS=--verbose --debug
SHELL_PATH ?= $(SHELL)
TAR ?= $(TAR)
RM ?= rm -f
subdir := $(shell pwd|sed 's,.*/,,')
srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
abs_srcdir = @abs_srcdir@
abs_builddir = @abs_builddir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
include $(top_builddir)/make.tmpl
T ?= .
S ?= @ # never match anything by default
VERBOSE ?= 0
ALL = $(shell find $(srcdir) \( -name t-\*.sh -or -path */api/\*.sh \) | sort)
RUN = $(shell find $(srcdir) -regextype posix-egrep \( -name t-\*.sh -or -path */api/\*.sh \) -and -regex "$(srcdir)/.*($(T)).*" -and -not -regex "$(srcdir)/.*($(S)).*" | sort)
RUN_BASE = $(subst $(srcdir)/,,$(RUN))
# Shell quote;
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
ifeq ("@UDEV_SYNC@", "yes")
2010-02-15 19:30:13 +03:00
dm_udev_synchronisation = 1
endif
all: check
check: .tests-stamp
make -C api tests
@echo Testing with locking_type 1
VERBOSE=$(VERBOSE) ./lib/harness $(RUN_BASE)
@echo Testing with locking_type 3
VERBOSE=$(VERBOSE) LVM_TEST_LOCKING=3 ./lib/harness $(RUN_BASE)
check_cluster: .tests-stamp
make -C api tests
@echo Testing with locking_type 3
VERBOSE=$(VERBOSE) LVM_TEST_LOCKING=3 ./lib/harness $(RUN_BASE)
check_local: .tests-stamp
make -C api tests
@echo Testing with locking_type 1
VERBOSE=$(VERBOSE) LVM_TEST_LOCKING=1 ./lib/harness $(RUN_BASE)
lib/should: lib/not
ln -sf not lib/should
lib/%: $(srcdir)/lib/%.c .lib-dir-stamp
$(CC) $(DEFS) $(CFLAGS) -o $@ $<
lib/%: $(srcdir)/lib/%.sh .lib-dir-stamp
cp $< $@
chmod +x $@
lib/paths: $(srcdir)/Makefile.in .lib-dir-stamp
rm -f $@-t
echo 'top_srcdir=$(top_srcdir)' >> $@-t
echo 'abs_top_builddir=$(abs_top_builddir)' >> $@-t
echo 'abs_top_srcdir=$(abs_top_srcdir)' >> $@-t
echo 'abs_srcdir=$(abs_srcdir)' >> $@-t
echo 'abs_builddir=$(abs_builddir)' >> $@-t
2010-02-15 19:30:13 +03:00
echo 'export DM_UDEV_SYNCHRONISATION=$(dm_udev_synchronisation)' >> $@-t
mv $@-t $@
LIB = lib/not lib/should lib/harness \
lib/check lib/aux lib/test lib/utils lib/get lib/lvm-wrapper \
lib/paths
CMDS = lvm $(shell cat $(top_builddir)/tools/.commands)
.tests-stamp: $(ALL) $(LIB)
@if test "$(srcdir)" != . ; then \
echo "Copying tests to builddir."; \
for f in $(ALL); do cp $$f `echo $$f | sed -e s,^$(srcdir)/,,`; done; \
fi
touch $@
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
.lib-dir-stamp: $(top_srcdir)/scripts/fsadm.sh
mkdir -p lib
for i in $(CMDS); do ln -fs lvm-wrapper lib/$$i; done
ln -fs "$(abs_top_builddir)/tools/dmsetup" lib/dmsetup
ln -fs "$(abs_top_builddir)/daemons/clvmd/clvmd" lib/clvmd
ln -fs "$(abs_top_builddir)/daemons/dmeventd/dmeventd" lib/dmeventd
ln -fs "$(abs_top_builddir)/daemons/lvmetad/lvmetad" lib/lvmetad
ln -fs "$(abs_top_srcdir)/scripts/vgimportclone.sh" lib/vgimportclone
cp -f "$(top_srcdir)/scripts/fsadm.sh" lib/fsadm
@chmod +x lib/fsadm
touch $@
clean:
make -C api clean
test "$(srcdir)" != . && rm -f $(RUN_BASE) lvm2app.sh
CLEAN_TARGETS += .lib-dir-stamp .tests-stamp $(LIB) $(addprefix lib/,$(CMDS)) \
lib/clvmd lib/dmeventd lib/dmsetup lib/lvmetad lib/fsadm lib/vgimportclone
2008-06-27 23:24:17 +04:00
.NOTPARALLEL: