<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/9370">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Kevin Harwell: Looks good to me, but someone else must approve
Benjamin Keith Ford: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Jenkins2: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">runtests.py: Make xml output more jUnit compatible<br><br>Separate "name" into "classname" and "name".<br>Use '.' for classname separator instead of '/'.<br>Prefix reserved words with '_'.<br><br>Also modified the '-t' option processing to allow test specification<br>by "classname". I.E. -t channels.pjsip.ami<br><br>Change-Id: Ia532c0fa20e9ebb62adc93081e0cb52791e80edb<br>---<br>M runtests.py<br>1 file changed, 31 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/runtests.py b/runtests.py</span><br><span>index 1351a3c..be1055f 100755</span><br><span>--- a/runtests.py</span><br><span>+++ b/runtests.py</span><br><span>@@ -676,6 +676,21 @@</span><br><span> return data.translate(None, ''.join(char_list))</span><br><span> </span><br><span> def write_results_xml(self, doc, root):</span><br><span style="color: hsl(120, 100%, 40%);">+ # Java reserved words we need to munge so Jenkins doesn't barf</span><br><span style="color: hsl(120, 100%, 40%);">+ reserved = ['abstract', 'arguments', 'as', 'assert', 'await',</span><br><span style="color: hsl(120, 100%, 40%);">+ 'boolean', 'break', 'byte', 'case', 'catch', 'char',</span><br><span style="color: hsl(120, 100%, 40%);">+ 'class', 'const', 'continue', 'debugger', 'def',</span><br><span style="color: hsl(120, 100%, 40%);">+ 'default', 'delete', 'do', 'double', 'else', 'enum',</span><br><span style="color: hsl(120, 100%, 40%);">+ 'eval', 'export', 'extends', 'false', 'final',</span><br><span style="color: hsl(120, 100%, 40%);">+ 'finally', 'float', 'for', 'function', 'goto', 'if',</span><br><span style="color: hsl(120, 100%, 40%);">+ 'implements', 'import', 'in', 'instanceof', 'int',</span><br><span style="color: hsl(120, 100%, 40%);">+ 'interface', 'let', 'long', 'native', 'new', 'null',</span><br><span style="color: hsl(120, 100%, 40%);">+ 'package', 'private', 'protected', 'public', 'return',</span><br><span style="color: hsl(120, 100%, 40%);">+ 'short', 'static', 'strictfp', 'string', 'super',</span><br><span style="color: hsl(120, 100%, 40%);">+ 'switch', 'synchronized', 'this', 'throw', 'throws',</span><br><span style="color: hsl(120, 100%, 40%);">+ 'trait', 'transient', 'true', 'try', 'typeof', 'var',</span><br><span style="color: hsl(120, 100%, 40%);">+ 'void', 'volatile', 'while', 'with', 'yield'</span><br><span style="color: hsl(120, 100%, 40%);">+ ]</span><br><span> </span><br><span> ts = doc.createElement("testsuite")</span><br><span> root.appendChild(ts)</span><br><span>@@ -694,7 +709,19 @@</span><br><span> tc = doc.createElement("testcase")</span><br><span> ts.appendChild(tc)</span><br><span> tc.setAttribute("time", "%.2f" % t.time)</span><br><span style="color: hsl(0, 100%, 40%);">- tc.setAttribute("name", t.test_name)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ name = re.sub('[^A-Za-z0-9_/]', '_', t.test_name)</span><br><span style="color: hsl(120, 100%, 40%);">+ names = name.split('/')</span><br><span style="color: hsl(120, 100%, 40%);">+ for i, n in enumerate(names):</span><br><span style="color: hsl(120, 100%, 40%);">+ if n in reserved:</span><br><span style="color: hsl(120, 100%, 40%);">+ names[i] = "_" + n</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ name_count = len(names)</span><br><span style="color: hsl(120, 100%, 40%);">+ classname = '.'.join(names[1:(name_count - 1)])</span><br><span style="color: hsl(120, 100%, 40%);">+ name = names[(name_count - 1)]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ tc.setAttribute("classname", classname)</span><br><span style="color: hsl(120, 100%, 40%);">+ tc.setAttribute("name", name)</span><br><span> </span><br><span> if t.did_run is False:</span><br><span> tskip = doc.createElement("skipped")</span><br><span>@@ -872,7 +899,9 @@</span><br><span> </span><br><span> # Ensure that there's a trailing '/' in the tests specified with -t</span><br><span> for i, test in enumerate(options.tests):</span><br><span style="color: hsl(0, 100%, 40%);">- if not test.endswith('/'):</span><br><span style="color: hsl(120, 100%, 40%);">+ if "/" not in test and "." in test:</span><br><span style="color: hsl(120, 100%, 40%);">+ options.tests[i] = "tests/" + test.replace(".", "/") + "/"</span><br><span style="color: hsl(120, 100%, 40%);">+ elif not test.endswith('/'):</span><br><span> options.tests[i] = test + '/'</span><br><span> </span><br><span> if options.valgrind:</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/9370">change 9370</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/9370"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ia532c0fa20e9ebb62adc93081e0cb52791e80edb </div>
<div style="display:none"> Gerrit-Change-Number: 9370 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>