diff options
Diffstat (limited to 'src/equery/tests')
26 files changed, 0 insertions, 570 deletions
diff --git a/src/equery/tests/common-functions.sh b/src/equery/tests/common-functions.sh deleted file mode 100644 index f065a0a..0000000 --- a/src/equery/tests/common-functions.sh +++ /dev/null @@ -1,52 +0,0 @@ -#! /bin/bash -# -# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org> -# Copyright (c) 2004, Gentoo Foundation -# -# Licensed under the GNU General Public License, v2 - -function tempfilename() { - fn=$(date "+%s") - if [ ! -f ${fn}.tmp ] ; then - echo ${fn}.tmp - fi -} - -function report_pass() { - printf "%-40s - passed\n" ${1} -} - -function report_failure() { - printf "%-40s - FAILED!\n" ${1} -} - -function assert_samefile() { - diff $2 $3 && report_pass $1 || report_failure $1 -} - -function assert_eq() { - if [ $2 -eq $3 ] ; then - report_pass $1 - else - printf "FAIL: $2 ! -eq $3\n" - report_failure $1 - fi -} - -function assert_ge() { - if [ $2 -ge $3 ] ; then - report_pass $1 - else - printf "FAIL: $2 ! -ge $3\n" - report_failure $1 - fi -} - -function assert_exists() { - if [ -f $2 ] ; then - report_pass $1 - else - printf "FAIL: $2 does not exist\n" - report_failure $1 - fi -}
\ No newline at end of file diff --git a/src/equery/tests/run-all-tests.sh b/src/equery/tests/run-all-tests.sh deleted file mode 100755 index 4fe2dfe..0000000 --- a/src/equery/tests/run-all-tests.sh +++ /dev/null @@ -1,12 +0,0 @@ -#! /bin/bash -# -# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org> -# Copyright (c) 2004, Gentoo Foundation -# -# Licensed under the GNU General Public License, v2 - -. common-functions.sh - -for x in belongs check depends depgraph files help list size uses which ; do - ./test-${x}.sh -done diff --git a/src/equery/tests/test-belongs-help.out b/src/equery/tests/test-belongs-help.out deleted file mode 100644 index 0d2f583..0000000 --- a/src/equery/tests/test-belongs-help.out +++ /dev/null @@ -1,11 +0,0 @@ -List all packages owning a particular set of files - -Note: Normally, only one package will own a file. If multiple packages own the same file, it usually consitutes a problem, and should be reported. - -Syntax: - belongs <local-opts> filename -<local-opts> is either of: - -c, --category cat - only search in category cat - -f, --full-regex - supplied query is a regex - -e, --earlyout - stop when first match is found - diff --git a/src/equery/tests/test-belongs.sh b/src/equery/tests/test-belongs.sh deleted file mode 100755 index bd0eac4..0000000 --- a/src/equery/tests/test-belongs.sh +++ /dev/null @@ -1,24 +0,0 @@ -#! /bin/bash -# -# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org> -# Copyright (c) 2004, Gentoo Foundation -# -# Licensed under the GNU General Public License, v2 - -. common-functions.sh - -tmpfile=$(tempfilename) - -test_belongs() { - equery belongs $(which gcc) > ${tmpfile} - - x=$(grep "gcc-config" ${tmpfile} | wc -l) - - assert_eq ${FUNCNAME} ${x} 1 -} - -# Run tests - -test_belongs - -rm -f ${tmpfile}
\ No newline at end of file diff --git a/src/equery/tests/test-changes-help.out b/src/equery/tests/test-changes-help.out deleted file mode 100644 index e69de29..0000000 --- a/src/equery/tests/test-changes-help.out +++ /dev/null diff --git a/src/equery/tests/test-check-help.out b/src/equery/tests/test-check-help.out deleted file mode 100644 index 1e6afcf..0000000 --- a/src/equery/tests/test-check-help.out +++ /dev/null @@ -1,3 +0,0 @@ -Check package's files against recorded MD5 sums and timestamps -Syntax: - size pkgspec diff --git a/src/equery/tests/test-check.sh b/src/equery/tests/test-check.sh deleted file mode 100755 index 803299f..0000000 --- a/src/equery/tests/test-check.sh +++ /dev/null @@ -1,39 +0,0 @@ -#! /bin/bash -# -# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org> -# Copyright (c) 2004, Gentoo Foundation -# -# Licensed under the GNU General Public License, v2 - -. common-functions.sh - -tmpfile=$(tempfilename) - -test_check() { - equery check gcc > ${tmpfile} - - x=$(grep "sys-devel/gcc" ${tmpfile} | wc -l) - - assert_ge ${FUNCNAME} ${x} 1 - - x=$(egrep "[0-9]+ out of [0-9]+" ${tmpfile} | wc -l) - assert_ge ${FUNCNAME} ${x} 1 -} - -test_check_permissions() { - equery check sudo > ${tmpfile} - - x=$(grep "app-admin/sudo" ${tmpfile} | wc -l) - - assert_ge ${FUNCNAME} ${x} 1 - - x=$(egrep "[0-9]+ out of [0-9]+" ${tmpfile} | wc -l) - assert_ge ${FUNCNAME} ${x} 1 -} - -# Run tests - -test_check -test_check_permissions - -rm -f ${tmpfile} diff --git a/src/equery/tests/test-depends-help.out b/src/equery/tests/test-depends-help.out deleted file mode 100644 index 356cd53..0000000 --- a/src/equery/tests/test-depends-help.out +++ /dev/null @@ -1,8 +0,0 @@ -List all direct dependencies matching a query pattern -Syntax: - depends <local-opts> pkgspec -<local-opts> is either of: - -d, --direct - search direct dependencies only (default) - -D, --indirect - search indirect dependencies (VERY slow) - -i, --only-installed - search installed in installed packages only - diff --git a/src/equery/tests/test-depends.sh b/src/equery/tests/test-depends.sh deleted file mode 100755 index e46d614..0000000 --- a/src/equery/tests/test-depends.sh +++ /dev/null @@ -1,27 +0,0 @@ -#! /bin/bash -# -# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org> -# Copyright (c) 2004, Gentoo Foundation -# -# Licensed under the GNU General Public License, v2 - -. common-functions.sh - -tmpfile=$(tempfilename) - -test_depends() { -# equery skel gcc > ${tmpfile} - -# x=$(grep "app-shells/bash" ${tmpfile} | wc -l) - true -# assert_eq ${FUNCNAME} ${x} 1 - -# x=$(grep "virtual/libc" ${tmpfile} | wc -l) -# assert_eq ${FUNCNAME} ${x} 1 -} - -# Run tests - -#test_skel - -rm -f ${tmpfile}
\ No newline at end of file diff --git a/src/equery/tests/test-depgraph-help.out b/src/equery/tests/test-depgraph-help.out deleted file mode 100644 index 5b9fd22..0000000 --- a/src/equery/tests/test-depgraph-help.out +++ /dev/null @@ -1,7 +0,0 @@ -Display a dependency tree for a given package - -Syntax: - depgraph <local-opts> pkgspec -<local-opts> is either of: - -U, --no-useflags - do not show USE flags - -l, --linear - do not use fancy formatting diff --git a/src/equery/tests/test-depgraph.sh b/src/equery/tests/test-depgraph.sh deleted file mode 100755 index 016bb37..0000000 --- a/src/equery/tests/test-depgraph.sh +++ /dev/null @@ -1,27 +0,0 @@ -#! /bin/bash -# -# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org> -# Copyright (c) 2004, Gentoo Foundation -# -# Licensed under the GNU General Public License, v2 - -. common-functions.sh - -tmpfile=$(tempfilename) - -test_depgraph() { - equery depgraph gcc > ${tmpfile} - - x=$(grep "app-shells/bash" ${tmpfile} | wc -l) - - assert_eq ${FUNCNAME} ${x} 1 - - x=$(grep "virtual/libc" ${tmpfile} | wc -l) - assert_eq ${FUNCNAME} ${x} 1 -} - -# Run tests - -test_depgraph - -rm -f ${tmpfile}
\ No newline at end of file diff --git a/src/equery/tests/test-files-help.out b/src/equery/tests/test-files-help.out deleted file mode 100644 index 846151f..0000000 --- a/src/equery/tests/test-files-help.out +++ /dev/null @@ -1,11 +0,0 @@ -List files owned by a particular package - -Syntax: - files <local-opts> <cat/>packagename<-version> - -Note: category and version parts are optional. - -<local-opts> is either of: - --timestamp - append timestamp - --md5sum - append md5sum - --type - prepend file type diff --git a/src/equery/tests/test-files.sh b/src/equery/tests/test-files.sh deleted file mode 100755 index ad0a5ea..0000000 --- a/src/equery/tests/test-files.sh +++ /dev/null @@ -1,61 +0,0 @@ -#! /bin/bash -# -# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org> -# Copyright (c) 2004, Gentoo Foundation -# -# Licensed under the GNU General Public License, v2 - -. common-functions.sh - -tmpfile=$(tempfilename) - -strip_versioned_files() { - grep -v "/usr/share/doc" -} - -test_files() { - equery files bash > ${tmpfile} - - x=$(grep man ${tmpfile} | wc -l) - assert_ge ${FUNCNAME} $x 5 - - x=$(cat ${tmpfile} | wc -l) - assert_ge ${FUNCNAME} $x 25 -} - -test_files_timestamp() { - equery files --timestamp bash > ${tmpfile} - - x=$(grep "/bin/bash .*....-..-.. ..:..:.." ${tmpfile} | wc -l) - assert_eq ${FUNCNAME} $x 1 -} - -test_files_md5sum() { - equery files --md5sum bash > ${tmpfile} - - x=$(egrep "/bin/bash .*[0-9a-z]{30}" ${tmpfile} | wc -l) - assert_eq ${FUNCNAME} $x 1 -} - -test_files_type() { - - equery files --type bash > ${tmpfile} - - x=$(grep "file.*/bin/bash$" ${tmpfile} | wc -l) - assert_eq ${FUNCNAME} $x 1 - - x=$(grep "symlink.*/bin/rbash" ${tmpfile} | wc -l) - assert_eq ${FUNCNAME} $x 1 - - x=$(grep "dir.*/usr/share/man" ${tmpfile} | wc -l) - assert_ge ${FUNCNAME} $x 1 -} - -# Run tests - -test_files -test_files_timestamp -test_files_md5sum -test_files_type - -rm ${tmpfile}
\ No newline at end of file diff --git a/src/equery/tests/test-glsa-help.out b/src/equery/tests/test-glsa-help.out deleted file mode 100644 index e69de29..0000000 --- a/src/equery/tests/test-glsa-help.out +++ /dev/null diff --git a/src/equery/tests/test-hasuses-help.out b/src/equery/tests/test-hasuses-help.out deleted file mode 100644 index 1a05645..0000000 --- a/src/equery/tests/test-hasuses-help.out +++ /dev/null @@ -1,9 +0,0 @@ -List all packages with a particular USE flag -Syntax: - list <local-opts> useflag -<local-opts> is either of: - -i, --installed - search installed packages (default) - -I, --exclude-installed - do not search installed packages - -p, --portage-tree - also search in portage tree (/usr/portage) - -o, --overlay-tree - also search in overlay tree (/usr/local/portage /usr/local/overlays/gentoo-boblycat) - diff --git a/src/equery/tests/test-help.out b/src/equery/tests/test-help.out deleted file mode 100644 index 26517f4..0000000 --- a/src/equery/tests/test-help.out +++ /dev/null @@ -1,21 +0,0 @@ -Usage: equery <global-opts> command <local-opts> -where <global-opts> is one of - -q, --quiet - minimal output - -C, --nocolor - turn off colours - -h, --help - this help screen - -V, --version - display version info -where command(short) is one of - belongs(b) <local-opts> files... - list all packages owning files... - changes(c) - not implemented yet - check(k) pkgspec - check MD5sums and timestamps of pkgspec's files - depends(d) <local-opts> pkgspec - list all direct dependencies matching pkgspec - depgraph(g) <local-opts> pkgspec - display a dependency tree for pkgspec - files(f) <local-opts> pkgspec - list files owned by pkgspec - glsa(a) - not implemented yet - hasuses(h) <local-opts> pkgspec - list all packages with useflag - list(l) <local-opts> pkgspec - list all packages matching pkgspec - size(s) <local-opts> pkgspec - print size of files contained in package pkgspec - stats(t) - not implemented yet - uses(u) <local-opts> pkgspec - display USE flags for pkgspec - which(w) pkgspec - print full path to ebuild for package pkgspec - diff --git a/src/equery/tests/test-help.sh b/src/equery/tests/test-help.sh deleted file mode 100755 index 618aac1..0000000 --- a/src/equery/tests/test-help.sh +++ /dev/null @@ -1,105 +0,0 @@ -#! /bin/sh -# -# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org> -# Copyright (c) 2004, Gentoo Foundation -# -# Licensed under the GNU General Public License, v2 - -. common-functions.sh - -tmpfile=$(tempfilename) - -test_equery_help() { - equery --help > ${tmpfile} - assert_samefile ${FUNCNAME} ${tmpfile} test-help.out - -} - -test_belongs_help() { - equery belongs --help > ${tmpfile} - assert_samefile ${FUNCNAME} ${tmpfile} test-belongs-help.out -} - -test_changes_help() { - equery changes --help > ${tmpfile} - assert_samefile ${FUNCNAME} ${tmpfile} test-changes-help.out -} - -test_check_help() { - equery check --help > ${tmpfile} - assert_samefile ${FUNCNAME} ${tmpfile} test-check-help.out -} - -test_depends_help() { - equery depends --help > ${tmpfile} - assert_samefile ${FUNCNAME} ${tmpfile} test-depends-help.out -} - -test_depgraph_help() { - equery depgraph --help > ${tmpfile} - assert_samefile ${FUNCNAME} ${tmpfile} test-depgraph-help.out -} - -test_files_help() { - equery files --help > ${tmpfile} - assert_samefile ${FUNCNAME} ${tmpfile} test-files-help.out -} - -test_glsa_help() { - equery glsa --help > ${tmpfile} - assert_samefile ${FUNCNAME} ${tmpfile} test-glsa-help.out -} - -test_hasuses_help() { - equery hasuses --help > ${tmpfile} - assert_samefile ${FUNCNAME} ${tmpfile} test-hasuses-help.out -} - -test_list_help() { - equery list --help > ${tmpfile} - assert_samefile ${FUNCNAME} ${tmpfile} test-list-help.out -} - -test_size_help() { - equery size --help > ${tmpfile} - assert_samefile ${FUNCNAME} ${tmpfile} test-size-help.out -} - -test_stats_help() { - equery stats --help > ${tmpfile} - assert_samefile ${FUNCNAME} ${tmpfile} test-stats-help.out -} - -test_uses_help() { - equery uses --help > ${tmpfile} - assert_samefile ${FUNCNAME} ${tmpfile} test-uses-help.out -} - -test_which_help() { - equery which --help > ${tmpfile} - assert_samefile ${FUNCNAME} ${tmpfile} test-which-help.out -} - - -# run tests - -if [ "`hostname`" != "sky" ] ; then - echo "Testing framework is beta and machine dependent; some tests will fail!" -fi - -test_equery_help -test_belongs_help -test_check_help -test_changes_help -test_depends_help -test_depgraph_help -test_files_help -test_glsa_help -test_hasuses_help -test_list_help -test_size_help -test_stats_help -test_uses_help -test_which_help - -rm -f *.tmp
\ No newline at end of file diff --git a/src/equery/tests/test-list-help.out b/src/equery/tests/test-list-help.out deleted file mode 100644 index 82d1fb0..0000000 --- a/src/equery/tests/test-list-help.out +++ /dev/null @@ -1,9 +0,0 @@ -List all packages matching a query pattern -Syntax: - list <local-opts> pkgspec -<local-opts> is either of: - -i, --installed - search installed packages (default) - -I, --exclude-installed - do not search installed packages - -p, --portage-tree - also search in portage tree (/usr/portage) - -o, --overlay-tree - also search in overlay tree (/usr/local/portage /usr/local/overlays/gentoo-boblycat) - diff --git a/src/equery/tests/test-list.sh b/src/equery/tests/test-list.sh deleted file mode 100755 index a43048b..0000000 --- a/src/equery/tests/test-list.sh +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/bash -# -# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org> -# Copyright (c) 2004, Gentoo Foundation -# -# Licensed under the GNU General Public License, v2 - -. common-functions.sh - -tmpfile=$(tempfilename) - -test_list() { - equery list > ${tmpfile} - -# should test tty output as well -# pkgs=$(cat ${tmpfile} | wc -l) -# x=$(grep "[I--]" ${tmpfile} | wc -l) -# assert_eq ${FUNCNAME} ${pkgs} ${x} - - x=$(grep "app-shells/bash" ${tmpfile} | wc -l) - assert_ge ${FUNCNAME} $x 1 -} - -test_list_installed() { - test_list -} - -test_list_portage_tree() { - equery list -I -p > ${tmpfile} -} - -test_list_overlay_tree() { - equery list -I -o > ${tmpfile} -} - -# Run tests - -test_list - -rm -f ${tmpfile}
\ No newline at end of file diff --git a/src/equery/tests/test-size-help.out b/src/equery/tests/test-size-help.out deleted file mode 100644 index c0c63a4..0000000 --- a/src/equery/tests/test-size-help.out +++ /dev/null @@ -1,6 +0,0 @@ -Print size total size of files contained in a given package -Syntax: - size <local-opts> pkgspec -<local-opts> is either of: - -b, --bytes - report size in bytes - diff --git a/src/equery/tests/test-size.sh b/src/equery/tests/test-size.sh deleted file mode 100755 index 126a5db..0000000 --- a/src/equery/tests/test-size.sh +++ /dev/null @@ -1,27 +0,0 @@ -#! /bin/bash -# -# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org> -# Copyright (c) 2004, Gentoo Foundation -# -# Licensed under the GNU General Public License, v2 - -. common-functions.sh - -tmpfile=$(tempfilename) - -test_size() { - equery size gcc > ${tmpfile} - - x=$(grep "sys-devel/gcc" ${tmpfile} | wc -l) - - assert_ge ${FUNCNAME} ${x} 1 - - x=$(egrep "size\([0-9]+\)" ${tmpfile} | wc -l) - assert_ge ${FUNCNAME} ${x} 1 -} - -# Run tests - -test_size - -rm -f ${tmpfile}
\ No newline at end of file diff --git a/src/equery/tests/test-stats-help.out b/src/equery/tests/test-stats-help.out deleted file mode 100644 index e69de29..0000000 --- a/src/equery/tests/test-stats-help.out +++ /dev/null diff --git a/src/equery/tests/test-uses-help.out b/src/equery/tests/test-uses-help.out deleted file mode 100644 index d350e00..0000000 --- a/src/equery/tests/test-uses-help.out +++ /dev/null @@ -1,7 +0,0 @@ -Display USE flags for a given package - -Syntax: - uses <local-opts> pkgspec -<local-opts> is either of: - -a, --all - include non-installed packages - diff --git a/src/equery/tests/test-uses.sh b/src/equery/tests/test-uses.sh deleted file mode 100755 index d694483..0000000 --- a/src/equery/tests/test-uses.sh +++ /dev/null @@ -1,39 +0,0 @@ -#! /bin/bash -# -# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org> -# Copyright (c) 2004, Gentoo Foundation -# -# Licensed under the GNU General Public License, v2 - -. common-functions.sh - -tmpfile=$(tempfilename) - -test_uses() { - equery uses gcc > ${tmpfile} - - x=$(grep "static" ${tmpfile} | wc -l) - - assert_eq ${FUNCNAME} ${x} 1 - - x=$(cat ${tmpfile} | wc -l) - assert_ge ${FUNCNAME} $x 7 -} - -test_uses_all() { - equery uses -a uclibc > ${tmpfile} - - x=$(grep "static" ${tmpfile} | wc -l) - assert_ge ${FUNCNAME} ${x} 1 - - x=$(cat ${tmpfile} | wc -l) - assert_ge ${FUNCNAME} $x 5 - -} - -# Run tests - -test_uses -test_uses_all - -rm -f ${tmpfile}
\ No newline at end of file diff --git a/src/equery/tests/test-which-help.out b/src/equery/tests/test-which-help.out deleted file mode 100644 index 8bf337e..0000000 --- a/src/equery/tests/test-which-help.out +++ /dev/null @@ -1,3 +0,0 @@ -Print full path to ebuild for a given package -Syntax: - size pkgspec diff --git a/src/equery/tests/test-which.sh b/src/equery/tests/test-which.sh deleted file mode 100755 index 491868f..0000000 --- a/src/equery/tests/test-which.sh +++ /dev/null @@ -1,22 +0,0 @@ -#! /bin/bash -# -# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org> -# Copyright (c) 2004, Gentoo Foundation -# -# Licensed under the GNU General Public License, v2 - -. common-functions.sh - -tmpfile=$(tempfilename) - -test_which() { - file=$(equery which gcc) - - assert_exists ${FUNCNAME} ${file} -} - -# Run tests - -test_which - -rm -f ${tmpfile}
\ No newline at end of file |
