Compare commits
11 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
87f035d1fa | ||
|
|
361280b7ca | ||
|
|
514c60ea82 | ||
|
|
ddce20592f | ||
|
|
55141d8aad | ||
|
|
989836a857 | ||
|
|
902beef560 | ||
|
|
55a0dd2157 | ||
|
|
80c2931f5c | ||
|
|
beaea53af7 | ||
|
|
4266f011a5 |
5 changed files with 51 additions and 69 deletions
|
|
@ -8,7 +8,11 @@ Summary: C++ unit testing framework
|
|||
# no license in files
|
||||
License: LGPL-2.1-or-later
|
||||
Url: https://www.freedesktop.org/wiki/Software/cppunit/
|
||||
Source: http://dev-www.libreoffice.org/src/%{name}-%{version}.tar.gz
|
||||
Source: https://dev-www.libreoffice.org/src/%{name}-%{version}.tar.gz
|
||||
|
||||
# Backport patch to run tests in deterministic order
|
||||
# https://gerrit.libreoffice.org/c/cppunit/+/123963
|
||||
Patch: run-tests-in-deterministic-order.patch
|
||||
|
||||
BuildRequires: doxygen
|
||||
BuildRequires: gcc-c++
|
||||
|
|
|
|||
43
run-tests-in-deterministic-order.patch
Normal file
43
run-tests-in-deterministic-order.patch
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
From 64eaa35c2de99581e522608e841defffb4b2923b Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Bergmann <sbergman@redhat.com>
|
||||
Date: Thu, 21 Oct 2021 11:14:34 +0200
|
||||
Subject: [PATCH] Run tests in deterministic order
|
||||
|
||||
LibreOffice already benefits from this (see
|
||||
<https://git.libreoffice.org/core/+/2f2246d22e2a8ccbc1dc3e6f5243734a61edf270%5E!>
|
||||
"external/cppunit: Run tests in deterministic order", especially as otherwise
|
||||
the order in which tests happened to get run differed between --disable-lto and
|
||||
--enable-lto builds.
|
||||
|
||||
Change-Id: I87d6d7cb0f4c2f6a0ea1ac3ba3d48b4e089eb5c7
|
||||
Reviewed-on: https://gerrit.libreoffice.org/c/cppunit/+/123963
|
||||
Tested-by: Stephan Bergmann <sbergman@redhat.com>
|
||||
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
||||
---
|
||||
|
||||
diff --git a/src/cppunit/TestFactoryRegistry.cpp b/src/cppunit/TestFactoryRegistry.cpp
|
||||
index 35448a6..3b68d58 100644
|
||||
--- a/src/cppunit/TestFactoryRegistry.cpp
|
||||
+++ b/src/cppunit/TestFactoryRegistry.cpp
|
||||
@@ -143,12 +143,20 @@
|
||||
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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /tools/cppunit/Sanity/basic-test
|
||||
# Description: cppunit basic test
|
||||
# Author: Edjunior Machado <emachado@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2021 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/cppunit/Sanity/basic-test
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE hello.cpp
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Edjunior Machado <emachado@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: cppunit basic test" >> $(METADATA)
|
||||
@echo "Type: Sanity" >> $(METADATA)
|
||||
@echo "TestTime: 1h" >> $(METADATA)
|
||||
@echo "RunFor: cppunit" >> $(METADATA)
|
||||
@echo "Requires: gcc-c++ cppunit cppunit-devel" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2+" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
PURPOSE of /tools/cppunit/Sanity/basic-test
|
||||
Description: cppunit basic test
|
||||
Author: Edjunior Machado <emachado@redhat.com>
|
||||
|
|
@ -5,9 +5,10 @@ component:
|
|||
- cppunit
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
require:
|
||||
- bash
|
||||
- coreutils
|
||||
- gcc-c++
|
||||
- cppunit
|
||||
- cppunit-devel
|
||||
duration: 1h
|
||||
extra-summary: /tools/cppunit/Sanity/basic-test
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue