Bug 383049

Summary: Warnings are triggered when using boost tests
Product: [Developer tools] clazy Reporter: Gaël de Chalendar (aka Kleag) <kleagg>
Component: generalAssignee: Unassigned bugs <unassigned-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: normal CC: smartins
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Gaël de Chalendar (aka Kleag) 2017-08-02 14:18:55 UTC
Overview: Inconvenient clazy warnings on boost tests

Steps to Reproduce: 
Compile the lima project (https://github.com/aymara/lima) with clazy

Actual Results:
You get warnings when using boost unit tests, like that:

/home/gael/Projets/Lima/lima/lima_common/src/common/Data/tests/ReadWriteTools1.cpp:30:1: warning: Using copy-ctor but class boost::unit_test::basic_cstring has a
      trivial copy-ctor but non trivial assign operator [-Wclazy-rule-of-two-soft]
/usr/include/boost/test/unit_test_suite.hpp:114:73: note: expanded from macro 'BOOST_AUTO_TEST_CASE'
#define BOOST_AUTO_TEST_CASE( test_name )                               \
                                                                        ^
/usr/include/boost/test/unit_test_suite.hpp:103:46: note: expanded from macro '\
BOOST_FIXTURE_TEST_CASE'
        &BOOST_AUTO_TC_INVOKER( test_name ), #test_name ),              \

Expected Results: 
While we should switch to QTest, this is not possible currently. In the meantime, I'd like to force clazy to don't run tests in the folders containing the boost tests, but it doesn't seem to be possible.

I don't want to suppress any given test everywhere with options like -Wclazy-non-pod-global-static.
Comment 1 Gaël de Chalendar (aka Kleag) 2017-08-02 14:23:32 UTC
Sorry, I found the "// clazy:skip" notation in documentation just after sending the bug report. 
It solves my problem.