Skip to content

Commit b03f7f6

Browse files
committed
Merge branch 'develop' into 'main'
Tools v0.4.4 See merge request njoy/tools!37
2 parents 22bae77 + 434854e commit b03f7f6

File tree

170 files changed

+171
-179
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+171
-179
lines changed

.cmake/shacl_FetchContent.cmake

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,19 +157,32 @@ function(shacl_FetchContent_Declare name)
157157
if(NOT override_pkg_index EQUAL -1)
158158
message(FATAL_ERROR "shacl_FetchContent - cannot use OVERRIDE_FIND_PACKAGE in conjunction with shacl_Fetchcontent.force_find_package")
159159
endif()
160-
list(APPEND arg_subset REQUIRED)
160+
list(APPEND arg_subset REQUIRED)
161161
endif()
162+
162163
# If the dependency uses a relative path then it uses the same server as the host project.
163164
# This is useful for automated testing with gitlab CI tokens or if repos are hosted on different servers
164165
# e.g. if the project is hosted on github then pull all relative dependencies from github.
165166

166-
# Find the GIT_REPOSITORY keyword then increment index to point to associated value
167+
# Find the GIT_REPOSITORY keyword then increment index to point to associated value.
167168
list(FIND arg_subset GIT_REPOSITORY git_repository_index)
168169
math(EXPR git_repository_index "${git_repository_index}+1")
169170
list(GET arg_subset ${git_repository_index} git_repository_url)
170171

171-
# Update the git URL if it was a relative URL, otherwise return it unchanged
172+
# Update the git URL if it was a relative URL, otherwise return it unchanged.
172173
get_dependency_url(${git_repository_url} updated_url)
174+
175+
# If the .git directory does not exist, then cmake will fail to resolve a relative url and throw an error.
176+
# In that case replace the relative URL with a value to avoid the error and force the use of find_package.
177+
if( NOT IS_DIRECTORY "${PROJECT_SOURCE_DIR}/.git")
178+
if( "${updated_url}" MATCHES "^\\./|^\\.\\./" )
179+
message( WARNING "Could not find local .git directory to resolve a relative url, forcing the use of find_package")
180+
set( shacl_FetchContent.force_find_package ON )
181+
list(APPEND arg_subset REQUIRED)
182+
set( updated_url "unresolved_relative_url.git" )
183+
endif()
184+
endif()
185+
173186
list(REMOVE_AT arg_subset ${git_repository_index})
174187
list(INSERT arg_subset ${git_repository_index} ${updated_url})
175188

.gitlab-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ trigger_ci_downstream:
2323

2424
variables:
2525
MERGE_TYPE: $CI_PIPELINE_SOURCE
26+
PARENT_MR_ID: "$CI_MERGE_REQUEST_IID"
2627
PROJECT_ROOT_NAME: "Tools"
2728

2829
check:
2930
stage: check_ok
3031
script:
32+
- printenv
3133
- echo "Looks good..."

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if( DEFINED PROJECT_NAME )
1010
endif()
1111

1212
project( tools
13-
VERSION 0.4.3
13+
VERSION 0.4.4
1414
LANGUAGES CXX
1515
)
1616

