diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2017-04-15 17:40:17 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2017-04-15 17:40:17 +0200 |
commit | d21565347c01139c03ddfccffa67a756b9436f4a (patch) | |
tree | 4c8340086c9adf7e36425a13bf1a9117b886a295 | |
parent | 355b457c97a55c9ee16ef2f81fc06d49c47c129b (diff) |
Simplify test setup
-rw-r--r-- | test/lib/common.sh (renamed from test/lib/common.inc) | 34 | ||||
-rwxr-xr-x | test/runTest | 2 |
2 files changed, 7 insertions, 29 deletions
diff --git a/test/lib/common.inc b/test/lib/common.sh index d1ea100..07e533e 100644 --- a/test/lib/common.inc +++ b/test/lib/common.sh @@ -6,18 +6,7 @@ TMPDIR="$(mktemp -d /tmp/${0##*/}.XXXXXXXXXX)" . "$(dirname ${BASH_SOURCE[0]})/../../db-functions" signpkg() { - if [[ -r '/etc/makepkg.conf' ]]; then - source '/etc/makepkg.conf' - else - die '/etc/makepkg.conf not found!' - fi - if [[ -r ~/.makepkg.conf ]]; then - . ~/.makepkg.conf - fi - if [[ -n $GPGKEY ]]; then - SIGNWITHKEY="-u ${GPGKEY}" - fi - gpg --detach-sign --use-agent ${SIGNWITHKEY} ${@} || die + gpg --detach-sign --no-armor --use-agent ${@} || die } oneTimeSetUp() { @@ -33,25 +22,14 @@ oneTimeSetUp() { msg 'Building packages...' for d in "${pkgdir}"/*; do pushd $d >/dev/null - pkgname=($(. PKGBUILD; echo ${pkgname[@]})) pkgarch=($(. PKGBUILD; echo ${arch[@]})) - pkgversion=$(. PKGBUILD; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel})) - build=true - for a in ${pkgarch[@]}; do - for p in ${pkgname[@]}; do - [ ! -f ${p}-${pkgversion}-${a}${PKGEXT} ] && build=false + if [ "${pkgarch[0]}" == 'any' ]; then + makepkg -cCf || die 'makepkg failed' + else + for a in ${pkgarch[@]}; do + CARCH=${a} makepkg -cCf || die "makepkg failed" done - done - - if ! ${build}; then - if [ "${pkgarch[0]}" == 'any' ]; then - makepkg -cCf || die 'makepkg failed' - else - for a in ${pkgarch[@]}; do - CARCH=${a} makepkg -cCf || die "makepkg failed" - done - fi fi popd >/dev/null done diff --git a/test/runTest b/test/runTest index adeb84e..ae1fbe5 100755 --- a/test/runTest +++ b/test/runTest @@ -5,7 +5,7 @@ curdir=$(readlink -e $(dirname $0)) testSuite=$(mktemp) trap "rm -rf '${testSuite}'" EXIT -echo ". ${curdir}/lib/common.inc" > ${testSuite} +echo ". ${curdir}/lib/common.sh" > ${testSuite} cat "${curdir}/test.d"/*.sh >> ${testSuite} echo ". ${curdir}/lib/shunit2" >> ${testSuite} |