Added an ATF test-case for issue #18 (in shell).

This commit is contained in:
Juan RP 2013-11-01 18:35:25 +01:00
parent 1fd164b88b
commit c4a0568c08
5 changed files with 62 additions and 0 deletions

21
mk/test-shell.mk Normal file
View File

@ -0,0 +1,21 @@
-include $(TOPDIR)/config.mk
.PHONY: all
all: $(TEST)
.PHONY: clean
clean:
.PHONY: install
install: all
install -d $(DESTDIR)$(TESTSDIR)/$(TESTSSUBDIR)
install -m755 $(TEST).sh $(DESTDIR)$(TESTSDIR)/$(TESTSSUBDIR)/$(TEST)
ifdef EXTRA_FILES
for f in $(EXTRA_FILES); do \
install -m644 $${f} $(DESTDIR)$(TESTSDIR)/$(TESTSSUBDIR); \
done
endif
.PHONY: uninstall
uninstall:
-rm -f $(DESTDIR)$(TESTSDIR)/$(TESTSSUBDIR)/$(TEST)

View File

@ -10,5 +10,6 @@ SUBDIRS += util
SUBDIRS += find_pkg_obsoletes
SUBDIRS += find_pkg_orphans
SUBDIRS += pkgdb
SUBDIRS += issue18
include ../../mk/subdir.mk

View File

@ -8,5 +8,6 @@ atf_test_program{name="pkgpattern_match_test"}
atf_test_program{name="plist_match_test"}
atf_test_program{name="plist_match_virtual_test"}
atf_test_program{name="find_pkg_obsoletes_test"}
atf_test_program{name="issue18_test"}
include('find_pkg_orphans/Kyuafile')
include('pkgdb/Kyuafile')

View File

@ -0,0 +1,7 @@
TOPDIR = ../../..
-include $(TOPDIR)/config.mk
TEST = issue18_test
include ../Makefile.inc
include $(TOPDIR)/mk/test-shell.mk

View File

@ -0,0 +1,32 @@
#! /usr/bin/env atf-sh
# xbps issue #18.
# How to reproduce it:
# Generate pkg A-0.1_1 and B-0.1_1.
# Install both pkgs.
# Generate pkg A-0.2_1: conflicts with B<0.1_2.
# Generate pkg B-0.1_2.
# Update all packages.
atf_test_case issue18
issue18_head() {
atf_set "descr" "xbps issue #18 (https://github.com/xtraeme/xbps/issues/18)"
}
issue18_body() {
mkdir pkg_A pkg_B
atf_check 'xbps-create -A noarch -n A-0.1_1 -s "pkg A" pkg_A' 0
atf_check 'xbps-create -A noarch -n B-0.1_1 -s "pkg B" pkg_B' 0
atf_check 'xbps-rindex -a *.xbps' 0
atf_check 'xbps-install -r rootdir --repository=$PWD -y A B' 0
atf_check 'xbps-create -A noarch -n A-0.2_1 -s "pkg A" --conflicts "B<0.1_2" pkg_A' 0
atf_check 'xbps-create -A noarch -n B-0.1_2 -s "pkg B" pkg_B' 0
atf_check 'xbps-rindex -a *.xbps' 0
atf_check 'xbps-install -r rootdir --repository=$PWD -yu' 0
}
atf_init_test_cases() {
atf_add_test_case issue18
}