Added an ATF test-case for issue #19.
This commit is contained in:
parent
616d4420d2
commit
4e4e4a49d0
@ -5,6 +5,7 @@ all: $(TEST)
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
-rm -f $(TEST)
|
||||
|
||||
.PHONY: install
|
||||
install: all
|
||||
|
@ -1,5 +1,5 @@
|
||||
-include ../config.mk
|
||||
|
||||
SUBDIRS = libxbps
|
||||
SUBDIRS = libxbps xbps-rindex
|
||||
|
||||
include ../mk/subdir.mk
|
||||
|
5
tests/xbps-rindex/Makefile
Normal file
5
tests/xbps-rindex/Makefile
Normal file
@ -0,0 +1,5 @@
|
||||
-include ../../config.mk
|
||||
|
||||
SUBDIRS = common issue19
|
||||
|
||||
include ../../mk/subdir.mk
|
1
tests/xbps-rindex/Makefile.inc
Normal file
1
tests/xbps-rindex/Makefile.inc
Normal file
@ -0,0 +1 @@
|
||||
TESTSSUBDIR = xbps-rindex
|
4
tests/xbps-rindex/common/Kyuafile
Normal file
4
tests/xbps-rindex/common/Kyuafile
Normal file
@ -0,0 +1,4 @@
|
||||
syntax("kyuafile", 1)
|
||||
|
||||
test_suite("xbps-rindex")
|
||||
atf_test_program{name="issue19_test"}
|
15
tests/xbps-rindex/common/Makefile
Normal file
15
tests/xbps-rindex/common/Makefile
Normal file
@ -0,0 +1,15 @@
|
||||
TOPDIR = ../../..
|
||||
-include $(TOPDIR)/config.mk
|
||||
|
||||
include ../Makefile.inc
|
||||
|
||||
all:
|
||||
|
||||
install:
|
||||
install -d $(DESTDIR)$(TESTSDIR)/$(TESTSSUBDIR)
|
||||
install -m644 Kyuafile $(DESTDIR)$(TESTSDIR)/$(TESTSSUBDIR)
|
||||
|
||||
uninstall:
|
||||
-rm -f $(DESTDIR)$(TESTSDIR)/$(TESTSSUBDIR)/Kyuafile
|
||||
|
||||
clean:
|
7
tests/xbps-rindex/issue19/Makefile
Normal file
7
tests/xbps-rindex/issue19/Makefile
Normal file
@ -0,0 +1,7 @@
|
||||
TOPDIR = ../../..
|
||||
-include $(TOPDIR)/config.mk
|
||||
|
||||
TEST = issue19_test
|
||||
|
||||
include ../Makefile.inc
|
||||
include $(TOPDIR)/mk/test-shell.mk
|
38
tests/xbps-rindex/issue19/issue19_test.sh
Executable file
38
tests/xbps-rindex/issue19/issue19_test.sh
Executable file
@ -0,0 +1,38 @@
|
||||
#! /usr/bin/env atf-sh
|
||||
|
||||
# xbps issue #19.
|
||||
# How to reproduce it:
|
||||
# Generate pkg foo-1.0_1.
|
||||
# Add it to the index of a local repo.
|
||||
# Remove the pkg file from the repo.
|
||||
# Run xbps-rindex -c on the repo.
|
||||
|
||||
atf_test_case issue19
|
||||
|
||||
issue19_head() {
|
||||
atf_set "descr" "xbps issue #19 (https://github.com/xtraeme/xbps/issues/19)"
|
||||
}
|
||||
|
||||
issue19_body() {
|
||||
mkdir -p some_repo
|
||||
cd some_repo
|
||||
xbps-create -A noarch -n foo-1.0_1 -s "foo pkg" .
|
||||
atf_check_equal $? 0
|
||||
xbps-rindex -a *.xbps
|
||||
atf_check_equal $? 0
|
||||
cd ..
|
||||
rm some_repo/*.xbps
|
||||
xbps-rindex -c some_repo
|
||||
atf_check_equal $? 0
|
||||
result=$(xbps-query --repository=some_repo -s foo)
|
||||
test -z "${result}"
|
||||
atf_check_equal $? 0
|
||||
}
|
||||
|
||||
issue19_cleanup() {
|
||||
rm -rf some_repo
|
||||
}
|
||||
|
||||
atf_init_test_cases() {
|
||||
atf_add_test_case issue19
|
||||
}
|
Loading…
Reference in New Issue
Block a user