summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/integration/create-test-data2
-rwxr-xr-xtest/integration/run-tests9
-rw-r--r--test/integration/status-bug-613420-new-garbage-dependency22
-rwxr-xr-xtest/integration/test-bug-254770-segfault-if-cache-not-buildable2
-rwxr-xr-xtest/integration/test-bug-330162-encoded-tar-header2
-rwxr-xr-xtest/integration/test-bug-593360-modifiers-in-names2
-rwxr-xr-xtest/integration/test-bug-601961-install-info2
-rwxr-xr-xtest/integration/test-bug-604222-new-and-autoremove2
-rwxr-xr-xtest/integration/test-bug-604401-files-are-directories2
-rwxr-xr-xtest/integration/test-bug-605394-versioned-or-groups2
-rwxr-xr-xtest/integration/test-bug-612557-garbage-upgrade2
-rwxr-xr-xtest/integration/test-bug-613420-new-garbage-dependency37
-rwxr-xr-xtest/integration/test-release-candidate-switching2
-rwxr-xr-xtest/integration/test-ubuntu-bug-365611-long-package-names2
-rw-r--r--test/libapt/globalerror_test.cc32
-rwxr-xr-xtest/libapt/run-tests2
16 files changed, 111 insertions, 13 deletions
diff --git a/test/integration/create-test-data b/test/integration/create-test-data
index 581b62910..effbe1ea3 100755
--- a/test/integration/create-test-data
+++ b/test/integration/create-test-data
@@ -6,7 +6,7 @@ if [ -z "$1" -o -z "$2" ]; then
exit 1
fi
-local TESTDIR=$(readlink -f $(dirname $0))
+TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
BUILDDIRECTORY="${TESTDIR}/../../build/bin"
diff --git a/test/integration/run-tests b/test/integration/run-tests
index 7314e6b61..edac07dbf 100755
--- a/test/integration/run-tests
+++ b/test/integration/run-tests
@@ -1,6 +1,7 @@
#!/bin/sh
set -e
+FAIL=0
DIR=$(readlink -f $(dirname $0))
if [ "$1" = "-q" ]; then
export MSGLEVEL=2
@@ -13,8 +14,14 @@ for testcase in $(run-parts --list $DIR | grep '/test-'); do
else
echo "\033[1;32mRun Testcase \033[1;35m$(basename ${testcase})\033[0m"
fi
- ${testcase}
+ if ! ${testcase}; then
+ FAIL=$((FAIL+1))
+ echo "$(basename $testcase) ... FAIL"
+ fi
if [ "$1" = "-q" ]; then
echo
fi
done
+
+echo "failures: $FAIL"
+exit $FAIL
diff --git a/test/integration/status-bug-613420-new-garbage-dependency b/test/integration/status-bug-613420-new-garbage-dependency
new file mode 100644
index 000000000..166a3930f
--- /dev/null
+++ b/test/integration/status-bug-613420-new-garbage-dependency
@@ -0,0 +1,22 @@
+Package: openoffice.org-officebean
+Status: install ok installed
+Priority: optional
+Section: java
+Installed-Size: 1656
+Maintainer: Debian OpenOffice Team <debian-openoffice@lists.debian.org>
+Architecture: i386
+Source: openoffice.org
+Version: 1:3.2.1-11+squeeze2
+Depends: openoffice.org-core (= 1:3.2.1-11+squeeze2)
+Description: office productivity suite -- Java bean
+
+Package: openoffice.org-core
+Status: install ok installed
+Priority: optional
+Section: editors
+Installed-Size: 121724
+Maintainer: Debian OpenOffice Team <debian-openoffice@lists.debian.org>
+Architecture: i386
+Source: openoffice.org
+Version: 1:3.2.1-11+squeeze2
+Description: office productivity suite -- arch-dependent files
diff --git a/test/integration/test-bug-254770-segfault-if-cache-not-buildable b/test/integration/test-bug-254770-segfault-if-cache-not-buildable
index 25c564daa..b9f45b131 100755
--- a/test/integration/test-bug-254770-segfault-if-cache-not-buildable
+++ b/test/integration/test-bug-254770-segfault-if-cache-not-buildable
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-local TESTDIR=$(readlink -f $(dirname $0))
+TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
configarchitecture "i386"
diff --git a/test/integration/test-bug-330162-encoded-tar-header b/test/integration/test-bug-330162-encoded-tar-header
index fa01e0379..b3fae6bac 100755
--- a/test/integration/test-bug-330162-encoded-tar-header
+++ b/test/integration/test-bug-330162-encoded-tar-header
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-local TESTDIR=$(readlink -f $(dirname $0))
+TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
configarchitecture "i386"
diff --git a/test/integration/test-bug-593360-modifiers-in-names b/test/integration/test-bug-593360-modifiers-in-names
index c12503b0d..83a3cfabf 100755
--- a/test/integration/test-bug-593360-modifiers-in-names
+++ b/test/integration/test-bug-593360-modifiers-in-names
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-local TESTDIR=$(readlink -f $(dirname $0))
+TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
configarchitecture "i386"
diff --git a/test/integration/test-bug-601961-install-info b/test/integration/test-bug-601961-install-info
index b91bf3615..914910597 100755
--- a/test/integration/test-bug-601961-install-info
+++ b/test/integration/test-bug-601961-install-info
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-local TESTDIR=$(readlink -f $(dirname $0))
+TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
configarchitecture "i386"
diff --git a/test/integration/test-bug-604222-new-and-autoremove b/test/integration/test-bug-604222-new-and-autoremove
index 9187dd1cd..2875d547a 100755
--- a/test/integration/test-bug-604222-new-and-autoremove
+++ b/test/integration/test-bug-604222-new-and-autoremove
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-local TESTDIR=$(readlink -f $(dirname $0))
+TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
configarchitecture "i386"
diff --git a/test/integration/test-bug-604401-files-are-directories b/test/integration/test-bug-604401-files-are-directories
index 917fb106f..aae717a19 100755
--- a/test/integration/test-bug-604401-files-are-directories
+++ b/test/integration/test-bug-604401-files-are-directories
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-local TESTDIR=$(readlink -f $(dirname $0))
+TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
configarchitecture "i386"
diff --git a/test/integration/test-bug-605394-versioned-or-groups b/test/integration/test-bug-605394-versioned-or-groups
index 0d7ad77f6..0f09d2927 100755
--- a/test/integration/test-bug-605394-versioned-or-groups
+++ b/test/integration/test-bug-605394-versioned-or-groups
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-local TESTDIR=$(readlink -f $(dirname $0))
+TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
configarchitecture "i386"
diff --git a/test/integration/test-bug-612557-garbage-upgrade b/test/integration/test-bug-612557-garbage-upgrade
index e2ffe615f..3112e618c 100755
--- a/test/integration/test-bug-612557-garbage-upgrade
+++ b/test/integration/test-bug-612557-garbage-upgrade
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-local TESTDIR=$(readlink -f $(dirname $0))
+TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
configarchitecture "i386"
diff --git a/test/integration/test-bug-613420-new-garbage-dependency b/test/integration/test-bug-613420-new-garbage-dependency
new file mode 100755
index 000000000..34cf38cbc
--- /dev/null
+++ b/test/integration/test-bug-613420-new-garbage-dependency
@@ -0,0 +1,37 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture "i386"
+
+insertpackage 'unstable' 'libreoffice' 'all' '1:3.3.1~rc1-2' 'Depends: libreoffice-core'
+insertpackage 'unstable' 'libreoffice-core' 'all' '1:3.3.1~rc1-2' 'Conflicts: openoffice.org-core'
+insertpackage 'unstable' 'libreoffice-officebean' 'all' '1:3.3.1~rc1-2' 'Depends: libreoffice-core'
+insertpackage 'unstable' 'openoffice.org-officebean' 'all' '1:3.3.0-5' 'Depends: libreoffice-officebean'
+
+
+setupaptarchive
+
+touch rootdir/var/lib/apt/extended_states
+aptmark markauto openoffice.org-officebean
+testmarkedauto openoffice.org-officebean
+
+testequal "Reading package lists...
+Building dependency tree...
+Reading state information...
+The following packages were automatically installed and are no longer required:
+ openoffice.org-officebean libreoffice-officebean
+Use 'apt-get autoremove' to remove them.
+The following extra packages will be installed:
+ libreoffice-core libreoffice-officebean openoffice.org-officebean
+The following packages will be REMOVED:
+ openoffice.org-core
+The following NEW packages will be installed:
+ libreoffice libreoffice-core libreoffice-officebean
+The following packages will be upgraded:
+ openoffice.org-officebean
+1 upgraded, 3 newly installed, 1 to remove and 0 not upgraded.
+After this operation, 126 MB disk space will be freed.
+E: Trivial Only specified but this is not a trivial operation." aptget install libreoffice --trivial-only
diff --git a/test/integration/test-release-candidate-switching b/test/integration/test-release-candidate-switching
index 5736945ab..b6dbe99db 100755
--- a/test/integration/test-release-candidate-switching
+++ b/test/integration/test-release-candidate-switching
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-local TESTDIR=$(readlink -f $(dirname $0))
+TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
configarchitecture "i386"
diff --git a/test/integration/test-ubuntu-bug-365611-long-package-names b/test/integration/test-ubuntu-bug-365611-long-package-names
index 28b55df3b..894c8dc97 100755
--- a/test/integration/test-ubuntu-bug-365611-long-package-names
+++ b/test/integration/test-ubuntu-bug-365611-long-package-names
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-local TESTDIR=$(readlink -f $(dirname $0))
+TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
configarchitecture "i386"
diff --git a/test/libapt/globalerror_test.cc b/test/libapt/globalerror_test.cc
index b2752255f..7d933f5a8 100644
--- a/test/libapt/globalerror_test.cc
+++ b/test/libapt/globalerror_test.cc
@@ -2,6 +2,7 @@
#include "assert.h"
#include <string>
+#include <errno.h>
int main(int argc,char *argv[])
{
@@ -73,5 +74,36 @@ int main(int argc,char *argv[])
equals(text, "A Warning");
equals(_error->empty(), true);
+ errno = 0;
+ equals(_error->Errno("errno", "%s horrible %s %d times", "Something", "happend", 2), false);
+ equals(_error->empty(), false);
+ equals(_error->PendingError(), true);
+ equals(_error->PopMessage(text), true);
+ equals(_error->PendingError(), false);
+ equals(text, "Something horrible happend 2 times - errno (0: Success)");
+ equals(_error->empty(), true);
+
+ std::string longText;
+ for (size_t i = 0; i < 500; ++i)
+ longText.append("a");
+ equals(_error->Error("%s horrible %s %d times", longText.c_str(), "happend", 2), false);
+ equals(_error->PopMessage(text), true);
+ equals(text, std::string(longText).append(" horrible happend 2 times"));
+
+ equals(_error->Errno("errno", "%s horrible %s %d times", longText.c_str(), "happend", 2), false);
+ equals(_error->PopMessage(text), true);
+ equals(text, std::string(longText).append(" horrible happend 2 times - errno (0: Success)"));
+
+ equals(_error->Warning("Репозиторий не обновлён и будут %d %s", 4, "test"), false);
+ equals(_error->PopMessage(text), false);
+ equals(text, "Репозиторий не обновлён и будут 4 test");
+
+ longText.clear();
+ for (size_t i = 0; i < 50; ++i)
+ longText.append("РезийбёбAZ");
+ equals(_error->Warning(longText.c_str()), false);
+ equals(_error->PopMessage(text), false);
+ equals(text, longText);
+
return 0;
}
diff --git a/test/libapt/run-tests b/test/libapt/run-tests
index a66de386d..4b71c2097 100755
--- a/test/libapt/run-tests
+++ b/test/libapt/run-tests
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-local DIR=$(readlink -f $(dirname $0))
+DIR=$(readlink -f $(dirname $0))
echo "Compiling the tests …"
test -d "$DIR/../../build/obj/test/libapt/" || mkdir -p "$DIR/../../build/obj/test/libapt/"
(cd $DIR && make)