Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 0 additions & 93 deletions Detectors/FIT/T0/macros/readHitsDigits.C

This file was deleted.

71 changes: 0 additions & 71 deletions Detectors/FIT/T0/macros/run_reco_t0.C

This file was deleted.

5 changes: 5 additions & 0 deletions Detectors/ITSMFT/ITS/macros/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ o2_add_test_root_macro(CheckDigits.C
O2::DetectorsBase
LABELS its)

o2_add_test_root_macro(CheckLookUp.C
PUBLIC_LINK_LIBRARIES O2::ITSMFTReconstruction
O2::DataFormatsITSMFT
LABELS its)

o2_add_test_root_macro(CheckLUtime.C
PUBLIC_LINK_LIBRARIES O2::ITSMFTReconstruction
O2::DataFormatsITSMFT
Expand Down
5 changes: 3 additions & 2 deletions cmake/O2AddTestRootMacro.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ include_guard()
# give us, _transitively_, all the libraries directories. And computing them
# ourselves (recursively) is quite time consuming...
#
function(o2_add_test_root_macro)
function(o2_add_test_root_macro macro)

if(NOT BUILD_TESTING)
return()
Expand All @@ -70,7 +70,8 @@ function(o2_add_test_root_macro)
FATAL_ERROR "Unexpected unparsed arguments: ${A_UNPARSED_ARGUMENTS}")
endif()

get_filename_component(macroFileName ${ARGV0} ABSOLUTE)
get_filename_component(macroFileName ${macro} ABSOLUTE)


