Age | Commit message (Collapse) | Author | Lines |
|
Like other versions before, gcc 13 moved around some includes and as a
result <cstdint> is no longer transitively included. Explicitly include
it for uint64_t.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
There's not much benefit in using `capped_distance` if any. Replace it
with IteratorRange<T>::size() to make the code simpler and more readable
|
|
|
|
|
|
The size() method returned wrong results because it had begin and end
iterators switched. It went unnoticed because we neither had any test
nor user for it so far
Fixes: 0161a0f68496 ("util: add IteratorRange utility")
|
|
Fixes the following build error with gtest 1.11.0:
```
FAILED: paludis/util/CMakeFiles/iterator_range_TEST.dir/iterator_range_TEST.cc.o
/usr/bin/g++ -DDATADIR=\"/usr/share\" -DENABLE_PBINS -DENABLE_PYTHON_HOOKS -DENABLE_STRIPPER -DGTEST_LINKED_AS_SHARED_LIBRARY=1 -DLIBDIR=\"/usr/x86_64-pc-linux-gnu/lib\" -DLIBEXECDIR=\"/usr/x86_64-pc-linux-gnu/libexec\" -DPALUDIS_NO_EXPLICIT_FULLY_SPECIALISED=1 -DPALUDIS_VERSION_MAJOR=3 -DPALUDIS_VERSION_MINOR=0 -DSYSCONFDIR=\"/etc\" -I/builds/marv/paludis/build-obj -I/builds/marv/paludis -Werror -pipe -O0 -pedantic -g3 -Wall -Wextra -Wold-style-cast -Wredundant-decls -Wstrict-null-sentinel -Wmissing-noreturn -Woverloaded-virtual -Winit-self -Wunreachable-code -Wunused -Wshadow -Wwrite-strings -Wfloat-equal -Wno-ignored-qualifiers -Wno-non-virtual-dtor -fvisibility=hidden -fvisibility-inlines-hidden -Wno-return-type-c-linkage -g -fPIE -std=gnu++17 -MD -MT paludis/util/CMakeFiles/iterator_range_TEST.dir/iterator_range_TEST.cc.o -MF paludis/util/CMakeFiles/iterator_range_TEST.dir/iterator_range_TEST.cc.o.d -o paludis/util/CMakeFiles/iterator_range_TEST.dir/iterator_range_TEST.cc.o -c /builds/marv/paludis/paludis/util/iterator_range_TEST.cc
In file included from /usr/include/gmock/gmock-spec-builders.h:75,
from /usr/include/gmock/gmock-function-mocker.h:42,
from /usr/include/gmock/gmock.h:61,
from /builds/marv/paludis/paludis/util/iterator_range_TEST.cc:24:
/usr/include/gmock/gmock-matchers.h: In instantiation of 'bool testing::internal::ElementsAreMatcherImpl<Container>::MatchAndExplain(Container, testing::MatchResultListener*) const [with Container = const paludis::IteratorRange<__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > > >&]':
/usr/include/gmock/gmock-matchers.h:3228:8: required from here
/usr/include/gmock/gmock-matchers.h:3238:43: error: no type named 'const_iterator' in 'testing::internal::ElementsAreMatcherImpl<const paludis::IteratorRange<__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > > >&>::StlContainer' {aka 'class paludis::IteratorRange<__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > > >'}
3238 | typename StlContainer::const_iterator it = stl_container.begin();
| ^~
```
This surfaced in the Gentoo build in our CI pipeline. gtest >=1.12.0 uses
`auto` instead of `typename Container::const_iterator` which is why the error
didn't come up on Exherbo where gtest is already at 1.12.0
|
|
This allows checking IteratorRange<T> types using gmock like:
```
EXPECT_THAT(range, ElementsAre("one", "two", "three"));
```
which would otherwise fail with the following error:
```
In file included from /home/marv/devel/paludis-worktrees/master/paludis/args/args_TEST.cc:25:
In file included from /usr/x86_64-pc-linux-gnu/include/gmock/gmock.h:58:
In file included from /usr/x86_64-pc-linux-gnu/include/gmock/gmock-function-mocker.h:43:
In file included from /usr/x86_64-pc-linux-gnu/include/gmock/gmock-spec-builders.h:77:
/usr/x86_64-pc-linux-gnu/include/gmock/gmock-matchers.h:3737:28: error: no type named 'value_type' in 'paludis::IteratorRange<paludis::WrappedForwardIterator<args::StringSetArg::ConstIteratorTag, const std::string>>'
typedef typename View::value_type Element;
~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/x86_64-pc-linux-gnu/include/gmock/gmock-matchers.h:370:12: note: in instantiation of function template specialization 'testing::internal::ElementsAreMatcher<std::tuple<const char *, const char *, const char *>>::operator Matcher<const paludis::IteratorRange<paludis::WrappedForwardIterator<args::StringSetArg::ConstIteratorTag, const std::string>> &>' requested here
return polymorphic_matcher_or_value;
^
/usr/x86_64-pc-linux-gnu/include/gmock/gmock-matchers.h:352:12: note: in instantiation of function template specialization 'testing::internal::MatcherCastImpl<const paludis::IteratorRange<paludis::WrappedForwardIterator<args::StringSetArg::ConstIteratorTag, const std::string>> &, testing::internal::ElementsAreMatcher<std::tuple<const char *, const char *, const char *>>>::CastImpl<true>' requested here
return CastImpl(polymorphic_matcher_or_value,
^
/usr/x86_64-pc-linux-gnu/include/gmock/gmock-matchers.h:512:43: note: in instantiation of member function 'testing::internal::MatcherCastImpl<const paludis::IteratorRange<paludis::WrappedForwardIterator<args::StringSetArg::ConstIteratorTag, const std::string>> &, testing::internal::ElementsAreMatcher<std::tuple<const char *, const char *, const char *>>>::Cast' requested here
return internal::MatcherCastImpl<T, M>::Cast(matcher);
^
/usr/x86_64-pc-linux-gnu/include/gmock/gmock-matchers.h:519:10: note: in instantiation of function template specialization 'testing::MatcherCast<const paludis::IteratorRange<paludis::WrappedForwardIterator<args::StringSetArg::ConstIteratorTag, const std::string>> &, testing::internal::ElementsAreMatcher<std::tuple<const char *, const char *, const char *>>>' requested here
return MatcherCast<T>(polymorphic_matcher_or_value);
^
/usr/x86_64-pc-linux-gnu/include/gmock/gmock-matchers.h:1587:39: note: in instantiation of function template specialization 'testing::SafeMatcherCast<const paludis::IteratorRange<paludis::WrappedForwardIterator<args::StringSetArg::ConstIteratorTag, const std::string>> &, testing::internal::ElementsAreMatcher<std::tuple<const char *, const char *, const char *>>>' requested here
const Matcher<const T&> matcher = SafeMatcherCast<const T&>(matcher_);
^
/home/marv/devel/paludis-worktrees/master/paludis/args/args_TEST.cc:191:5: note: in instantiation of function template specialization 'testing::internal::PredicateFormatterFromMatcher<testing::internal::ElementsAreMatcher<std::tuple<const char *, const char *, const char *>>>::operator()<paludis::IteratorRange<paludis::WrappedForwardIterator<args::StringSetArg::ConstIteratorTag, const std::string>>>' requested here
EXPECT_THAT(c1.arg_stringset.args(), ElementsAre("one", "two", "three"));
^
```
|
|
program
SafeOFStream uses a buffer, so we can't really be sure the contents are
written to file completely before the stream object is destroyed.
Assure this by limiting its scope
|
|
There are two different cases:
non-empty basename:
- write graphviz to ${basename}.graphviz
- create ${basename}.${format} if `--graph-jobs-format` was given
empty basename:
- just print graphviz to stdout
Instead of checking whether we are supposed to write/have written the
graphviz to a file in three places handle the two cases separately to
make it more readable
|
|
- Add a comma and whitespace after install job labels
- Remove redundant whitespace in job dependency attributes
Before:
job543 [ label="paludis:0::arbor -> pbins-amd64"shape=octagon, fillcolor=aquamarine3, style=filled ]
job543 -> job542 [ color=crimson ]
job543 -> job527 [ color=indianred style=dotted ]
job543 -> job529 [ color=indianred style=dotted ]
After:
job543 [ label="paludis:0::arbor -> pbins-amd64", shape=octagon, fillcolor=aquamarine3, style=filled ]
job543 -> job542 [ color=crimson ]
job543 -> job527 [ color=indianred style=dotted ]
job543 -> job529 [ color=indianred style=dotted ]
|
|
|
|
|
|
|
|
Remove the `! ok` from the loop condition statement and instead break
out of the loop if `ok` is `true`
This allows converting to a range-based loop
|
|
|
|
The class already includes the 'phases' part in its name so it's
redundant and we can just use `begin`/`end`.
This also allows the use of range-based for loops
|
|
|
|
|
|
|
|
`name` is rather ambigious in this context since we're dealing with
phase names and the filename of the hook
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|