<div dir="ltr"><div><div><div><div>Hello,<br><br></div>Is there a way to get clang-format to format Microsoft::VisualStudio::<wbr>CppUnitTestFramework TEST_CLASS.., TEST_METHOD... Attributes "nicely"?<br><br>Currently clang-format (style llvm) "messes" up the following sections:<br><br>BEGIN_TEST_CLASS_ATTRIBUTE() <br>        TEST_CLASS_ATTRIBUTE<br></div><div>and <br>BEGIN_TEST_METHOD_ATTRIBUTE(<wbr>tf_clang1) <br>        TEST_METHOD_ATTRIBUTE(L"ID", L"ID1")</div><div><br></div><br>What I want(and used for clang-format style=llvm)  is:<br><br>#include "stdafx.h"<br><br>using namespace Microsoft::VisualStudio::<wbr>CppUnitTestFramework;<br><br>/**<br> \class tc_clang<br> Bla Bla Bla<br> */<br>TEST_CLASS(tc_clang) {<br>    BEGIN_TEST_CLASS_ATTRIBUTE() <br>        TEST_CLASS_ATTRIBUTE(L"level", L"l1")<br>        TEST_CLASS_ATTRIBUTE(L"module"<wbr>, L"m1") <br>    END_TEST_CLASS_ATTRIBUTE()<br><br>public:<br><br>    /**<br>     \fn tf_clang1()<br>     Bla Bla Bla<br>     */<br><br>    BEGIN_TEST_METHOD_ATTRIBUTE(<wbr>tf_clang1) <br>        TEST_METHOD_ATTRIBUTE(L"ID", L"ID1")<br>        TEST_METHOD_ATTRIBUTE(L"Name", L"Name1") <br>    END_TEST_METHOD_ATTRIBUTE()<br><br>    TEST_METHOD(tf_clang1) {<br><br>        int n = 1;<br>        n++;<br>    }<br><br>    /**<br>     \fn tf_clang2()<br>    bla bla bla<br>     */<br><br>    BEGIN_TEST_METHOD_ATTRIBUTE (tf_clang2)<br>        TEST_METHOD_ATTRIBUTE(L"ID", L"ID2")<br>        TEST_METHOD_ATTRIBUTE(L"Name", L"Name2")<br>    END_TEST_METHOD_ATTRIBUTE()<br>    TEST_METHOD(tf_clang2) {<br>        {<br>            int i = 1;<br>            i++;<br>        }<br>    }<br>};<br><br><br><br><br><br></div>What I get is<br><br>#include "stdafx.h"<br><br>using namespace Microsoft::VisualStudio::<wbr>CppUnitTestFramework;<br><br>/**<br> \class tc_clang<br> Bla Bla Bla<br> */<br>TEST_CLASS(tc_clang){<br>  BEGIN_TEST_CLASS_ATTRIBUTE() TEST_CLASS_ATTRIBUTE(L"level", L"l1")<br>      TEST_CLASS_ATTRIBUTE(L"module"<wbr>, L"m1") END_TEST_CLASS_ATTRIBUTE()<br><br>          public :<br><br>              /**<br>               \fn tf_clang1()<br>               Bla Bla Bla<br>               */<br><br>              BEGIN_TEST_METHOD_ATTRIBUTE(<wbr>tf_clang1)<br>                  TEST_METHOD_ATTRIBUTE(L"ID", L"ID1")<br>                      TEST_METHOD_ATTRIBUTE(L"Name", L"Name1")<br>                          END_TEST_METHOD_ATTRIBUTE()<br><br>                              TEST_METHOD(tf_clang1){<br><br>                              <wbr>    int n = 1;<br>n++;<br>}<br><br>/**<br> \fn tf_clang2()<br>bla bla bla<br> */<br><br>BEGIN_TEST_METHOD_ATTRIBUTE(<wbr>tf_clang2)<br>TEST_METHOD_ATTRIBUTE(L"ID", L"ID2")<br>TEST_METHOD_ATTRIBUTE(L"Name", L"Name2")<br>END_TEST_METHOD_ATTRIBUTE()<br>TEST_METHOD(tf_clang2) {<br>  {<br>    int i = 1;<br>    i++;<br>  }<br>}<br>}<br>;<br><br><br></div>Michael Boelling</div>