<!---
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.
-->

<h1 id="test-format-support">Test Format Support</h1>

<p>test-patch has the ability to support multiple test formats. Test formats have some extra hooks to process the output of test tools and write the results to some tables. Every test format plug-in must have one line in order to be recognized:</p>

<div class="highlight"><pre class="highlight shell"><code>add_test_format &lt;pluginname&gt;
</code></pre></div>
<p>Test format plugins can provide following two methods, which will be called by test-patch if defined.</p>

<ul>
  <li>
    <p>pluginname_process_tests</p>

    <ul>
      <li>Given a path to the log file and tested module name, parse that file and store the test result into global variables and/or files.</li>
    </ul>
  </li>
  <li>
    <p>pluginname_finalize_results</p>

    <ul>
      <li>Using the results stored by pluginname_process_tests, write them to the test result table and/or the footer table for reporting.</li>
    </ul>
  </li>
</ul>

<p>For an example of how to write a test-format plugin, you can look at <a href="https://github.com/apache/yetus/blob/master/precommit/test-patch.d/junit.sh">junit plugin</a> bundled in Apache Yetus.</p>
