From 974f61844350c20bceb3d3fc177732e11e27a0f2 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Wed, 22 May 2024 18:07:23 +0200 Subject: [PATCH] Update .clang-format --- .clang-format | 4 +++- include/podio/CollectionBufferFactory.h | 6 +++--- include/podio/GenericParameters.h | 4 ++-- include/podio/RNTupleReader.h | 13 +++++++------ include/podio/RNTupleWriter.h | 11 ++++++----- include/podio/ROOTLegacyReader.h | 3 +-- include/podio/ROOTReader.h | 14 +++++++------- include/podio/ROOTWriter.h | 10 +++++----- include/podio/SIOBlock.h | 15 ++++++++------- include/podio/SIOBlockUserData.h | 15 ++++++++------- include/podio/SIOFrameData.h | 15 ++++++++------- include/podio/SIOLegacyReader.h | 13 +++++++------ include/podio/SIOReader.h | 13 +++++++------ include/podio/SIOWriter.h | 9 +++++---- include/podio/UserDataCollection.h | 12 ++++++------ .../utilities/DatamodelRegistryIOHelpers.h | 4 ++-- python/CMakeLists.txt | 10 ++++++++-- src/CollectionBufferFactory.cc | 4 ++-- src/CollectionIDTable.cc | 4 ++-- src/DatamodelRegistryIOHelpers.cc | 6 +++--- src/RNTupleReader.cc | 17 +++++++++-------- src/RNTupleWriter.cc | 15 ++++++++------- src/ROOTLegacyReader.cc | 10 +++++----- src/ROOTReader.cc | 16 ++++++++-------- src/ROOTWriter.cc | 12 ++++++------ src/SIOBlock.cc | 12 ++++++------ src/SIOFrameData.cc | 11 ++++++----- src/SIOLegacyReader.cc | 11 ++++++----- src/SIOReader.cc | 11 ++++++----- src/SIOWriter.cc | 11 ++++++----- src/SchemaEvolution.cc | 4 ++-- src/UserDataCollection.cc | 8 ++++---- src/rootUtils.h | 5 ++--- src/test_hashes.cpp | 4 ++-- tests/ostream_operator.cpp | 4 ++-- tests/read_frame.h | 4 +--- tests/read_frame_auxiliary.h | 1 - tests/read_python_frame.h | 1 - tests/root_io/read_and_write_associated.cpp | 12 ++++++------ tests/root_io/read_and_write_frame_root.cpp | 4 ++-- tests/root_io/read_frame_legacy_root.cpp | 8 ++++---- tests/root_io/read_frame_root.cpp | 3 +-- tests/root_io/read_frame_root_multiple.cpp | 12 ++++++------ tests/root_io/read_python_frame_rntuple.cpp | 4 ++-- tests/root_io/read_python_frame_root.cpp | 4 ++-- tests/root_io/read_rntuple.cpp | 4 ++-- tests/root_io/relation_range.cpp | 16 ++++++++-------- tests/root_io/write_frame_root.cpp | 4 ++-- tests/root_io/write_rntuple.cpp | 4 ++-- tests/schema_evolution/read_new_data.h | 1 - .../root_io/read_new_data_root.cpp | 4 ++-- .../root_io/write_old_data_root.cpp | 4 ++-- tests/schema_evolution/write_old_data.h | 1 - tests/sio_io/read_and_write_frame_sio.cpp | 4 ++-- tests/sio_io/read_frame_legacy_sio.cpp | 8 ++++---- tests/sio_io/read_frame_sio.cpp | 4 ++-- tests/sio_io/read_python_frame_sio.cpp | 4 ++-- tests/sio_io/write_frame_sio.cpp | 4 ++-- tests/unittests/buffer_factory.cpp | 10 +++++----- tests/unittests/frame.cpp | 19 ++++++++++--------- tests/unittests/interface_types.cpp | 6 +++--- tests/unittests/unittest.cpp | 17 +++++++++-------- tests/write_frame.h | 5 +---- 63 files changed, 260 insertions(+), 248 deletions(-) diff --git a/.clang-format b/.clang-format index a22e5e692..5fbcc3077 100644 --- a/.clang-format +++ b/.clang-format @@ -59,8 +59,10 @@ ForEachMacros: - foreach - Q_FOREACH - BOOST_FOREACH -IncludeBlocks: Preserve +IncludeBlocks: Regroup IncludeCategories: + - Regex: '<[[:alnum:]._]+>' + Priority: 5 - Regex: '^(<|"(gtest|gmock|isl|json)/)' Priority: 4 - Regex: '.*' diff --git a/include/podio/CollectionBufferFactory.h b/include/podio/CollectionBufferFactory.h index 34e2324af..2828fa77d 100644 --- a/include/podio/CollectionBufferFactory.h +++ b/include/podio/CollectionBufferFactory.h @@ -1,15 +1,15 @@ #ifndef PODIO_COLLECTIONBUFFERFACTORY_H #define PODIO_COLLECTIONBUFFERFACTORY_H +#include "podio/CollectionBuffers.h" +#include "podio/SchemaEvolution.h" + #include #include #include #include #include -#include "podio/CollectionBuffers.h" -#include "podio/SchemaEvolution.h" - namespace podio { /// The CollectionBufferFactory allows one to create buffers of known datatypes, diff --git a/include/podio/GenericParameters.h b/include/podio/GenericParameters.h index f3fe9ca29..619097c70 100644 --- a/include/podio/GenericParameters.h +++ b/include/podio/GenericParameters.h @@ -2,6 +2,8 @@ #ifndef PODIO_GENERICPARAMETERS_H #define PODIO_GENERICPARAMETERS_H 1 +#include "podio/utilities/TypeHelpers.h" + #include #include #include @@ -17,8 +19,6 @@ #include #include -#include "podio/utilities/TypeHelpers.h" - namespace sio { class read_device; class write_device; diff --git a/include/podio/RNTupleReader.h b/include/podio/RNTupleReader.h index bb6ff5362..7dfb0e5f4 100644 --- a/include/podio/RNTupleReader.h +++ b/include/podio/RNTupleReader.h @@ -1,20 +1,21 @@ #ifndef PODIO_RNTUPLEREADER_H #define PODIO_RNTUPLEREADER_H +#include "podio/GenericParameters.h" +#include "podio/ROOTFrameData.h" +#include "podio/SchemaEvolution.h" +#include "podio/podioVersion.h" +#include "podio/utilities/DatamodelRegistryIOHelpers.h" + #include #include + #include #include #include #include #include #include - -#include "podio/GenericParameters.h" -#include "podio/ROOTFrameData.h" -#include "podio/SchemaEvolution.h" -#include "podio/podioVersion.h" -#include "podio/utilities/DatamodelRegistryIOHelpers.h" #if ROOT_VERSION_CODE >= ROOT_VERSION(6, 31, 0) #include #endif diff --git a/include/podio/RNTupleWriter.h b/include/podio/RNTupleWriter.h index 1a06de78e..8b4e81e94 100644 --- a/include/podio/RNTupleWriter.h +++ b/include/podio/RNTupleWriter.h @@ -1,11 +1,6 @@ #ifndef PODIO_RNTUPLEWRITER_H #define PODIO_RNTUPLEWRITER_H -#include -#include -#include -#include - #include "TFile.h" #include "podio/CollectionBase.h" #include "podio/Frame.h" @@ -13,6 +8,12 @@ #include "podio/SchemaEvolution.h" #include "podio/utilities/DatamodelRegistryIOHelpers.h" +#include +#include + +#include +#include + namespace ROOT { namespace Experimental { class REntry; diff --git a/include/podio/ROOTLegacyReader.h b/include/podio/ROOTLegacyReader.h index 3e47eac25..c0f69b268 100644 --- a/include/podio/ROOTLegacyReader.h +++ b/include/podio/ROOTLegacyReader.h @@ -1,12 +1,11 @@ #ifndef PODIO_ROOTLEGACYREADER_H #define PODIO_ROOTLEGACYREADER_H +#include "TChain.h" #include "podio/CollectionBranches.h" #include "podio/ROOTFrameData.h" #include "podio/podioVersion.h" -#include "TChain.h" - #include #include #include diff --git a/include/podio/ROOTReader.h b/include/podio/ROOTReader.h index 785d0b251..c5d217112 100644 --- a/include/podio/ROOTReader.h +++ b/include/podio/ROOTReader.h @@ -1,6 +1,13 @@ #ifndef PODIO_ROOTREADER_H #define PODIO_ROOTREADER_H +#include "TChain.h" +#include "podio/CollectionBranches.h" +#include "podio/ROOTFrameData.h" +#include "podio/SchemaEvolution.h" +#include "podio/podioVersion.h" +#include "podio/utilities/DatamodelRegistryIOHelpers.h" + #include #include #include @@ -10,13 +17,6 @@ #include #include -#include "TChain.h" -#include "podio/CollectionBranches.h" -#include "podio/ROOTFrameData.h" -#include "podio/SchemaEvolution.h" -#include "podio/podioVersion.h" -#include "podio/utilities/DatamodelRegistryIOHelpers.h" - // forward declarations class TClass; class TFile; diff --git a/include/podio/ROOTWriter.h b/include/podio/ROOTWriter.h index a8c5459cf..1dfafbef6 100644 --- a/include/podio/ROOTWriter.h +++ b/include/podio/ROOTWriter.h @@ -1,6 +1,11 @@ #ifndef PODIO_ROOTWRITER_H #define PODIO_ROOTWRITER_H +#include "TFile.h" +#include "podio/CollectionBranches.h" +#include "podio/CollectionIDTable.h" +#include "podio/utilities/DatamodelRegistryIOHelpers.h" + #include #include #include @@ -9,11 +14,6 @@ #include #include -#include "TFile.h" -#include "podio/CollectionBranches.h" -#include "podio/CollectionIDTable.h" -#include "podio/utilities/DatamodelRegistryIOHelpers.h" - // forward declarations class TTree; diff --git a/include/podio/SIOBlock.h b/include/podio/SIOBlock.h index fdabbc3f1..50a2e199d 100644 --- a/include/podio/SIOBlock.h +++ b/include/podio/SIOBlock.h @@ -1,11 +1,8 @@ #ifndef PODIO_SIOBLOCK_H #define PODIO_SIOBLOCK_H -#include -#include -#include -#include -#include +#include "podio/CollectionBuffers.h" + #include #include #include @@ -15,6 +12,12 @@ #include #include #include + +#include +#include +#include +#include +#include #include #include #include @@ -22,8 +25,6 @@ #include #include -#include "podio/CollectionBuffers.h" - namespace podio { class GenericParameters; diff --git a/include/podio/SIOBlockUserData.h b/include/podio/SIOBlockUserData.h index c0c4e59da..121c5605f 100644 --- a/include/podio/SIOBlockUserData.h +++ b/include/podio/SIOBlockUserData.h @@ -1,21 +1,22 @@ #ifndef PODIO_SIOBLOCKUSERDATA_H #define PODIO_SIOBLOCKUSERDATA_H -#include +#include "podio/CollectionBufferFactory.h" +#include "podio/CollectionBuffers.h" +#include "podio/GenericParameters.h" +#include "podio/SIOBlock.h" +#include "podio/UserDataCollection.h" + #include #include #include #include + +#include #include #include #include -#include "podio/CollectionBufferFactory.h" -#include "podio/CollectionBuffers.h" -#include "podio/GenericParameters.h" -#include "podio/SIOBlock.h" -#include "podio/UserDataCollection.h" - namespace podio { namespace detail { diff --git a/include/podio/SIOFrameData.h b/include/podio/SIOFrameData.h index d03dadc71..754217a09 100644 --- a/include/podio/SIOFrameData.h +++ b/include/podio/SIOFrameData.h @@ -1,21 +1,22 @@ #ifndef PODIO_SIOFRAMEDATA_H #define PODIO_SIOFRAMEDATA_H +#include "podio/CollectionBuffers.h" +#include "podio/CollectionIDTable.h" +#include "podio/GenericParameters.h" +#include "podio/SIOBlock.h" + +#include +#include + #include #include #include #include -#include -#include #include #include #include -#include "podio/CollectionBuffers.h" -#include "podio/CollectionIDTable.h" -#include "podio/GenericParameters.h" -#include "podio/SIOBlock.h" - namespace podio { /// The Frame data container for the SIO backend. It is constructed from the /// compressed sio::buffers that is read from file and does all the necessary diff --git a/include/podio/SIOLegacyReader.h b/include/podio/SIOLegacyReader.h index 8c3033790..c1cab4d22 100644 --- a/include/podio/SIOLegacyReader.h +++ b/include/podio/SIOLegacyReader.h @@ -1,18 +1,19 @@ #ifndef PODIO_SIOLEGACYREADER_H #define PODIO_SIOLEGACYREADER_H -#include -#include +#include "podio/SIOBlock.h" +#include "podio/SIOFrameData.h" +#include "podio/podioVersion.h" + #include #include + +#include +#include #include #include #include -#include "podio/SIOBlock.h" -#include "podio/SIOFrameData.h" -#include "podio/podioVersion.h" - namespace podio { class CollectionIDTable; diff --git a/include/podio/SIOReader.h b/include/podio/SIOReader.h index 6d4ffd0f2..3a024861e 100644 --- a/include/podio/SIOReader.h +++ b/include/podio/SIOReader.h @@ -1,19 +1,20 @@ #ifndef PODIO_SIOREADER_H #define PODIO_SIOREADER_H +#include "podio/SIOBlock.h" +#include "podio/SIOFrameData.h" +#include "podio/podioVersion.h" +#include "podio/utilities/DatamodelRegistryIOHelpers.h" + +#include + #include #include -#include #include #include #include #include -#include "podio/SIOBlock.h" -#include "podio/SIOFrameData.h" -#include "podio/podioVersion.h" -#include "podio/utilities/DatamodelRegistryIOHelpers.h" - namespace podio { class CollectionIDTable; diff --git a/include/podio/SIOWriter.h b/include/podio/SIOWriter.h index f54c8ae81..028040e05 100644 --- a/include/podio/SIOWriter.h +++ b/include/podio/SIOWriter.h @@ -1,15 +1,16 @@ #ifndef PODIO_SIOWRITER_H #define PODIO_SIOWRITER_H -#include +#include "podio/SIOBlock.h" +#include "podio/utilities/DatamodelRegistryIOHelpers.h" + #include + +#include #include #include #include -#include "podio/SIOBlock.h" -#include "podio/utilities/DatamodelRegistryIOHelpers.h" - namespace podio { class Frame; diff --git a/include/podio/UserDataCollection.h b/include/podio/UserDataCollection.h index 25bc9a822..afce498a5 100644 --- a/include/podio/UserDataCollection.h +++ b/include/podio/UserDataCollection.h @@ -1,6 +1,12 @@ #ifndef PODIO_USERDATACOLLECTION_H #define PODIO_USERDATACOLLECTION_H +#include "podio/CollectionBase.h" +#include "podio/CollectionBuffers.h" +#include "podio/DatamodelRegistry.h" +#include "podio/SchemaEvolution.h" +#include "podio/utilities/TypeHelpers.h" + #include #include #include @@ -10,12 +16,6 @@ #include #include -#include "podio/CollectionBase.h" -#include "podio/CollectionBuffers.h" -#include "podio/DatamodelRegistry.h" -#include "podio/SchemaEvolution.h" -#include "podio/utilities/TypeHelpers.h" - namespace podio { class ICollectionProvider; } // namespace podio diff --git a/include/podio/utilities/DatamodelRegistryIOHelpers.h b/include/podio/utilities/DatamodelRegistryIOHelpers.h index 6d9c5ee27..00dae25ef 100644 --- a/include/podio/utilities/DatamodelRegistryIOHelpers.h +++ b/include/podio/utilities/DatamodelRegistryIOHelpers.h @@ -1,6 +1,8 @@ #ifndef PODIO_UTILITIES_DATAMODELREGISTRYIOHELPERS_H #define PODIO_UTILITIES_DATAMODELREGISTRYIOHELPERS_H +#include "podio/CollectionBase.h" + #include #include #include @@ -9,8 +11,6 @@ #include #include -#include "podio/CollectionBase.h" - namespace podio { class CollectionBase; diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 99f16dc8b..10a0322d2 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -1,5 +1,11 @@ -SET(podio_PYTHON_INSTALLDIR python) -SET(podio_PYTHON_INSTALLDIR ${podio_PYTHON_INSTALLDIR} PARENT_SCOPE) +find_package(Python3 REQUIRED) +set(PYTHON_LIB_DIR lib) +if("${Python3_SITEARCH}" MATCHES "/lib64/") + set(PYTHON_LIB_DIR lib64) +endif() + +set(podio_PYTHON_INSTALLDIR "${CMAKE_INSTALL_PREFIX}/${PYTHON_LIB_DIR}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages") +set(podio_PYTHON_INSTALLDIR ${podio_PYTHON_INSTALLDIR} PARENT_SCOPE) set(to_install podio_class_generator.py diff --git a/src/CollectionBufferFactory.cc b/src/CollectionBufferFactory.cc index adaf07203..e72419b9d 100644 --- a/src/CollectionBufferFactory.cc +++ b/src/CollectionBufferFactory.cc @@ -1,10 +1,10 @@ #include "podio/CollectionBufferFactory.h" +#include "podio/CollectionBuffers.h" + #include #include -#include "podio/CollectionBuffers.h" - namespace podio { CollectionBufferFactory& CollectionBufferFactory::mutInstance() { static CollectionBufferFactory factory; diff --git a/src/CollectionIDTable.cc b/src/CollectionIDTable.cc index 2db5bd37a..86670b4f7 100644 --- a/src/CollectionIDTable.cc +++ b/src/CollectionIDTable.cc @@ -1,14 +1,14 @@ // podio specific includes #include "podio/CollectionIDTable.h" +#include "MurmurHash3.h" + #include #include #include #include #include -#include "MurmurHash3.h" - namespace podio { CollectionIDTable::CollectionIDTable() : m_mutex(std::make_unique()) { diff --git a/src/DatamodelRegistryIOHelpers.cc b/src/DatamodelRegistryIOHelpers.cc index 37eb91daf..9baad625e 100644 --- a/src/DatamodelRegistryIOHelpers.cc +++ b/src/DatamodelRegistryIOHelpers.cc @@ -1,11 +1,11 @@ #include "podio/utilities/DatamodelRegistryIOHelpers.h" -#include -#include - #include "podio/CollectionBase.h" #include "podio/DatamodelRegistry.h" +#include +#include + namespace podio { void DatamodelDefinitionCollector::registerDatamodelDefinition(const podio::CollectionBase* coll, diff --git a/src/RNTupleReader.cc b/src/RNTupleReader.cc index 6aad33e14..23b313df2 100644 --- a/src/RNTupleReader.cc +++ b/src/RNTupleReader.cc @@ -1,9 +1,18 @@ #include "podio/RNTupleReader.h" +#include "podio/CollectionBufferFactory.h" +#include "podio/CollectionBuffers.h" +#include "podio/CollectionIDTable.h" +#include "podio/DatamodelRegistry.h" +#include "podio/GenericParameters.h" +#include "podio/ObjectID.h" +#include "rootUtils.h" + #include #include #include #include + #include #include #include @@ -14,14 +23,6 @@ #include #include -#include "podio/CollectionBufferFactory.h" -#include "podio/CollectionBuffers.h" -#include "podio/CollectionIDTable.h" -#include "podio/DatamodelRegistry.h" -#include "podio/GenericParameters.h" -#include "podio/ObjectID.h" -#include "rootUtils.h" - namespace podio { template diff --git a/src/RNTupleWriter.cc b/src/RNTupleWriter.cc index 52adf0b6e..32efe76c8 100644 --- a/src/RNTupleWriter.cc +++ b/src/RNTupleWriter.cc @@ -1,12 +1,5 @@ #include "podio/RNTupleWriter.h" -#include -#include -#include -#include -#include -#include - #include "TFile.h" #include "podio/CollectionBase.h" #include "podio/CollectionBuffers.h" @@ -16,6 +9,14 @@ #include "podio/podioVersion.h" #include "rootUtils.h" +#include +#include +#include +#include + +#include +#include + namespace podio { class GenericParameters; diff --git a/src/ROOTLegacyReader.cc b/src/ROOTLegacyReader.cc index 43565222a..62ee7eb48 100644 --- a/src/ROOTLegacyReader.cc +++ b/src/ROOTLegacyReader.cc @@ -1,3 +1,8 @@ +#include "podio/CollectionBufferFactory.h" +#include "podio/CollectionBuffers.h" +#include "podio/ROOTFrameData.h" +#include "rootUtils.h" + #include #include #include @@ -10,11 +15,6 @@ #include #include #include - -#include "podio/CollectionBufferFactory.h" -#include "podio/CollectionBuffers.h" -#include "podio/ROOTFrameData.h" -#include "rootUtils.h" // podio specific includes #include "podio/CollectionBase.h" #include "podio/CollectionIDTable.h" diff --git a/src/ROOTReader.cc b/src/ROOTReader.cc index 048383846..9008edd74 100644 --- a/src/ROOTReader.cc +++ b/src/ROOTReader.cc @@ -1,5 +1,13 @@ #include "podio/ROOTReader.h" +#include "podio/CollectionBase.h" +#include "podio/CollectionBufferFactory.h" +#include "podio/CollectionBuffers.h" +#include "podio/CollectionIDTable.h" +#include "podio/DatamodelRegistry.h" +#include "podio/GenericParameters.h" +#include "rootUtils.h" + #include #include #include @@ -8,14 +16,6 @@ #include #include #include - -#include "podio/CollectionBase.h" -#include "podio/CollectionBufferFactory.h" -#include "podio/CollectionBuffers.h" -#include "podio/CollectionIDTable.h" -#include "podio/DatamodelRegistry.h" -#include "podio/GenericParameters.h" -#include "rootUtils.h" // ROOT specific includes #include "TChain.h" #include "TClass.h" diff --git a/src/ROOTWriter.cc b/src/ROOTWriter.cc index 9ab13927c..1021bb22d 100644 --- a/src/ROOTWriter.cc +++ b/src/ROOTWriter.cc @@ -1,11 +1,5 @@ #include "podio/ROOTWriter.h" -#include -#include -#include -#include -#include - #include "TTree.h" #include "podio/CollectionBase.h" #include "podio/CollectionBuffers.h" @@ -15,6 +9,12 @@ #include "podio/podioVersion.h" #include "rootUtils.h" +#include +#include +#include +#include +#include + namespace podio { ROOTWriter::ROOTWriter(const std::string& filename) { diff --git a/src/SIOBlock.cc b/src/SIOBlock.cc index 0599fafca..2c87c462e 100644 --- a/src/SIOBlock.cc +++ b/src/SIOBlock.cc @@ -1,5 +1,11 @@ #include "podio/SIOBlock.h" +#include "podio/CollectionBase.h" +#include "podio/GenericParameters.h" +#include "sio/definitions.h" +#include "sio/io_device.h" +#include "sio/version.h" + #include #include #include @@ -7,12 +13,6 @@ #include #include #include - -#include "podio/CollectionBase.h" -#include "podio/GenericParameters.h" -#include "sio/definitions.h" -#include "sio/io_device.h" -#include "sio/version.h" #ifdef USE_BOOST_FILESYSTEM #include #else diff --git a/src/SIOFrameData.cc b/src/SIOFrameData.cc index cdcc36635..b7c66fffb 100644 --- a/src/SIOFrameData.cc +++ b/src/SIOFrameData.cc @@ -1,14 +1,15 @@ #include "podio/SIOFrameData.h" -#include -#include +#include "podio/SIOBlock.h" +#include "sio/buffer.h" +#include "sio/definitions.h" + #include #include #include -#include "podio/SIOBlock.h" -#include "sio/buffer.h" -#include "sio/definitions.h" +#include +#include namespace podio { std::optional SIOFrameData::getCollectionBuffers(const std::string& name) { diff --git a/src/SIOLegacyReader.cc b/src/SIOLegacyReader.cc index 1577533fd..906ccd1fe 100644 --- a/src/SIOLegacyReader.cc +++ b/src/SIOLegacyReader.cc @@ -1,17 +1,18 @@ #include "podio/SIOLegacyReader.h" -#include +#include "podio/SIOBlock.h" +#include "sio/buffer.h" +#include "sioUtils.h" + #include #include #include #include + +#include #include #include -#include "podio/SIOBlock.h" -#include "sio/buffer.h" -#include "sioUtils.h" - namespace podio { SIOLegacyReader::SIOLegacyReader() { diff --git a/src/SIOReader.cc b/src/SIOReader.cc index 8bc06e0c1..6093c3984 100644 --- a/src/SIOReader.cc +++ b/src/SIOReader.cc @@ -1,16 +1,17 @@ #include "podio/SIOReader.h" -#include -#include +#include "podio/SIOBlock.h" +#include "sioUtils.h" + #include #include #include + +#include +#include #include #include -#include "podio/SIOBlock.h" -#include "sioUtils.h" - namespace podio { SIOReader::SIOReader() { diff --git a/src/SIOWriter.cc b/src/SIOWriter.cc index 3e8fd1d32..480e578ee 100644 --- a/src/SIOWriter.cc +++ b/src/SIOWriter.cc @@ -1,16 +1,17 @@ #include "podio/SIOWriter.h" -#include -#include -#include -#include - #include "podio/Frame.h" #include "podio/SIOBlock.h" #include "podio/podioVersion.h" #include "sio/definitions.h" #include "sioUtils.h" +#include + +#include +#include +#include + namespace podio { SIOWriter::SIOWriter(const std::string& filename) { diff --git a/src/SchemaEvolution.cc b/src/SchemaEvolution.cc index 9f5a1613c..a12622a9b 100644 --- a/src/SchemaEvolution.cc +++ b/src/SchemaEvolution.cc @@ -1,11 +1,11 @@ #include "podio/SchemaEvolution.h" +#include "podio/CollectionBuffers.h" + #include #include #include -#include "podio/CollectionBuffers.h" - namespace podio { SchemaEvolution& SchemaEvolution::mutInstance() { diff --git a/src/UserDataCollection.cc b/src/UserDataCollection.cc index b52406bfc..0393ecf82 100644 --- a/src/UserDataCollection.cc +++ b/src/UserDataCollection.cc @@ -1,14 +1,14 @@ #include "podio/UserDataCollection.h" +#include "podio/CollectionBufferFactory.h" +#include "podio/CollectionBuffers.h" +#include "podio/SchemaEvolution.h" + #include #include #include #include -#include "podio/CollectionBufferFactory.h" -#include "podio/CollectionBuffers.h" -#include "podio/SchemaEvolution.h" - namespace podio { namespace { diff --git a/src/rootUtils.h b/src/rootUtils.h index fedc6ecd6..b8e602144 100644 --- a/src/rootUtils.h +++ b/src/rootUtils.h @@ -1,11 +1,10 @@ #ifndef PODIO_ROOT_UTILS_H // NOLINT(llvm-header-guard): internal headers confuse clang-tidy #define PODIO_ROOT_UTILS_H // NOLINT(llvm-header-guard): internal headers confuse clang-tidy -#include "podio/CollectionBranches.h" -#include "podio/CollectionIDTable.h" - #include "TBranch.h" #include "TTree.h" +#include "podio/CollectionBranches.h" +#include "podio/CollectionIDTable.h" #include #include diff --git a/src/test_hashes.cpp b/src/test_hashes.cpp index 5683c8727..5c02fbe15 100644 --- a/src/test_hashes.cpp +++ b/src/test_hashes.cpp @@ -1,3 +1,5 @@ +#include "MurmurHash3.h" + #include #include #include @@ -11,8 +13,6 @@ #include #include -#include "MurmurHash3.h" - auto readCollNames(const std::string& fileName) { std::vector collNames{}; diff --git a/tests/ostream_operator.cpp b/tests/ostream_operator.cpp index cc511055f..8b6db2969 100644 --- a/tests/ostream_operator.cpp +++ b/tests/ostream_operator.cpp @@ -1,5 +1,3 @@ -#include - #include "datamodel/ExampleForCyclicDependency1.h" #include "datamodel/ExampleForCyclicDependency1Collection.h" #include "datamodel/ExampleForCyclicDependency2.h" @@ -13,6 +11,8 @@ #include "datamodel/MutableExampleMC.h" #include "datamodel/MutableExampleReferencingType.h" +#include + // When using CTest for unit testing it is enough for this test to eventually // segfault int main(int, char**) { diff --git a/tests/read_frame.h b/tests/read_frame.h index 3a9ec2929..1750faf56 100644 --- a/tests/read_frame.h +++ b/tests/read_frame.h @@ -2,13 +2,11 @@ #define PODIO_TESTS_READ_FRAME_H // NOLINT(llvm-header-guard): folder structure not suitable #include "datamodel/ExampleWithVectorMemberCollection.h" -#include "read_test.h" - #include "extension_model/ContainedTypeCollection.h" #include "extension_model/ExternalComponentTypeCollection.h" #include "extension_model/ExternalRelationTypeCollection.h" - #include "podio/Frame.h" +#include "read_test.h" #include diff --git a/tests/read_frame_auxiliary.h b/tests/read_frame_auxiliary.h index 65bffad28..c755eed42 100644 --- a/tests/read_frame_auxiliary.h +++ b/tests/read_frame_auxiliary.h @@ -2,7 +2,6 @@ #define PODIO_TESTS_READ_FRAME_AUXILIARY_H // NOLINT(llvm-header-guard): folder structure not suitable #include "frame_test_common.h" - #include "podio/Frame.h" #include "podio/podioVersion.h" diff --git a/tests/read_python_frame.h b/tests/read_python_frame.h index 318482ed9..3e653b94d 100644 --- a/tests/read_python_frame.h +++ b/tests/read_python_frame.h @@ -3,7 +3,6 @@ #include "datamodel/ExampleClusterCollection.h" #include "datamodel/ExampleHitCollection.h" - #include "podio/Frame.h" #include diff --git a/tests/root_io/read_and_write_associated.cpp b/tests/root_io/read_and_write_associated.cpp index 97496f688..a9ddffbd8 100644 --- a/tests/root_io/read_and_write_associated.cpp +++ b/tests/root_io/read_and_write_associated.cpp @@ -1,9 +1,3 @@ -#include -#include -#include -#include -#include - #include "datamodel/EventInfoCollection.h" #include "datamodel/ExampleCluster.h" #include "datamodel/ExampleClusterCollection.h" @@ -18,6 +12,12 @@ #include "podio/ROOTWriter.h" #include "podio/RelationRange.h" +#include +#include +#include +#include +#include + void writeCollection() { podio::ROOTWriter writer("associations.root"); diff --git a/tests/root_io/read_and_write_frame_root.cpp b/tests/root_io/read_and_write_frame_root.cpp index ab5c0845b..8cacb35ac 100644 --- a/tests/root_io/read_and_write_frame_root.cpp +++ b/tests/root_io/read_and_write_frame_root.cpp @@ -1,9 +1,9 @@ -#include - #include "podio/ROOTReader.h" #include "podio/ROOTWriter.h" #include "read_and_write_frame.h" +#include + int main() { return rewrite_frames("example_frame.root", "rewritten_frame.root") + read_rewritten_frames("rewritten_frame.root"); diff --git a/tests/root_io/read_frame_legacy_root.cpp b/tests/root_io/read_frame_legacy_root.cpp index 90cc3b13b..0c1b8d82e 100644 --- a/tests/root_io/read_frame_legacy_root.cpp +++ b/tests/root_io/read_frame_legacy_root.cpp @@ -1,12 +1,12 @@ +#include "podio/Frame.h" +#include "podio/ROOTLegacyReader.h" +#include "read_test.h" + #include #include #include #include -#include "podio/Frame.h" -#include "podio/ROOTLegacyReader.h" -#include "read_test.h" - int main(int argc, char* argv[]) { if (argc != 2) { std::cerr << "usage: read_frame_legacy_frame inputfile" << std::endl; diff --git a/tests/root_io/read_frame_root.cpp b/tests/root_io/read_frame_root.cpp index 40f8cdccf..71d8a34b3 100644 --- a/tests/root_io/read_frame_root.cpp +++ b/tests/root_io/read_frame_root.cpp @@ -1,8 +1,7 @@ +#include "podio/ROOTReader.h" #include "read_frame.h" #include "read_frame_auxiliary.h" -#include "podio/ROOTReader.h" - #include #include diff --git a/tests/root_io/read_frame_root_multiple.cpp b/tests/root_io/read_frame_root_multiple.cpp index faa4c6154..ba579a9c5 100644 --- a/tests/root_io/read_frame_root_multiple.cpp +++ b/tests/root_io/read_frame_root_multiple.cpp @@ -1,15 +1,15 @@ -#include -#include -#include -#include -#include - #include "podio/Frame.h" #include "podio/ROOTReader.h" #include "podio/podioVersion.h" #include "read_frame.h" #include "read_test.h" +#include +#include +#include +#include +#include + int read_frames(podio::ROOTReader& reader) { if (reader.currentFileVersion() != podio::version::build_version) { std::cerr << "The podio build version could not be read back correctly. " diff --git a/tests/root_io/read_python_frame_rntuple.cpp b/tests/root_io/read_python_frame_rntuple.cpp index 34043b278..529da1332 100644 --- a/tests/root_io/read_python_frame_rntuple.cpp +++ b/tests/root_io/read_python_frame_rntuple.cpp @@ -1,8 +1,8 @@ -#include - #include "podio/RNTupleReader.h" #include "read_python_frame.h" +#include + int main() { return read_frame("example_frame_with_py_rntuple.root"); } diff --git a/tests/root_io/read_python_frame_root.cpp b/tests/root_io/read_python_frame_root.cpp index d74331b84..abd3a1106 100644 --- a/tests/root_io/read_python_frame_root.cpp +++ b/tests/root_io/read_python_frame_root.cpp @@ -1,8 +1,8 @@ -#include - #include "podio/ROOTReader.h" #include "read_python_frame.h" +#include + int main() { return read_frame("example_frame_with_py.root"); } diff --git a/tests/root_io/read_rntuple.cpp b/tests/root_io/read_rntuple.cpp index b40cbcd8c..49fa4394a 100644 --- a/tests/root_io/read_rntuple.cpp +++ b/tests/root_io/read_rntuple.cpp @@ -1,8 +1,8 @@ -#include - #include "podio/RNTupleReader.h" #include "read_frame.h" +#include + int main() { return read_frames("example_rntuple.root"); } diff --git a/tests/root_io/relation_range.cpp b/tests/root_io/relation_range.cpp index d256b3f70..59532b156 100644 --- a/tests/root_io/relation_range.cpp +++ b/tests/root_io/relation_range.cpp @@ -1,11 +1,3 @@ -#include -#include -#include -#include -#include -#include -#include - #include "datamodel/ExampleMC.h" #include "datamodel/ExampleMCCollection.h" #include "datamodel/ExampleReferencingType.h" @@ -18,6 +10,14 @@ #include "podio/ROOTWriter.h" #include "podio/RelationRange.h" +#include +#include +#include +#include +#include +#include +#include + #define LOCATION() \ std::string(__FILE__) + std::string(":") + std::to_string(__LINE__) + std::string(" in ") + \ std::string(__PRETTY_FUNCTION__) diff --git a/tests/root_io/write_frame_root.cpp b/tests/root_io/write_frame_root.cpp index b514b850c..f94954dc7 100644 --- a/tests/root_io/write_frame_root.cpp +++ b/tests/root_io/write_frame_root.cpp @@ -1,8 +1,8 @@ -#include - #include "podio/ROOTWriter.h" #include "write_frame.h" +#include + int main(int, char**) { write_frames("example_frame.root"); return 0; diff --git a/tests/root_io/write_rntuple.cpp b/tests/root_io/write_rntuple.cpp index 3bc24e8ae..bb6630ad8 100644 --- a/tests/root_io/write_rntuple.cpp +++ b/tests/root_io/write_rntuple.cpp @@ -1,8 +1,8 @@ -#include - #include "podio/RNTupleWriter.h" #include "write_frame.h" +#include + int main() { write_frames("example_rntuple.root"); } diff --git a/tests/schema_evolution/read_new_data.h b/tests/schema_evolution/read_new_data.h index cdc3abf46..7805c48aa 100644 --- a/tests/schema_evolution/read_new_data.h +++ b/tests/schema_evolution/read_new_data.h @@ -5,7 +5,6 @@ #include "datamodel/ExampleWithARelationCollection.h" #include "datamodel/ExampleWithArrayComponentCollection.h" #include "datamodel/ExampleWithNamespaceCollection.h" - #include "podio/Frame.h" #include diff --git a/tests/schema_evolution/root_io/read_new_data_root.cpp b/tests/schema_evolution/root_io/read_new_data_root.cpp index 2b59cf51c..f03b3c937 100644 --- a/tests/schema_evolution/root_io/read_new_data_root.cpp +++ b/tests/schema_evolution/root_io/read_new_data_root.cpp @@ -1,8 +1,8 @@ -#include - #include "podio/ROOTReader.h" #include "read_new_data.h" +#include + int main() { return read_new_data("example_data_old_schema.root"); } diff --git a/tests/schema_evolution/root_io/write_old_data_root.cpp b/tests/schema_evolution/root_io/write_old_data_root.cpp index 8e10a63a1..295eda64d 100644 --- a/tests/schema_evolution/root_io/write_old_data_root.cpp +++ b/tests/schema_evolution/root_io/write_old_data_root.cpp @@ -1,8 +1,8 @@ -#include - #include "podio/ROOTWriter.h" #include "schema_evolution/write_old_data.h" +#include + int main() { return writeData("example_data_old_schema.root"); } diff --git a/tests/schema_evolution/write_old_data.h b/tests/schema_evolution/write_old_data.h index 7676ae34b..9f0780b78 100644 --- a/tests/schema_evolution/write_old_data.h +++ b/tests/schema_evolution/write_old_data.h @@ -5,7 +5,6 @@ #include "datamodel/ExampleWithARelationCollection.h" #include "datamodel/ExampleWithArrayComponentCollection.h" #include "datamodel/ExampleWithNamespaceCollection.h" - #include "podio/Frame.h" #include diff --git a/tests/sio_io/read_and_write_frame_sio.cpp b/tests/sio_io/read_and_write_frame_sio.cpp index c524d0807..d3ec172c2 100644 --- a/tests/sio_io/read_and_write_frame_sio.cpp +++ b/tests/sio_io/read_and_write_frame_sio.cpp @@ -1,9 +1,9 @@ -#include - #include "podio/SIOReader.h" #include "podio/SIOWriter.h" #include "read_and_write_frame.h" +#include + int main() { return rewrite_frames("example_frame.sio", "rewritten_frame.sio") + read_rewritten_frames("rewritten_frame.sio"); diff --git a/tests/sio_io/read_frame_legacy_sio.cpp b/tests/sio_io/read_frame_legacy_sio.cpp index e3de22be9..af5e49489 100644 --- a/tests/sio_io/read_frame_legacy_sio.cpp +++ b/tests/sio_io/read_frame_legacy_sio.cpp @@ -1,12 +1,12 @@ +#include "podio/Frame.h" +#include "podio/SIOLegacyReader.h" +#include "read_test.h" + #include #include #include #include -#include "podio/Frame.h" -#include "podio/SIOLegacyReader.h" -#include "read_test.h" - int main(int argc, char* argv[]) { if (argc != 2) { std::cerr << "usage: read_frame_legacy_sio inputfile" << std::endl; diff --git a/tests/sio_io/read_frame_sio.cpp b/tests/sio_io/read_frame_sio.cpp index 374bcc6b0..432c30fdd 100644 --- a/tests/sio_io/read_frame_sio.cpp +++ b/tests/sio_io/read_frame_sio.cpp @@ -1,9 +1,9 @@ -#include - #include "podio/SIOReader.h" #include "read_frame.h" #include "read_frame_auxiliary.h" +#include + int main(int argc, char* argv[]) { std::string inputFile = "example_frame.sio"; bool assertBuildVersion = true; diff --git a/tests/sio_io/read_python_frame_sio.cpp b/tests/sio_io/read_python_frame_sio.cpp index 87b252ad3..3efdf7d79 100644 --- a/tests/sio_io/read_python_frame_sio.cpp +++ b/tests/sio_io/read_python_frame_sio.cpp @@ -1,8 +1,8 @@ -#include - #include "podio/SIOReader.h" #include "read_python_frame.h" +#include + int main() { return read_frame("example_frame_with_py.sio"); } diff --git a/tests/sio_io/write_frame_sio.cpp b/tests/sio_io/write_frame_sio.cpp index b49dfb231..6bed9d3cc 100644 --- a/tests/sio_io/write_frame_sio.cpp +++ b/tests/sio_io/write_frame_sio.cpp @@ -1,8 +1,8 @@ -#include - #include "podio/SIOWriter.h" #include "write_frame.h" +#include + int main(int, char**) { write_frames("example_frame.sio"); return 0; diff --git a/tests/unittests/buffer_factory.cpp b/tests/unittests/buffer_factory.cpp index 9a405e587..7817c69f7 100644 --- a/tests/unittests/buffer_factory.cpp +++ b/tests/unittests/buffer_factory.cpp @@ -1,8 +1,3 @@ -#include -#include -#include -#include - #include "catch2/catch_test_macros.hpp" #include "datamodel/DatamodelDefinition.h" #include "datamodel/ExampleCluster.h" @@ -15,6 +10,11 @@ #include "podio/CollectionBuffers.h" #include "podio/ObjectID.h" +#include +#include +#include +#include + TEST_CASE("createBuffers", "[internals][memory-management]") { const auto& factory = podio::CollectionBufferFactory::instance(); diff --git a/tests/unittests/frame.cpp b/tests/unittests/frame.cpp index 5c6233584..2ffb40799 100644 --- a/tests/unittests/frame.cpp +++ b/tests/unittests/frame.cpp @@ -1,3 +1,13 @@ +#include "podio/Frame.h" + +#include "catch2/catch_test_macros.hpp" +#include "datamodel/ExampleCluster.h" +#include "datamodel/ExampleClusterCollection.h" +#include "datamodel/ExampleHit.h" +#include "datamodel/ExampleHitCollection.h" +#include "datamodel/MutableExampleCluster.h" +#include "podio/RelationRange.h" + #include #include #include @@ -9,15 +19,6 @@ #include #include -#include "catch2/catch_test_macros.hpp" -#include "datamodel/ExampleCluster.h" -#include "datamodel/ExampleClusterCollection.h" -#include "datamodel/ExampleHit.h" -#include "datamodel/ExampleHitCollection.h" -#include "datamodel/MutableExampleCluster.h" -#include "podio/Frame.h" -#include "podio/RelationRange.h" - TEST_CASE("Frame collections", "[frame][basics]") { auto event = podio::Frame(); auto clusters = ExampleClusterCollection(); diff --git a/tests/unittests/interface_types.cpp b/tests/unittests/interface_types.cpp index 2e177416d..353a453e3 100644 --- a/tests/unittests/interface_types.cpp +++ b/tests/unittests/interface_types.cpp @@ -1,6 +1,3 @@ -#include -#include - #include "catch2/catch_test_macros.hpp" #include "datamodel/ExampleCluster.h" #include "datamodel/ExampleHit.h" @@ -10,6 +7,9 @@ #include "datamodel/TypeWithEnergy.h" #include "podio/ObjectID.h" +#include +#include + TEST_CASE("InterfaceTypes basic functionality", "[interface-types][basics]") { using WrapperT = TypeWithEnergy; diff --git a/tests/unittests/unittest.cpp b/tests/unittests/unittest.cpp index b7fb03d04..05ae70720 100644 --- a/tests/unittests/unittest.cpp +++ b/tests/unittests/unittest.cpp @@ -1,6 +1,14 @@ // STL -#include +#include "catch2/catch_test_macros.hpp" +#include "catch2/matchers/catch_matchers_string.hpp" +#include "catch2/matchers/catch_matchers_vector.hpp" + #include +#include +#include +#include + +#include #include #include #include @@ -8,9 +16,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -20,10 +25,6 @@ #include #include #include - -#include "catch2/catch_test_macros.hpp" -#include "catch2/matchers/catch_matchers_string.hpp" -#include "catch2/matchers/catch_matchers_vector.hpp" // podio specific includes #include "datamodel/CompWithInit.h" #include "datamodel/ExampleCluster.h" diff --git a/tests/write_frame.h b/tests/write_frame.h index 8a7b71619..9d328206c 100644 --- a/tests/write_frame.h +++ b/tests/write_frame.h @@ -1,8 +1,6 @@ #ifndef PODIO_TESTS_WRITE_FRAME_H // NOLINT(llvm-header-guard): folder structure not suitable #define PODIO_TESTS_WRITE_FRAME_H // NOLINT(llvm-header-guard): folder structure not suitable -#include "frame_test_common.h" - #include "datamodel/EventInfoCollection.h" #include "datamodel/ExampleClusterCollection.h" #include "datamodel/ExampleHitCollection.h" @@ -14,11 +12,10 @@ #include "datamodel/ExampleWithNamespaceCollection.h" #include "datamodel/ExampleWithOneRelationCollection.h" #include "datamodel/ExampleWithVectorMemberCollection.h" - #include "extension_model/ContainedTypeCollection.h" #include "extension_model/ExternalComponentTypeCollection.h" #include "extension_model/ExternalRelationTypeCollection.h" - +#include "frame_test_common.h" #include "podio/Frame.h" #include "podio/UserDataCollection.h"