Added unit tests for all commands
authorkarltk <karltk@gentoo.org>
Sat, 9 Oct 2004 22:51:18 +0000 (22:51 -0000)
committerkarltk <karltk@gentoo.org>
Sat, 9 Oct 2004 22:51:18 +0000 (22:51 -0000)
svn path=/; revision=148

trunk/src/equery/ChangeLog
trunk/src/equery/TODO
trunk/src/equery/tests/run-all-tests.sh [new file with mode: 0755]
trunk/src/equery/tests/test-depends.sh
trunk/src/equery/tests/test-list.sh
trunk/src/equery/tests/test-uses.sh

index b05e9232c0e3091aa783281a839f64e0bcd950a9..8531a70dd3a376e55f45bff88706760ba0801be0 100644 (file)
@@ -1,3 +1,6 @@
+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'
index 7db2b399a30d466e2890e7a82782cecf849488f8..5f38e605d9c48cdcd11c894bfc98358fc39b5747 100644 (file)
@@ -1,3 +1,9 @@
+- 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/
diff --git a/trunk/src/equery/tests/run-all-tests.sh b/trunk/src/equery/tests/run-all-tests.sh
new file mode 100755 (executable)
index 0000000..4fe2dfe
--- /dev/null
@@ -0,0 +1,12 @@
+#! /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
index a70dcfc0fe6d9b9b7d9e6739e089b4df10ffdbbc..e46d6146777acd30a7fc38ee361fcc5605c16388 100755 (executable)
@@ -13,7 +13,7 @@ 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)
index fae54269cc880638c4db48c64dd017f67e8163d1..a43048b29b4f0a9c1cea392e3a98bdab1abb1b13 100755 (executable)
@@ -12,11 +12,12 @@ tmpfile=$(tempfilename)
 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
 }
 
index f03e786638b617a94f3fb9699ee9df58ac068399..d6944838d3b3cf03700180685fee0818d97ce187 100755 (executable)
@@ -24,7 +24,7 @@ test_uses_all() {
        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