From a0a791329b3f1cd5c1d7cfba21c634606462d37e Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sun, 6 Jul 2008 10:09:49 +0100 Subject: [PATCH] Improved multi-arch tests Check that dependencies are from the same architecture group as the main binary, even if another version would otherwise be better. --- tests/MultiArch.xml | 10 ++++++++++ tests/MultiArchLib.xml | 7 +++++++ tests/testsolver.py | 8 +++++++- 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 tests/MultiArch.xml create mode 100644 tests/MultiArchLib.xml diff --git a/tests/MultiArch.xml b/tests/MultiArch.xml new file mode 100644 index 0000000..c1a67f8 --- /dev/null +++ b/tests/MultiArch.xml @@ -0,0 +1,10 @@ + + + MultiArch + MultiArch + + + + + + diff --git a/tests/MultiArchLib.xml b/tests/MultiArchLib.xml new file mode 100644 index 0000000..34dd21e --- /dev/null +++ b/tests/MultiArchLib.xml @@ -0,0 +1,7 @@ + + + MultiArchLib + MultiArchLib + + + diff --git a/tests/testsolver.py b/tests/testsolver.py index aca12d6..c251884 100755 --- a/tests/testsolver.py +++ b/tests/testsolver.py @@ -79,6 +79,8 @@ class TestSolver(BaseTest): foo = iface_cache.get_interface('http://foo/MultiArch.xml') reader.update(foo, 'MultiArch.xml') + lib = iface_cache.get_interface('http://foo/MultiArchLib.xml') + reader.update(lib, 'MultiArchLib.xml') # On an i686 system we can only use the i486 implementation @@ -86,13 +88,17 @@ class TestSolver(BaseTest): s.solve('http://foo/MultiArch.xml', binary_arch) assert s.ready assert s.selections[foo].machine == 'i486' + assert s.selections[lib].machine == 'i486' - # On an 64 bit system we could use either, but we prefer the 64 bit implementation + # On an 64 bit system we could use either, but we prefer the 64 + # bit implementation. The i486 version of the library is newer, + # but we must pick one that is compatible with the main binary. binary_arch = arch.get_architecture('Linux', 'x86_64') s.solve('http://foo/MultiArch.xml', binary_arch) assert s.ready assert s.selections[foo].machine == 'x86_64' + assert s.selections[lib].machine == 'x86_64' def testArch(self): host_arch = arch.get_host_architecture() -- 2.11.4.GIT