aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/equery/tests/test-list.sh')
-rwxr-xr-xsrc/equery/tests/test-list.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/equery/tests/test-list.sh b/src/equery/tests/test-list.sh
new file mode 100755
index 0000000..a43048b
--- /dev/null
+++ b/src/equery/tests/test-list.sh
@@ -0,0 +1,40 @@
+#! /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