@@ -77,11 +77,11 @@ target_compile_definitions( tools INTERFACE -DNANORANGE_NO_STD_FORWARD_DECLARATI
7777
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
7878

7979
if( tools.python )
80-
add_subdirectory(python)
80+
add_subdirectory( python )
8181
endif()
8282

8383
if( tools.tests )
84-
include( cmake/unit_testing.cmake )
84+
add_subdirectory( test )
8585
endif()
8686

8787
#######################################################################

ReleaseNotes.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Release Notes—tools
22
Given here are some release notes for tools.
33

4+
## tools v0.4.4
5+
Bug fixes:
6+
- fix an issue when using tools in a C++-20 project.
7+
- fix an issue in disco to solve a Windows compilation issue.
8+
9+
Shacl-cmake was updated to the latest version.
10+
411
## tools v0.4.3
512
Bug fixes:
613
- fix an issue using intel classic 2023.1.0 (compilation error on the all view)

cmake/unit_testing.cmake

Lines changed: 132 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -24,40 +24,136 @@ endfunction()
2424
# Unit testing directories
2525
#######################################################################
2626

27-
add_subdirectory( src/tools/test )
2827
#Removing tests for logging as th feeature is not used
29-
#add_subdirectory( src/tools/Log/test )
30-
31-
add_subdirectory( src/tools/disco/functions/test )
32-
add_subdirectory( src/tools/disco/BaseField/test )
33-
add_subdirectory( src/tools/disco/FreeFormatCharacter/test )
34-
add_subdirectory( src/tools/disco/FreeFormatInteger/test )
35-
add_subdirectory( src/tools/disco/FreeFormatReal/test )
36-
add_subdirectory( src/tools/disco/BaseFixedWidthField/test )
37-
add_subdirectory( src/tools/disco/Column/test )
38-
add_subdirectory( src/tools/disco/Character/test )
39-
add_subdirectory( src/tools/disco/Integer/test )
40-
add_subdirectory( src/tools/disco/Real/test )
41-
add_subdirectory( src/tools/disco/FixedPoint/test )
42-
add_subdirectory( src/tools/disco/Scientific/test )
43-
add_subdirectory( src/tools/disco/ENDF/test )
44-
add_subdirectory( src/tools/disco/Record/test )
45-
46-
add_subdirectory( src/tools/std20/algorithm/test )
47-
add_subdirectory( src/tools/std20/concepts/test )
48-
add_subdirectory( src/tools/std20/functional/test )
49-
add_subdirectory( src/tools/std20/iterator/concepts/test )
50-
add_subdirectory( src/tools/std20/iterator/operations/test )
51-
add_subdirectory( src/tools/std20/iterator/test )
52-
add_subdirectory( src/tools/std20/ranges/access/test )
53-
add_subdirectory( src/tools/std20/ranges/concepts/test )
54-
add_subdirectory( src/tools/std20/type_traits/test )
55-
add_subdirectory( src/tools/std20/views/test )
56-
57-
add_subdirectory( src/tools/std23/detail/views/test )
58-
add_subdirectory( src/tools/std23/views/test )
59-
60-
add_subdirectory( src/tools/std23/test )
61-
62-
add_subdirectory( src/tools/views/AnyIterator/test )
63-
add_subdirectory( src/tools/views/AnyView/test )
28+
#add_cpp_test( Log.Log Log/Log.test.cpp )
29+
30+
add_cpp_test( disco.BaseField disco/BaseField.test.cpp )
31+
add_cpp_test( disco.BaseFixedWidthField disco/BaseFixedWidthField.test.cpp )
32+
add_cpp_test( disco.Character disco/Character.test.cpp )
33+
add_cpp_test( disco.Column disco/Column.test.cpp )
34+
add_cpp_test( disco.ENDF disco/ENDF.test.cpp )
35+
add_cpp_test( disco.FixedPoint disco/FixedPoint.test.cpp )
36+
add_cpp_test( disco.FreeFormatCharacter disco/FreeFormatCharacter.test.cpp )
37+
add_cpp_test( disco.FreeFormatInteger disco/FreeFormatInteger.test.cpp )
38+
add_cpp_test( disco.FreeFormatReal disco/FreeFormatReal.test.cpp )
39+
add_cpp_test( disco.Integer disco/Integer.test.cpp )
40+
add_cpp_test( disco.Real disco/Real.test.cpp )
41+
add_cpp_test( disco.Record disco/Record.test.cpp )
42+
add_cpp_test( disco.Scientific disco/Scientific.test.cpp )
43+
add_cpp_test( disco.functions disco/functions.test.cpp )
44+
add_cpp_test( std20.algorithm.adjacent_find std20/algorithm/adjacent_find.test.cpp )
45+
add_cpp_test( std20.algorithm.count std20/algorithm/count.test.cpp )
46+
add_cpp_test( std20.algorithm.count_if std20/algorithm/count_if.test.cpp )
47+
add_cpp_test( std20.algorithm.equal std20/algorithm/equal.test.cpp )
48+
add_cpp_test( std20.algorithm.find std20/algorithm/find.test.cpp )
49+
add_cpp_test( std20.algorithm.min std20/algorithm/min.test.cpp )
50+
add_cpp_test( std20.algorithm.mismatch std20/algorithm/mismatch.test.cpp )
51+
add_cpp_test( std20.concepts.assignable_from std20/concepts/assignable_from.test.cpp )
52+
add_cpp_test( std20.concepts.common_reference_with std20/concepts/common_reference_with.test.cpp )
53+
add_cpp_test( std20.concepts.common_with std20/concepts/common_with.test.cpp )
54+
add_cpp_test( std20.concepts.constructible_from std20/concepts/constructible_from.test.cpp )
55+
add_cpp_test( std20.concepts.convertible_to std20/concepts/convertible_to.test.cpp )
56+
add_cpp_test( std20.concepts.copy_constructible std20/concepts/copy_constructible.test.cpp )
57+
add_cpp_test( std20.concepts.copyable std20/concepts/copyable.test.cpp )
58+
add_cpp_test( std20.concepts.default_initializable std20/concepts/default_initializable.test.cpp )
59+
add_cpp_test( std20.concepts.derived_from std20/concepts/derived_from.test.cpp )
60+
add_cpp_test( std20.concepts.destructible std20/concepts/destructible.test.cpp )
61+
add_cpp_test( std20.concepts.equality_comparable std20/concepts/equality_comparable.test.cpp )
62+
add_cpp_test( std20.concepts.floating_point std20/concepts/floating_point.test.cpp )
63+
add_cpp_test( std20.concepts.integral std20/concepts/integral.test.cpp )
64+
add_cpp_test( std20.concepts.invocable std20/concepts/invocable.test.cpp )
65+
add_cpp_test( std20.concepts.movable std20/concepts/movable.test.cpp )
66+
add_cpp_test( std20.concepts.move_constructible std20/concepts/move_constructible.test.cpp )
67+
add_cpp_test( std20.concepts.regular std20/concepts/regular.test.cpp )
68+
add_cpp_test( std20.concepts.relation std20/concepts/relation.test.cpp )
69+
add_cpp_test( std20.concepts.same_as std20/concepts/same_as.test.cpp )
70+
add_cpp_test( std20.concepts.semiregular std20/concepts/semiregular.test.cpp )
71+
add_cpp_test( std20.concepts.signed_integral std20/concepts/signed_integral.test.cpp )
72+
add_cpp_test( std20.concepts.strict_weak_order std20/concepts/strict_weak_order.test.cpp )
73+
add_cpp_test( std20.concepts.swappable std20/concepts/swappable.test.cpp )
74+
add_cpp_test( std20.concepts.totally_ordered std20/concepts/totally_ordered.test.cpp )
75+
add_cpp_test( std20.concepts.unsigned_integral std20/concepts/unsigned_integral.test.cpp )
76+
add_cpp_test( std20.functional.equal_to std20/functional/equal_to.test.cpp )
77+
add_cpp_test( std20.functional.greater std20/functional/greater.test.cpp )
78+
add_cpp_test( std20.functional.greater_equal std20/functional/greater_equal.test.cpp )
79+
add_cpp_test( std20.functional.identity std20/functional/identity.test.cpp )
80+
add_cpp_test( std20.functional.invoke std20/functional/invoke.test.cpp )
81+
add_cpp_test( std20.functional.less std20/functional/less.test.cpp )
82+
add_cpp_test( std20.functional.less_equal std20/functional/less_equal.test.cpp )
83+
add_cpp_test( std20.functional.not_equal_to std20/functional/not_equal_to.test.cpp )
84+
add_cpp_test( std20.iterator.concepts.bidirectional_iterator std20/iterator/concepts/bidirectional_iterator.test.cpp )
85+
add_cpp_test( std20.iterator.concepts.contiguous_iterator std20/iterator/concepts/contiguous_iterator.test.cpp )
86+
add_cpp_test( std20.iterator.concepts.forward_iterator std20/iterator/concepts/forward_iterator.test.cpp )
87+
add_cpp_test( std20.iterator.concepts.incrementable std20/iterator/concepts/incrementable.test.cpp )
88+
add_cpp_test( std20.iterator.concepts.input_iterator std20/iterator/concepts/input_iterator.test.cpp )
89+
add_cpp_test( std20.iterator.concepts.input_or_output_iterator std20/iterator/concepts/input_or_output_iterator.test.cpp )
90+
add_cpp_test( std20.iterator.concepts.output_iterator std20/iterator/concepts/output_iterator.test.cpp )
91+
add_cpp_test( std20.iterator.concepts.random_access_iterator std20/iterator/concepts/random_access_iterator.test.cpp )
92+
add_cpp_test( std20.iterator.concepts.readable std20/iterator/concepts/readable.test.cpp )
93+
add_cpp_test( std20.iterator.concepts.sentinel_for std20/iterator/concepts/sentinel_for.test.cpp )
94+
add_cpp_test( std20.iterator.concepts.sized_sentinel_for std20/iterator/concepts/sized_sentinel_for.test.cpp )
95+
add_cpp_test( std20.iterator.concepts.writable std20/iterator/concepts/writable.test.cpp )
96+
add_cpp_test( std20.iterator.operations.advance std20/iterator/operations/advance.test.cpp )
97+
add_cpp_test( std20.iterator.operations.distance std20/iterator/operations/distance.test.cpp )
98+
add_cpp_test( std20.iterator.operations.next std20/iterator/operations/next.test.cpp )
99+
add_cpp_test( std20.iterator.operations.prev std20/iterator/operations/prev.test.cpp )
100+
add_cpp_test( std20.iterator.common_iterator std20/iterator/common_iterator.test.cpp )
101+
add_cpp_test( std20.iterator.readable_traits std20/iterator/readable_traits.test.cpp )
102+
add_cpp_test( std20.iterator.reverse_iterator std20/iterator/reverse_iterator.test.cpp )
103+
add_cpp_test( std20.ranges.access.begin std20/ranges/access/begin.test.cpp )
104+
add_cpp_test( std20.ranges.access.cbegin std20/ranges/access/cbegin.test.cpp )
105+
add_cpp_test( std20.ranges.access.cdata std20/ranges/access/cdata.test.cpp )
106+
add_cpp_test( std20.ranges.access.cend std20/ranges/access/cend.test.cpp )
107+
add_cpp_test( std20.ranges.access.crbegin std20/ranges/access/crbegin.test.cpp )
108+
add_cpp_test( std20.ranges.access.crend std20/ranges/access/crend.test.cpp )
109+
add_cpp_test( std20.ranges.access.data std20/ranges/access/data.test.cpp )
110+
add_cpp_test( std20.ranges.access.distance std20/ranges/access/distance.test.cpp )
111+
add_cpp_test( std20.ranges.access.empty std20/ranges/access/empty.test.cpp )
112+
add_cpp_test( std20.ranges.access.end std20/ranges/access/end.test.cpp )
113+
add_cpp_test( std20.ranges.access.rbegin std20/ranges/access/rbegin.test.cpp )
114+
add_cpp_test( std20.ranges.access.rend std20/ranges/access/rend.test.cpp )
115+
add_cpp_test( std20.ranges.access.size std20/ranges/access/size.test.cpp )
116+
add_cpp_test( std20.ranges.access.ssize std20/ranges/access/ssize.test.cpp )
117+
add_cpp_test( std20.ranges.concepts.bidirectional_range std20/ranges/concepts/bidirectional_range.test.cpp )
118+
add_cpp_test( std20.ranges.concepts.borrowed_range std20/ranges/concepts/borrowed_range.test.cpp )
119+
add_cpp_test( std20.ranges.concepts.common_range std20/ranges/concepts/common_range.test.cpp )
120+
add_cpp_test( std20.ranges.concepts.contiguous_range std20/ranges/concepts/contiguous_range.test.cpp )
121+
add_cpp_test( std20.ranges.concepts.forward_range std20/ranges/concepts/forward_range.test.cpp )
122+
add_cpp_test( std20.ranges.concepts.input_range std20/ranges/concepts/input_range.test.cpp )
123+
add_cpp_test( std20.ranges.concepts.output_range std20/ranges/concepts/output_range.test.cpp )
124+
add_cpp_test( std20.ranges.concepts.random_access_range std20/ranges/concepts/random_access_range.test.cpp )
125+
add_cpp_test( std20.ranges.concepts.range std20/ranges/concepts/range.test.cpp )
126+
add_cpp_test( std20.ranges.concepts.sized_range std20/ranges/concepts/sized_range.test.cpp )
127+
add_cpp_test( std20.ranges.concepts.view std20/ranges/concepts/view.test.cpp )
128+
add_cpp_test( std20.ranges.concepts.viewable_range std20/ranges/concepts/viewable_range.test.cpp )
129+
add_cpp_test( std20.type_traits.common_reference std20/type_traits/common_reference.test.cpp )
130+
add_cpp_test( std20.type_traits.remove_cvref std20/type_traits/remove_cvref.test.cpp )
131+
add_cpp_test( std20.type_traits.type_identity std20/type_traits/type_identity.test.cpp )
132+
add_cpp_test( std20.views.all std20/views/all.test.cpp )
133+
add_cpp_test( std20.views.counted std20/views/counted.test.cpp )
134+
add_cpp_test( std20.views.drop std20/views/drop.test.cpp )
135+
add_cpp_test( std20.views.drop_while std20/views/drop_while.test.cpp )
136+
add_cpp_test( std20.views.elements std20/views/elements.test.cpp )
137+
add_cpp_test( std20.views.empty std20/views/empty.test.cpp )
138+
add_cpp_test( std20.views.filter std20/views/filter.test.cpp )
139+
add_cpp_test( std20.views.iota std20/views/iota.test.cpp )
140+
add_cpp_test( std20.views.join std20/views/join.test.cpp )
141+
add_cpp_test( std20.views.ref std20/views/ref.test.cpp )
142+
add_cpp_test( std20.views.reverse std20/views/reverse.test.cpp )
143+
add_cpp_test( std20.views.single std20/views/single.test.cpp )
144+
add_cpp_test( std20.views.split std20/views/split.test.cpp )
145+
add_cpp_test( std20.views.subrange std20/views/subrange.test.cpp )
146+
add_cpp_test( std20.views.take std20/views/take.test.cpp )
147+
add_cpp_test( std20.views.take_while std20/views/take_while.test.cpp )
148+
add_cpp_test( std20.views.transform std20/views/transform.test.cpp )
149+
add_cpp_test( std23.detail.views.nonpropagating_box std23/detail/views/nonpropagating_box.test.cpp )
150+
add_cpp_test( std23.usecase std23/usecase.test.cpp )
151+
#add_cpp_test( std23.views.removed.zip std23/views/removed/zip.test.cpp )
152+
#add_cpp_test( std23.views.removed.zip_transform std23/views/removed/zip_transform.test.cpp )
153+
add_cpp_test( std23.views.chunk std23/views/chunk.test.cpp )
154+
add_cpp_test( std23.views.chunk_by std23/views/chunk_by.test.cpp )
155+
add_cpp_test( std23.views.repeat std23/views/repeat.test.cpp )
156+
add_cpp_test( std23.views.stride std23/views/stride.test.cpp )
157+
add_cpp_test( overload overload.test.cpp )
158+
add_cpp_test( views.AnyIterator views/AnyIterator.test.cpp )
159+
add_cpp_test( views.AnyView views/AnyView.test.cpp )

src/tools/Log.hpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,13 @@ class Log {
6666
* int value = 10;
6767
* utility::Log::info( "Some message with a value {}", value );
6868
*/
69-
template< typename... Args >
70-
static void info( Args... args ) {
69+
template <typename... Args>
70+
static void info(fmt::format_string<Args...> format_str, Args&&... args) {
71+
logger()->info(format_str, std::forward<Args>(args)...);
72+
}
7173

72-
logger()->info( std::forward< Args >( args )... );
74+
static void info(std::string_view v) {
75+
logger()->info(v);
7376
}
7477

7578
/**
@@ -94,10 +97,9 @@ class Log {
9497
* int value = 10;
9598
* utility::Log::info( "Some message with a value {}", value );
9699
*/
97-
template< typename... Args >
98-
static void error( Args... args ) {
99-
100-
logger()->error( std::forward< Args >( args )... );
100+
template <typename... Args>
101+
static void error(fmt::format_string<Args...> format_str, Args&&... args) {
102+
logger()->error(format_str, std::forward<Args>(args)...);
101103
}
102104

103105
/**

src/tools/Log/test/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/tools/disco/BaseField/test/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/tools/disco/BaseFixedWidthField/test/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/tools/disco/Character/test/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)