diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2010-08-07 20:05:58 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2010-08-07 20:05:58 +0200 |
commit | 66ae94cafb62da09da77712269f411f095dd81fc (patch) | |
tree | c77e1cdcc841b3922ba2b4c56aba585714915141 /test | |
parent | 1d903977850d8e8a22f8246994e72b0ef101eb76 (diff) | |
download | dbscripts-66ae94cafb62da09da77712269f411f095dd81fc.tar.gz dbscripts-66ae94cafb62da09da77712269f411f095dd81fc.tar.xz |
add an initial set of tests
Diffstat (limited to 'test')
-rwxr-xr-x | test/runTest | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/test/runTest b/test/runTest new file mode 100755 index 0000000..1d54ea4 --- /dev/null +++ b/test/runTest @@ -0,0 +1,66 @@ +#!/bin/bash + +curdir=$(readlink -e $(dirname $0)) +. "${curdir}/lib/common.inc" + + +testAddSimplePackages() { + local arches=('i686' 'x86_64') + local pkgs=('pkg-simple-a' 'pkg-simple-b') + local pkgbase + + for pkgbase in ${pkgs[@]}; do + for arch in ${arches[@]}; do + releasePackage extra ${pkgbase} ${arch} + done + done + + ../db-update extra + + for pkgbase in ${pkgs[@]}; do + for arch in ${arches[@]}; do + checkPackage extra ${pkgbase}-1-1-${arch}.pkg.tar.xz ${arch} + done + done +} + +testAddAnyPackages() { + local pkgs=('pkg-any-a' 'pkg-any-b') + local pkgbase + + for pkgbase in ${pkgs[@]}; do + releasePackage extra ${pkgbase} any + done + + ../db-update extra + + for pkgbase in ${pkgs[@]}; do + checkAnyPackage extra ${pkgbase}-1-1-any.pkg.tar.xz + done +} + +testAddSplitPackages() { + local arches=('i686' 'x86_64') + local pkgs=('pkg-split-a' 'pkg-split-b') + local pkg + local pkgbase + + for pkgbase in ${pkgs[@]}; do + for arch in ${arches[@]}; do + releasePackage extra ${pkgbase} ${arch} + done + done + + ../db-update extra + + for pkgbase in ${pkgs[@]}; do + for arch in ${arches[@]}; do + for pkg in "${pkgdir}/${pkgbase}"/*-${arch}.pkg.tar.*; do + checkPackage extra $(basename ${pkg}) ${arch} + done + done + done +} + + +. "${curdir}/lib/shunit2" |