diff options
author | Mike Frysinger <vapier@gentoo.org> | 2012-01-04 06:18:51 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2012-01-04 06:18:51 +0000 |
commit | c250f07381f6c223845f7e75e3aa45d868716c04 (patch) | |
tree | e9d88babf361fb45194337aa91dae38679ac3378 /eclass/tests | |
parent | media-libs/gegl: Remove dependency on GTK+ (diff) | |
download | historical-c250f07381f6c223845f7e75e3aa45d868716c04.tar.gz historical-c250f07381f6c223845f7e75e3aa45d868716c04.tar.bz2 historical-c250f07381f6c223845f7e75e3aa45d868716c04.zip |
add tests for savedconfig.eclass:save_config()
Diffstat (limited to 'eclass/tests')
-rwxr-xr-x | eclass/tests/savedconfig.sh | 31 | ||||
-rw-r--r-- | eclass/tests/tests-common.sh | 18 |
2 files changed, 49 insertions, 0 deletions
diff --git a/eclass/tests/savedconfig.sh b/eclass/tests/savedconfig.sh new file mode 100755 index 000000000000..997255150ca9 --- /dev/null +++ b/eclass/tests/savedconfig.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +source tests-common.sh + +inherit savedconfig + +sc() { EBUILD_PHASE=install save_config "$@" ; } +rc() { EBUILD_PHASE=prepare restore_config "$@" ; } + +tbegin "simple save_config" +sc $0 >/dev/null +ret=$? +[[ -f ${ED}/etc/portage/savedconfig/${CATEGORY}/${PF} ]] +tend $(( ret + $? )) +rm -rf "${ED}/etc" + +tbegin "multi save_config" +sc *.sh >/dev/null +ret=$? +[[ -d ${ED}/etc/portage/savedconfig/${CATEGORY}/${PF} ]] +tend $(( ret + $? )) +rm -rf "${ED}/etc" + +tbegin "dir save_config" +sc CVS >/dev/null +ret=$? +[[ -d ${ED}/etc/portage/savedconfig/${CATEGORY}/${PF} ]] +tend $(( ret + $? )) +rm -rf "${ED}/etc" + +texit diff --git a/eclass/tests/tests-common.sh b/eclass/tests/tests-common.sh index c976e29aee56..f26b56aa8ef9 100644 --- a/eclass/tests/tests-common.sh +++ b/eclass/tests/tests-common.sh @@ -93,6 +93,7 @@ tbegin() { ebegin "Testing $*" } texit() { + rm -rf "${tmpdir}" exit ${tret} } tend() { @@ -104,3 +105,20 @@ t() { : $(( tret |= ${ret} )) return ${ret} } + +tmpdir="${PWD}/tmp" +D="${tmpdir}/$0/${RANDOM}" +ED=${D} +mkdir -p "${D}" + +dodir() { + mkdir -p "${@/#/${ED}/}" +} + +elog() { einfo "$@" ; } + +CATEGORY="dev-eclass" +PN="tests" +PV="0" +P="${PN}-${PV}" +PF=${P} |