diff options
Diffstat (limited to 'src/equery/tests/test-uses.sh')
-rwxr-xr-x | src/equery/tests/test-uses.sh | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/equery/tests/test-uses.sh b/src/equery/tests/test-uses.sh new file mode 100755 index 0000000..d694483 --- /dev/null +++ b/src/equery/tests/test-uses.sh @@ -0,0 +1,39 @@ +#! /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 |