<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/126931/">https://git.reviewboard.kde.org/r/126931/</a>
     </td>
    </tr>
   </table>
   <br />



<table bgcolor="#e0e0e0" width="100%" cellpadding="12" style="border: 1px gray solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>
   <h1 style="margin: 0; padding: 0; font-size: 10pt;">This change has been marked as submitted.</h1>
  </td>
 </tr>
</table>
<br />


<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for KDevelop.</div>
<div>By Andrew Coles.</div>


<p style="color: grey;"><i>Updated Feb. 14, 2016, 5:55 p.m.</i></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Submitted with commit 45a9d54799192a693e071326a8766450f5765e82 by Milian Wolff on behalf of Andrew Coles to branch 5.0.</pre>
  </td>
 </tr>
</table>





<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="http://bugs.kde.org/show_bug.cgi?id=358454">358454</a>


</div>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kdevelop
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">In projectmanagers/cmake/cmakeimportjsonjob.cpp, there's a regular expression that matches 'add_test' lines from CTestTestfile.cmake files, but it stops reading at the first ) character:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">const QRegularExpression rx("add_test *\\((.+?) (.*?)\\)");</code></p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">If the argument list for the add_test line contains brackets, for instance:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">add_test(some-test "/some/path" "(foo)" "bar")</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">...then this causes a segfault a few lines further down - the second rx capture is not a well-formed argument list.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This patch changes the regexp to only stop when ) is at the end of the line:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">const QRegularExpression rx("add_test *\\((.+?) (.*?)\\) *$");</code></p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">It also allows for spaces between the ')' and the end of the line, to be consistent with allowing extra spacing earlier on after add_test.  I'm not sure if this matters in practice but is harmless enough.</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">It can now import CTestTestfile.cmake files from my projects without crashing.  I haven't tested it with other people's cmake build trees.</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>projectmanagers/cmake/CMakeLists.txt <span style="color: grey">(0627fde)</span></li>

 <li>projectmanagers/cmake/cmakeimportjsonjob.cpp <span style="color: grey">(0502be7)</span></li>

 <li>projectmanagers/cmake/tests/CMakeLists.txt <span style="color: grey">(451f22d)</span></li>

 <li>projectmanagers/cmake/tests/manual/parentheses_in_test_arguments/CMakeLists.txt <span style="color: grey">(PRE-CREATION)</span></li>

 <li>projectmanagers/cmake/tests/manual/parentheses_in_test_arguments/main.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>projectmanagers/cmake/tests/manual/parentheses_in_test_arguments/parentheses_in_test_arguments.kdev4 <span style="color: grey">(PRE-CREATION)</span></li>

 <li>projectmanagers/cmake/tests/test_cmakemanager.h <span style="color: grey">(95f3c9c)</span></li>

 <li>projectmanagers/cmake/tests/test_cmakemanager.cpp <span style="color: grey">(61fd314)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/126931/diff/" style="margin-left: 3em;">View Diff</a></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">File Attachments </h1>


 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2016/02/01/e3bfaea9-27e8-4d39-881b-aaf493981d30__CTestTestfile.cmake">This will cause a seg fault in importTestSuites</a></li>

</ul>




  </td>
 </tr>
</table>



  </div>
 </body>
</html>