1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
lvm2/test/Makefile.in
Jim Meyering 6c1d30b737 Run tests with LVM_SYSTEM_DIR pointing to private root and /dev dirs.
This makes the tests more reproducible and helps isolate
them from any existing LVM set-up.
* test/Makefile.in (abs_builddir): Define.
(init.sh): Emit definition of abs_builddir.
* test/lvm-utils.sh (unsafe_losetup_): Keep only the portable,
iterative approach.
(dmsetup_has_dm_devdir_support_): New function.
(init_root_dir_): New function.
Invoke init_root_dir_ for all but the first test.
* test/test-lib.sh (this_test_): Adapt to test-name change.
Invoke lvm-utils.sh much later (after tmpdir creation), and
only if the current test is not being skipped.
Remove useless abs_top_srcdir definition.
Rename t0->test_dir_rand_.
* test/t-lvcreate-pvtags.sh: Skip this test if the available
version of dmsetup is not new enough.
Use global, $G_dev_, rather than hard-coded "/dev".
* test/t-lvcreate-usage.sh: Make --verbose output more useful.


Author: Jim Meyering <jim@meyering.net>
Committer: Jim Meyering <meyering@redhat.com>
2007-10-09 13:13:06 +00:00

79 lines
2.2 KiB
Makefile

# Copyright (C) 2007 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@
all: init.sh
init.sh: Makefile.in .bin-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_builddir)' >> $@-t
echo 'PATH=$(abs_top_builddir)/test/bin:$$PATH' >> $@-t
echo 'abs_srcdir=$(abs_srcdir)' >> $@-t
echo 'abs_builddir=$(abs_builddir)' >> $@-t
echo 'export PATH' >> $@-t
chmod a-w $@-t
mv $@-t $@
# Shell quote;
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
T = $(wildcard t-*.sh)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
$(T): init.sh
@echo "*** $@ ***"; '$(SHELL_PATH_SQ)' \
$(TESTS_ENVIRONMENT) $@ $(GIT_TEST_OPTS)
.bin-dir-stamp: lvm-wrapper
rm -rf bin
mkdir bin
for i in lvm $$(cat $(top_srcdir)/tools/.commands); do \
ln -s ../lvm-wrapper bin/$$i; \
done
touch $@
lvm-wrapper: Makefile
rm -f $@-t $@
echo '#!/bin/sh' > $@-t
test -n "@DMDIR@" \
&& echo 'export LD_LIBRARY_PATH="@DMDIR@/lib"' >> $@-t
echo 'cmd=$$(echo ./$$0|sed "s,.*/,,")' >> $@-t
echo 'test "$$cmd" = lvm &&' >> $@-t
echo 'exec "$(abs_top_builddir)/tools/lvm" "$$@"' >> $@-t
echo 'exec "$(abs_top_builddir)/tools/lvm" "$$cmd" "$$@"' >> $@-t
chmod a-w,a+x $@-t
mv $@-t $@
clean:
rm -rf init.sh lvm-wrapper bin .bin-dir-stamp
all: $(T)
.PHONY: $(T) clean
.NOTPARALLEL: