summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRene Engelhard <rene@debian.org>2021-10-21 21:44:05 +0200
committergit-ubuntu importer <ubuntu-devel-discuss@lists.ubuntu.com>2021-10-22 04:26:36 +0000
commit684969978174fe5ce6c41486d3a64f1c78d6d8c6 (patch)
treef6c7b52e8ed3b96e1f73ebe0c35ebc9f674d2fb4
parent2d4e2f75da29e6e5fd05708335f13a5912e4494c (diff)
parent65c40c4ff966614e83e2f49ebbdf957c2061adb7 (diff)
Imported using git-ubuntu import.
-rw-r--r--debian/changelog8
-rw-r--r--debian/control2
-rw-r--r--debian/patches/run-tests-in-deterministic-order.diff25
-rw-r--r--debian/patches/series1
-rw-r--r--src/cppunit/TestFactoryRegistry.cpp10
5 files changed, 44 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog
index 41a0387..456ca2d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+cppunit (1.15.1-4) unstable; urgency=medium
+
+ * debian/patches/patches/run-tests-in-deterministic-order.diff: apply
+ patch from LOs copy - as name says. Also fixes LOs tests with
+ --enable-lto
+
+ -- Rene Engelhard <rene@debian.org> Thu, 21 Oct 2021 21:44:05 +0200
+
cppunit (1.15.1-3) unstable; urgency=medium
* Team upload.
diff --git a/debian/control b/debian/control
index e69d78e..c3ac435 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Homepage: https://www.freedesktop.org/wiki/Software/cppunit
Section: devel
Priority: optional
Maintainer: Debian LibreOffice Maintainers <debian-openoffice@lists.debian.org>
-Uploaders: Rene Engelhard <rene@debian.org>, Steve M. Robbins <smr@debian.org>
+Uploaders: Rene Engelhard <rene@debian.org>
Build-Depends: debhelper-compat (= 13)
Build-Depends-Indep: doxygen, graphviz
Standards-Version: 4.6.0
diff --git a/debian/patches/run-tests-in-deterministic-order.diff b/debian/patches/run-tests-in-deterministic-order.diff
new file mode 100644
index 0000000..fa4b9de
--- /dev/null
+++ b/debian/patches/run-tests-in-deterministic-order.diff
@@ -0,0 +1,25 @@
+--- a/src/cppunit/TestFactoryRegistry.cpp
++++ b/src/cppunit/TestFactoryRegistry.cpp
+@@ -143,13 +143,21 @@
+ void
+ TestFactoryRegistry::addTestToSuite( TestSuite *suite )
+ {
++ std::multimap<std::string, Test *> sorted;
+ for ( Factories::iterator it = m_factories.begin();
+ it != m_factories.end();
+ ++it )
+ {
+ TestFactory *factory = *it;
+- suite->addTest( factory->makeTest() );
++ Test *test = factory->makeTest();
++ sorted.insert({test->getName(), test});
+ }
++ // In the unlikely case of multiple Tests with identical names, those will
++ // still be added in random order:
++ for (auto const &i: sorted)
++ {
++ suite->addTest( i.second );
++ }
+ }
+
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..ac0befb
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+run-tests-in-deterministic-order.diff
diff --git a/src/cppunit/TestFactoryRegistry.cpp b/src/cppunit/TestFactoryRegistry.cpp
index f1623cc..91c4a27 100644
--- a/src/cppunit/TestFactoryRegistry.cpp
+++ b/src/cppunit/TestFactoryRegistry.cpp
@@ -143,12 +143,20 @@ TestFactoryRegistry::makeTest()
void
TestFactoryRegistry::addTestToSuite( TestSuite *suite )
{
+ std::multimap<std::string, Test *> sorted;
for ( Factories::iterator it = m_factories.begin();
it != m_factories.end();
++it )
{
TestFactory *factory = *it;
- suite->addTest( factory->makeTest() );
+ Test *test = factory->makeTest();
+ sorted.insert({test->getName(), test});
+ }
+ // In the unlikely case of multiple Tests with identical names, those will
+ // still be added in random order:
+ for (auto const &i: sorted)
+ {
+ suite->addTest( i.second );
}
}