Also add test in googletest.cpp
This commit is contained in:
parent
9f4db5018d
commit
4d305d5c54
|
@ -39,4 +39,16 @@
|
|||
<define name="GTEST_CONCAT_TOKEN_(foo, bar)" value="GTEST_CONCAT_TOKEN_IMPL_(foo, bar)"/>
|
||||
<define name="GTEST_CONCAT_TOKEN_IMPL_(foo, bar)" value="foo ## bar"/>
|
||||
<define name="GTEST_STRINGIFY_(name)" value="#name"/>
|
||||
<define name="GTEST_REFERENCE_TO_CONST_(T)" value="typename ::testing::internal::ConstRef<T>::type"/>
|
||||
<define name="GTEST_ATTRIBUTE_UNUSED_" value="__attribute__ ((unused))"/>
|
||||
<define name="MATCHER_P(name, p0, description)" value="bool name##MatcherP<p0##_type>::gmock_Impl<arg_type>::MatchAndExplain( GTEST_REFERENCE_TO_CONST_(arg_type) arg, ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_) const"/>
|
||||
<define name="MATCHER_P2(name, p0, p1, description)" value="bool name##MatcherP2<p0##_type, p1##_type>::gmock_Impl<arg_type>::MatchAndExplain(GTEST_REFERENCE_TO_CONST_(arg_type) arg,::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_) const"/>
|
||||
<define name="MATCHER_P3(name, p0, p1, p2, description)" value="bool name##MatcherP3<p0##_type, p1##_type, p2##_type>::gmock_Impl<arg_type>::MatchAndExplain(GTEST_REFERENCE_TO_CONST_(arg_type) arg,::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_) const"/>
|
||||
<define name="MATCHER_P4(name, p0, p1, p2, p3, description)" value="bool name##MatcherP4<p0##_type, p1##_type, p2##_type, p3##_type>::gmock_Impl<arg_type>::MatchAndExplain(GTEST_REFERENCE_TO_CONST_(arg_type) arg,::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_) const"/>
|
||||
<define name="MATCHER_P5(name, p0, p1, p2, p3, p4, description)" value="bool name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type>::gmock_Impl<arg_type>::MatchAndExplain(GTEST_REFERENCE_TO_CONST_(arg_type) arg,::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_) const"/>
|
||||
<define name="MATCHER_P6(name, p0, p1, p2, p3, p4, p5, description)" value="bool name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type>::gmock_Impl<arg_type>::MatchAndExplain(GTEST_REFERENCE_TO_CONST_(arg_type) arg,::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_) const"/>
|
||||
<define name="MATCHER_P7(name, p0, p1, p2, p3, p4, p5, p6, description)" value="bool name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type, p6##_type>::gmock_Impl<arg_type>::MatchAndExplain(GTEST_REFERENCE_TO_CONST_(arg_type) arg,::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_) const"/>
|
||||
<define name="MATCHER_P8(name, p0, p1, p2, p3, p4, p5, p6, p7, description)" value="bool name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type, p6##_type, p7##_type>::gmock_Impl<arg_type>::MatchAndExplain(GTEST_REFERENCE_TO_CONST_(arg_type) arg,::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_) const"/>
|
||||
<define name="MATCHER_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, description)" value="bool name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type, p6##_type, p7##_type, p8##_type>::gmock_Impl<arg_type>::MatchAndExplain(GTEST_REFERENCE_TO_CONST_(arg_type) arg,::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_) const"/>
|
||||
<define name="MATCHER_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, description)" value="bool name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type>::gmock_Impl<arg_type>::MatchAndExplain(GTEST_REFERENCE_TO_CONST_(arg_type) arg,::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_) const"/>
|
||||
</def>
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
|
||||
// Test library configuration for googletest.cfg
|
||||
//
|
||||
// Usage:
|
||||
// $ cppcheck --check-library --library=googletest --enable=information --error-exitcode=1 --inline-suppr --suppress=missingIncludeSystem test/cfg/googletest.cpp
|
||||
// =>
|
||||
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
|
||||
//
|
||||
|
||||
#include <gmock/gmock-generated-matchers.h>
|
||||
|
||||
// #9397 syntaxError when MATCHER_P is not known
|
||||
namespace ExampleNamespace {
|
||||
constexpr long long TOLERANCE = 10;
|
||||
|
||||
MATCHER_P(ExampleMatcherTest, expected, "")
|
||||
{
|
||||
return ((arg <= (expected + TOLERANCE)) && (arg >= (expected - TOLERANCE)));
|
||||
}
|
||||
}
|
|
@ -280,6 +280,8 @@ else
|
|||
fi
|
||||
${CPPCHECK} ${CPPCHECK_OPT} --library=cairo ${DIR}cairo.c
|
||||
|
||||
${CPPCHECK} ${CPPCHECK_OPT} --inconclusive --library=googletest ${DIR}googletest.cpp
|
||||
|
||||
# Check the syntax of the defines in the configuration files
|
||||
set +e
|
||||
xmlstarlet --version
|
||||
|
|
Loading…
Reference in New Issue