aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-17 13:42:34 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-17 13:42:34 +0100
commited8e38f2a721a91d86609b5186471b47c05555ca (patch)
tree69a644ae94b3dfe6f0ec22357fab3a5abe95193a
parent228726b06ac580bb3330bfb961586713b99d71d8 (diff)
downloadpaludis-ed8e38f2a721a91d86609b5186471b47c05555ca.tar.gz
paludis-ed8e38f2a721a91d86609b5186471b47c05555ca.tar.xz
Add continue_on_failure_TEST for cave
-rw-r--r--src/clients/cave/Makefile.am6
-rwxr-xr-xsrc/clients/cave/continue_on_failure_TEST56
-rwxr-xr-xsrc/clients/cave/continue_on_failure_TEST_cleanup.sh9
-rwxr-xr-xsrc/clients/cave/continue_on_failure_TEST_setup.sh257
4 files changed, 326 insertions, 2 deletions
diff --git a/src/clients/cave/Makefile.am b/src/clients/cave/Makefile.am
index c38aa65..cf66170 100644
--- a/src/clients/cave/Makefile.am
+++ b/src/clients/cave/Makefile.am
@@ -144,11 +144,13 @@ libcave_a_SOURCES = \
# cmd_uninstall.cc \
# cmd_uninstall_unused.cc
-TESTS =
+TESTS = \
+ continue_on_failure_TEST
EXTRA_DIST = \
$(man_MANS) \
- $(TESTS)
+ $(TESTS) \
+ continue_on_failure_TEST_setup.sh continue_on_failure_TEST_cleanup.sh
DISTCLEANFILES = $(man_MANS) $(noinst_DATA)
diff --git a/src/clients/cave/continue_on_failure_TEST b/src/clients/cave/continue_on_failure_TEST
new file mode 100755
index 0000000..50e0b88
--- /dev/null
+++ b/src/clients/cave/continue_on_failure_TEST
@@ -0,0 +1,56 @@
+#!/usr/bin/env bash
+
+export PALUDIS_HOME=`pwd`/continue_on_failure_TEST_dir/config/
+export TEST_ROOT=`pwd`/continue_on_failure_TEST_dir/root/
+
+./cave --environment :continue-on-failure-test \
+ resolve -x --continue-on-failure if-satisfied a b c
+
+if [[ -f continue_on_failure_TEST_dir/root/a ]] ; then
+ exit 1
+fi
+
+if [[ -f continue_on_failure_TEST_dir/root/b ]] ; then
+ exit 2
+fi
+
+if ! [[ -f continue_on_failure_TEST_dir/root/c ]] ; then
+ exit 3
+fi
+
+if [[ -f continue_on_failure_TEST_dir/root/d ]] ; then
+ exit 4
+fi
+
+if ! [[ -f continue_on_failure_TEST_dir/root/e ]] ; then
+ exit 5
+fi
+
+./cave --environment :continue-on-failure-test \
+ resolve -x =cat/w-1 cat/u --permit-old-version '*/*' || exit 6
+
+./cave --environment :continue-on-failure-test \
+ resolve -x --continue-on-failure if-independent x y z
+
+if [[ -f continue_on_failure_TEST_dir/root/z ]] ; then
+ exit 7
+fi
+
+if [[ -f continue_on_failure_TEST_dir/root/y ]] ; then
+ exit 8
+fi
+
+if ! [[ -f continue_on_failure_TEST_dir/root/x ]] ; then
+ exit 9
+fi
+
+if [[ -f continue_on_failure_TEST_dir/root/w ]] ; then
+ exit 10
+fi
+
+if ! [[ -f continue_on_failure_TEST_dir/root/v ]] ; then
+ exit 11
+fi
+
+exit 0
+
diff --git a/src/clients/cave/continue_on_failure_TEST_cleanup.sh b/src/clients/cave/continue_on_failure_TEST_cleanup.sh
new file mode 100755
index 0000000..5304541
--- /dev/null
+++ b/src/clients/cave/continue_on_failure_TEST_cleanup.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+# vim: set ft=sh sw=4 sts=4 et :
+
+if [ -d continue_on_failure_TEST_dir ] ; then
+ rm -fr continue_on_failure_TEST_dir
+else
+ true
+fi
+
diff --git a/src/clients/cave/continue_on_failure_TEST_setup.sh b/src/clients/cave/continue_on_failure_TEST_setup.sh
new file mode 100755
index 0000000..4ae8670
--- /dev/null
+++ b/src/clients/cave/continue_on_failure_TEST_setup.sh
@@ -0,0 +1,257 @@
+#!/usr/bin/env bash
+# vim: set ft=sh sw=4 sts=4 et :
+
+mkdir continue_on_failure_TEST_dir || exit 1
+cd continue_on_failure_TEST_dir || exit 1
+mkdir -p build
+
+mkdir -p config/.paludis-continue-on-failure-test/repositories
+cat <<END > config/.paludis-continue-on-failure-test/specpath.conf
+config-suffix =
+END
+
+cat <<END > config/.paludis-continue-on-failure-test/use.conf
+*/* foo
+END
+
+cat <<END > config/.paludis-continue-on-failure-test/licenses.conf
+*/* *
+END
+
+cat <<END > config/.paludis-continue-on-failure-test/keywords.conf
+*/* test
+END
+
+cat <<END > config/.paludis-continue-on-failure-test/general.conf
+world = `pwd`/root/world
+END
+
+cat <<END > config/.paludis-continue-on-failure-test/bashrc
+export CHOST="my-chost"
+END
+
+cat <<END > config/.paludis-continue-on-failure-test/repositories/repo1.conf
+location = `pwd`/repo1
+cache = /var/empty
+format = ebuild
+names_cache = /var/empty
+profiles = \${location}/profiles/testprofile
+builddir = `pwd`/build
+END
+
+cat <<END > config/.paludis-continue-on-failure-test/repositories/installed.conf
+location = `pwd`/root/var/db/pkg
+format = vdb
+names_cache = /var/empty
+provides_cache = /var/empty
+builddir = `pwd`/build
+END
+
+mkdir -p root/tmp
+mkdir -p root/var/db/pkg
+mkdir -p root/${SYSCONFDIR}
+touch root/${SYSCONFDIR}/ld.so.conf
+
+mkdir -p repo1/{eclass,distfiles,profiles/testprofile,cat/{a,b,c,d,e,u,v,w,x,y,z}/files} || exit 1
+
+cd repo1 || exit 1
+echo "test-repo-1" > profiles/repo_name || exit 1
+cat <<END > profiles/categories || exit 1
+cat
+END
+cat <<END > profiles/testprofile/make.defaults
+ARCH=test
+USERLAND=test
+KERNEL=test
+TESTPROFILE_WAS_SOURCED=yes
+PROFILE_ORDERING=1
+USE_EXPAND="USERLAND KERNEL"
+END
+
+cat <<"END" > cat/a/a-1.ebuild || exit 1
+DESCRIPTION="Test a"
+HOMEPAGE="http://paludis.pioto.org/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+RDEPEND="cat/d"
+
+src_install() {
+ mkdir -p ${D}${TEST_ROOT}
+ touch ${D}${TEST_ROOT}/a
+}
+END
+
+cat <<"END" > cat/b/b-1.ebuild || exit 1
+DESCRIPTION="Test b"
+HOMEPAGE="http://paludis.pioto.org/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+RDEPEND="cat/a"
+
+src_install() {
+ mkdir -p ${D}${TEST_ROOT}
+ touch ${D}${TEST_ROOT}/b
+}
+END
+
+cat <<"END" > cat/c/c-1.ebuild || exit 1
+DESCRIPTION="Test c"
+HOMEPAGE="http://paludis.pioto.org/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+RDEPEND="cat/e"
+
+src_install() {
+ mkdir -p ${D}${TEST_ROOT}
+ touch ${D}${TEST_ROOT}/c
+}
+END
+
+cat <<"END" > cat/d/d-1.ebuild || exit 1
+DESCRIPTION="Test d"
+HOMEPAGE="http://paludis.pioto.org/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+RDEPEND=""
+
+pkg_setup() {
+ die "supposed to fail"
+}
+END
+
+cat <<"END" > cat/e/e-1.ebuild || exit 1
+DESCRIPTION="Test e"
+HOMEPAGE="http://paludis.pioto.org/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+RDEPEND=""
+
+src_install() {
+ mkdir -p ${D}${TEST_ROOT}
+ touch ${D}${TEST_ROOT}/e
+}
+END
+
+cat <<"END" > cat/z/z-1.ebuild || exit 1
+DESCRIPTION="Test z"
+HOMEPAGE="http://paludis.pioto.org/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+RDEPEND="cat/w"
+
+src_install() {
+ mkdir -p ${D}${TEST_ROOT}
+ touch ${D}${TEST_ROOT}/z
+}
+END
+
+cat <<"END" > cat/y/y-1.ebuild || exit 1
+DESCRIPTION="Test y"
+HOMEPAGE="http://paludis.pioto.org/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+RDEPEND="cat/u"
+
+src_install() {
+ mkdir -p ${D}${TEST_ROOT}
+ touch ${D}${TEST_ROOT}/y
+}
+END
+
+cat <<"END" > cat/x/x-1.ebuild || exit 1
+DESCRIPTION="Test x"
+HOMEPAGE="http://paludis.pioto.org/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+RDEPEND="cat/v"
+
+src_install() {
+ mkdir -p ${D}${TEST_ROOT}
+ touch ${D}${TEST_ROOT}/x
+}
+END
+
+cat <<"END" > cat/w/w-1.ebuild || exit 1
+DESCRIPTION="Test w"
+HOMEPAGE="http://paludis.pioto.org/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+RDEPEND=""
+END
+
+cat <<"END" > cat/w/w-2.ebuild || exit 1
+DESCRIPTION="Test w"
+HOMEPAGE="http://paludis.pioto.org/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+RDEPEND=""
+
+pkg_setup() {
+ die "supposed to fail"
+}
+END
+
+cat <<"END" > cat/v/v-1.ebuild || exit 1
+DESCRIPTION="Test v"
+HOMEPAGE="http://paludis.pioto.org/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+RDEPEND=""
+
+src_install() {
+ mkdir -p ${D}${TEST_ROOT}
+ touch ${D}${TEST_ROOT}/v
+}
+END
+
+cat <<"END" > cat/u/u-1.ebuild || exit 1
+DESCRIPTION="Test u"
+HOMEPAGE="http://paludis.pioto.org/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+RDEPEND="cat/w"
+
+src_install() {
+ mkdir -p ${D}${TEST_ROOT}
+ touch ${D}${TEST_ROOT}/u
+}
+END
+
+cd ..
+