]> git.saurik.com Git - apt.git/blobdiff - test/integration/framework
various changes to increase test-coverage
[apt.git] / test / integration / framework
index 3bf6012bad70f211548b642d2e1e798eb0e963ce..322c74a211923c374a4d9a52dc0b56e91994bb41 100644 (file)
@@ -1592,29 +1592,30 @@ testfailure() {
        msggroup
 }
 
        msggroup
 }
 
-testsuccessequal() {
-       msggroup 'testsuccessequal'
-       local CMP="$1"
-       shift
-       testsuccess "$@"
-       testfileequal "${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccess.output" "$CMP"
+testreturnstateequal() {
+       local STATE="$1"
+       msggroup "${STATE}equal"
+       if [ "$2" != '--nomsg' ]; then
+               local CMP="$2"
+               shift 2
+               "$STATE" "$@"
+               testfileequal "${TMPWORKINGDIRECTORY}/rootdir/tmp/${STATE}.output" "$CMP"
+       else
+               local CMP="$3"
+               shift 3
+               "$STATE" --nomsg "$@"
+               testfileequal "${TMPWORKINGDIRECTORY}/rootdir/tmp/${STATE}.output" "$CMP"
+       fi
        msggroup
 }
        msggroup
 }
+testsuccessequal() {
+       testreturnstateequal 'testsuccess' "$@"
+}
 testwarningequal() {
 testwarningequal() {
-       msggroup 'testwarningequal'
-       local CMP="$1"
-       shift
-       testwarning "$@"
-       testfileequal "${TMPWORKINGDIRECTORY}/rootdir/tmp/testwarning.output" "$CMP"
-       msggroup
+       testreturnstateequal 'testwarning' "$@"
 }
 testfailureequal() {
 }
 testfailureequal() {
-       msggroup 'testfailureequal'
-       local CMP="$1"
-       shift
-       testfailure "$@"
-       testfileequal "${TMPWORKINGDIRECTORY}/rootdir/tmp/testfailure.output" "$CMP"
-       msggroup
+       testreturnstateequal 'testfailure' "$@"
 }
 
 testfailuremsg() {
 }
 
 testfailuremsg() {