if(NOT EXISTS ${macroFileName})
message(
Expand Down
22 changes: 22 additions & 0 deletions cmake/O2GetListOfMacros.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright CERN and copyright holders of ALICE O2. This software is distributed
# under the terms of the GNU General Public License v3 (GPL Version 3), copied
# verbatim in the file "COPYING".
#
# See http://alice-o2.web.cern.ch/license for full licensing information.
#
# In applying this license CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization or
# submit itself to any jurisdiction.

include_guard()

#
# o2_get_list_of_macros fills ${varname} with the list of macros (*.C files)
# found in directory ${dir}
#
function(o2_get_list_of_macros dir varname)
file(GLOB_RECURSE listOfMacros RELATIVE ${CMAKE_SOURCE_DIR} ${dir}/*.C)
# Case sensitive filtering of .C files (to avoid .c files on Mac)
list(FILTER listOfMacros INCLUDE REGEX "^.*\\.C$")
set(${varname} ${listOfMacros} PARENT_SCOPE)
endfunction()
58 changes: 47 additions & 11 deletions cmake/O2ReportNonTestedMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,49 @@

include_guard()

include(O2RootMacroExclusionList)
include(O2GetListOfMacros)

#
# Loop over the Root macros that exists in the repository and check whether
# there is one (or two) test for that macro (i.e. the o2_add_test_root_macro
# function has been called). If the macro is not tested and is not part of a
# known exclusion list (defined in O2RootMacroExclusionList.cmake file), then a
# FATAL_ERROR is issued
#
# Print a list of the Root macros that exists in the repository but for which
# the o2_add_test_root_macro function has not been called.
# (unless the DO_NOT_FAIL parameter is given, in which case those cases are
# simply reported).
#
function(o2_report_non_tested_macros)
file(GLOB_RECURSE listOfMacros RELATIVE ${CMAKE_SOURCE_DIR} *.C)

cmake_parse_arguments(PARSE_ARGV
0
A
"DO_NOT_FAIL;QUIET"
""
"")

o2_get_list_of_macros(${CMAKE_SOURCE_DIR} listOfMacros)

list(LENGTH listOfMacros nmacros)
foreach(m ${listOfMacros})
if(NOT ${m} IN_LIST LIST_OF_ROOT_MACRO_TESTS)
list(APPEND notTested ${m})
list(APPEND notTestedLoading ${m})
endif()
if(NOT ${m} IN_LIST LIST_OF_ROOT_MACRO_TESTS_COMPILED)
list(APPEND notTestedCompiled ${m})
endif()
endforeach()
list(LENGTH notTested n)
list(LENGTH notTestedLoading n)
list(LENGTH notTestedCompiled nc)
list(LENGTH O2_ROOT_MACRO_EXCLUSION_LIST ne)
if(${n} GREATER 0)
message(
STATUS
"WARNING : ${n}(L) and ${nc}(C) over ${nmacros} Root macros are NOT tested (L for loading, C for compilation) "
)
if(NOT A_QUIET)
message(
STATUS
"WARNING : ${n}(L) and ${nc}(C) over ${nmacros} Root macros are NOT tested (L for loading, C for compilation). ${ne} are exempted (E)."
)
endif()
message(STATUS)
foreach(m ${listOfMacros})
set(loading " ")
Expand All @@ -42,9 +63,24 @@ function(o2_report_non_tested_macros)
if(${m} IN_LIST LIST_OF_ROOT_MACRO_TESTS_COMPILED)
set(compile "C")
endif()
if(${m} IN_LIST O2_ROOT_MACRO_EXCLUSION_LIST)
set(exempted "E")
endif()
if(NOT ${m} IN_LIST LIST_OF_ROOT_MACRO_TESTS_COMPILED
OR NOT ${m} IN_LIST LIST_OF_ROOT_MACRO_TESTS)
message(STATUS "[${loading}] [${compile}] ${m}")
OR NOT ${m} IN_LIST LIST_OF_ROOT_MACRO_TESTS
OR ${m} IN_LIST O2_ROOT_MACRO_EXCLUSION_LIST)
if(NOT A_QUIET)
message(STATUS "[${loading}] [${compile}] [${exempted}] ${m}")
endif()
endif()
if(NOT ${m} IN_LIST LIST_OF_ROOT_MACRO_TESTS
AND NOT ${m} IN_LIST LIST_OF_ROOT_MACRO_TESTS_COMPILED
AND NOT ${m} IN_LIST O2_ROOT_MACRO_EXCLUSION_LIST)
if(NOT A_DO_NOT_FAIL)
message(FATAL_ERROR "Macro ${m} should be tested")
else()
message(WARNING "Macro ${m} is not tested at all !!!")
endif()
endif()
endforeach()
message(STATUS)
Expand Down
70 changes: 70 additions & 0 deletions cmake/O2RootMacroExclusionList.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Copyright CERN and copyright holders of ALICE O2. This software is distributed
# under the terms of the GNU General Public License v3 (GPL Version 3), copied
# verbatim in the file "COPYING".
#
# See http://alice-o2.web.cern.ch/license for full licensing information.
#
# In applying this license CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization or
# submit itself to any jurisdiction.

include_guard()

include(O2GetListOfMacros)

#
# List of macros that are allowed (hopefully temporarily) to escape testing.
#

list(APPEND O2_ROOT_MACRO_EXCLUSION_LIST
CCDB/example/fill_local_ocdb.C
DataFormats/simulation/test/checkStack.C
Detectors/ITSMFT/ITS/macros/EVE/rootlogon.C
Detectors/ITSMFT/ITS/macros/test/rootlogon.C
Detectors/MUON/MCH/Simulation/macros/rootlogon.C
Detectors/Passive/macro/PutFrameInTop.C
Detectors/TPC/reconstruction/macro/addInclude.C
Detectors/TPC/reconstruction/macro/getTPCTransformationExample.C
GPU/GPUTracking/Merger/macros/checkPropagation.C
GPU/GPUTracking/Merger/macros/fitPolynomialFieldIts.C
GPU/GPUTracking/Merger/macros/fitPolynomialFieldTpc.C
GPU/GPUTracking/Merger/macros/fitPolynomialFieldTrd.C
GPU/GPUTracking/Standalone/tools/createGeo.C
GPU/GPUTracking/Standalone/tools/createLUT.C
GPU/GPUTracking/Standalone/tools/dump.C
GPU/GPUTracking/TRDTracking/macros/checkDbgOutput.C
GPU/TPCFastTransformation/macro/createTPCFastTransform.C
GPU/TPCFastTransformation/macro/generateTPCDistortionNTuple.C
GPU/TPCFastTransformation/macro/initTPCcalibration.C
GPU/TPCFastTransformation/macro/loadlibs.C
GPU/TPCFastTransformation/macro/moveTPCFastTransform.C
Generators/share/external/hijing.C
macro/SetIncludePath.C
macro/loadExtDepLib.C
macro/load_all_libs.C
macro/putCondition.C
macro/rootlogon.C)

if(NOT BUILD_SIMULATION)
# some complete sub_directories are not added to the build when not building
# simulation, so the corresponding o2_add_test_root_macro won't be called at
# all
o2_get_list_of_macros(${CMAKE_SOURCE_DIR}/macro macros)
list(APPEND O2_ROOT_MACRO_EXCLUSION_LIST ${macros})
o2_get_list_of_macros(${CMAKE_SOURCE_DIR}/Detectors/gconfig macros)
list(APPEND O2_ROOT_MACRO_EXCLUSION_LIST ${macros})
endif()

if(NOT pythia6_FOUND)
list(APPEND O2_ROOT_MACRO_EXCLUSION_LIST Generators/share/external/pythia6.C)
endif()

list(REMOVE_DUPLICATES O2_ROOT_MACRO_EXCLUSION_LIST)

# check exclusion list contains only existing macros
foreach(m ${O2_ROOT_MACRO_EXCLUSION_LIST})
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/${m})
message(FATAL_ERROR "Exclusion list contains a non-existing macro : ${m}")
endif()
endforeach()