+2004-10-10 Karl Trygve Kalleberg <karltk@gentoo.org>
+ * Added unit tests for all supported commands
+
2004-09-30 Karl Trygve Kalleberg <karltk@gentoo.org>
* Added unit tests for --help
* Added unit tests for 'files'
+- sqlite
+ - regexp comparisons
+ - check /var/log/emerge.log for database up-to-dateness
+
+
+-------------------------
- pkgquery language:
Query ::= NewStyle | OldStyle | with OldStyle NewStyle
NewStyle ::= NameVar in /RegExp/
--- /dev/null
+#! /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
# 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)
test_list() {
equery list > ${tmpfile}
- pkgs=$(cat ${tmpfile} | wc -l)
- x=$(grep "[I--]" ${tmpfile} | wc -l)
- assert_eq ${FUNCNAME} ${pkgs} ${x]
+# 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" | wc -l)
+ x=$(grep "app-shells/bash" ${tmpfile} | wc -l)
assert_ge ${FUNCNAME} $x 1
}
equery uses -a uclibc > ${tmpfile}
x=$(grep "static" ${tmpfile} | wc -l)
- assert_eq ${FUNCNAME} ${pkgs} ${x]
+ assert_ge ${FUNCNAME} ${x} 1
x=$(cat ${tmpfile} | wc -l)
assert_ge ${FUNCNAME} $x 5