Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
fate.html417 linesDownload Raw Back to doc
1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">2<html>3<!-- Created by , GNU Texinfo 7.1.1 -->4  <head>5    <meta charset="utf-8">6    <title>7      FFmpeg Automated Testing Environment8    </title>9    <meta name="viewport" content="width=device-width,initial-scale=1.0">10    <link rel="stylesheet" type="text/css" href="bootstrap.min.css">11    <link rel="stylesheet" type="text/css" href="style.min.css">12  </head>13  <body>14    <div class="container">15      <h1>16      FFmpeg Automated Testing Environment17      </h1>18 19 20<a name="Top"></a>21<a name="SEC_Top"></a>22 23<div class="element-contents" id="SEC_Contents">24<h2 class="contents-heading">Table of Contents</h2>25 26<div class="contents">27 28<ul class="toc-numbered-mark">29  <li><a id="toc-Introduction" href="#Introduction">1 Introduction</a></li>30  <li><a id="toc-Using-FATE-from-your-FFmpeg-source-directory" href="#Using-FATE-from-your-FFmpeg-source-directory">2 Using FATE from your FFmpeg source directory</a></li>31  <li><a id="toc-Submitting-the-results-to-the-FFmpeg-result-aggregation-server" href="#Submitting-the-results-to-the-FFmpeg-result-aggregation-server">3 Submitting the results to the FFmpeg result aggregation server</a></li>32  <li><a id="toc-Uploading-new-samples-to-the-fate-suite" href="#Uploading-new-samples-to-the-fate-suite">4 Uploading new samples to the fate suite</a></li>33  <li><a id="toc-FATE-makefile-targets-and-variables" href="#FATE-makefile-targets-and-variables">5 FATE makefile targets and variables</a>34  <ul class="toc-numbered-mark">35    <li><a id="toc-Makefile-targets" href="#Makefile-targets">5.1 Makefile targets</a></li>36    <li><a id="toc-Makefile-variables" href="#Makefile-variables">5.2 Makefile variables</a></li>37    <li><a id="toc-Examples" href="#Examples">5.3 Examples</a></li>38  </ul></li>39</ul>40</div>41</div>42 43<a name="Introduction"></a>44<h2 class="chapter">1 Introduction<span class="pull-right"><a class="anchor hidden-xs" href="#Introduction" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Introduction" aria-hidden="true">TOC</a></span></h2>45 46<p>FATE is an extended regression suite on the client-side and a means47for results aggregation and presentation on the server-side.48</p>49<p>The first part of this document explains how you can use FATE from50your FFmpeg source directory to test your ffmpeg binary. The second51part describes how you can run FATE to submit the results to FFmpeg&rsquo;s52FATE server.53</p>54<p>In any way you can have a look at the publicly viewable FATE results55by visiting this website:56</p>57<p><a class="url" href="http://fate.ffmpeg.org/">http://fate.ffmpeg.org/</a>58</p>59<p>This is especially recommended for all people contributing source60code to FFmpeg, as it can be seen if some test on some platform broke61with their recent contribution. This usually happens on the platforms62the developers could not test on.63</p>64<p>The second part of this document describes how you can run FATE to65submit your results to FFmpeg&rsquo;s FATE server. If you want to submit your66results be sure to check that your combination of CPU, OS and compiler67is not already listed on the above mentioned website.68</p>69<p>In the third part you can find a comprehensive listing of FATE makefile70targets and variables.71</p>72 73<a name="Using-FATE-from-your-FFmpeg-source-directory"></a>74<h2 class="chapter">2 Using FATE from your FFmpeg source directory<span class="pull-right"><a class="anchor hidden-xs" href="#Using-FATE-from-your-FFmpeg-source-directory" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Using-FATE-from-your-FFmpeg-source-directory" aria-hidden="true">TOC</a></span></h2>75 76<p>If you want to run FATE on your machine, FFmpeg needs to be configured first.77You may specify the location of samples during configuration by adding the78argument <code class="code">--samples=/path/to/fate-suite</code>.79</p>80<div class="example">81<pre class="example-preformatted">./configure --enable-somelib --samples=/path/to/fate-suite82</pre></div>83 84<p>After successful configuration, you need to add and/or update the samples in place:85</p>86<div class="example">87<pre class="example-preformatted">make fate-rsync88</pre></div>89 90<p>Now you are ready to run FATE:91</p>92<div class="example">93<pre class="example-preformatted">make fate94</pre></div>95 96<p>See <a class="ref" href="#makefile-variables">makefile variables</a> for a list of arguments that can be added.97</p>98<p>If you did not set the samples path during configuration, or if you wish to99override it just before starting FATE, you can do so in one of three ways.100</p>101<p>Either by setting a make variable:102</p>103<div class="example">104<pre class="example-preformatted">make fate-rsync SAMPLES=/path/to/fate-suite105make fate       SAMPLES=/path/to/fate-suite106</pre></div>107 108<p>or by setting an environment variable for the current session:109</p>110<div class="example">111<pre class="example-preformatted">export FATE_SAMPLES=/path/to/fate-suite112make fate-rsync113make fate114</pre></div>115 116<p>or in isolation for a single command by prepending it:117</p>118<div class="example">119<pre class="example-preformatted">FATE_SAMPLES=/path/to/fate-suite make fate-rsync120FATE_SAMPLES=/path/to/fate-suite make fate121</pre></div>122 123<p>This variable can also be set in your shell profile to make it permanent.124</p>125<div class="info">126<p>Do not put a &rsquo;~&rsquo; character in the samples path to indicate a home127directory. Because of shell nuances, this will cause FATE to fail.128Also, on Windows the path has to be relative to the build path129which in this case is the FFmpeg source directory.130</p></div>131<p>Beware that some assertions are disabled by default, so mind setting132<samp class="option">--assert-level=&lt;level&gt;</samp> at configuration time, e.g. when seeking133the highest possible test coverage:134</p><div class="example">135<pre class="example-preformatted">./configure --assert-level=2136</pre></div>137<p>Note that raising the assert level could have a performance impact.138</p>139<p>To get the complete list of tests, run the command:140</p><div class="example">141<pre class="example-preformatted">make fate-list142</pre></div>143 144<p>You can specify a subset of tests to run by specifying the145corresponding elements from the list with the <code class="code">fate-</code> prefix,146e.g. as in:147</p><div class="example">148<pre class="example-preformatted">make fate-ffprobe_compact fate-ffprobe_xml149</pre></div>150 151<p>This makes it easier to run a few tests in case of failure without152running the complete test suite.153</p>154<p>To use a custom wrapper to run the test, pass <samp class="option">--target-exec</samp> to155<code class="command">configure</code> or set the <var class="var">TARGET_EXEC</var> Make variable.156</p>157 158<a name="Submitting-the-results-to-the-FFmpeg-result-aggregation-server"></a>159<h2 class="chapter">3 Submitting the results to the FFmpeg result aggregation server<span class="pull-right"><a class="anchor hidden-xs" href="#Submitting-the-results-to-the-FFmpeg-result-aggregation-server" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Submitting-the-results-to-the-FFmpeg-result-aggregation-server" aria-hidden="true">TOC</a></span></h2>160 161<p>To submit your results to the server you should run fate through the162shell script <samp class="file">tests/fate.sh</samp> from the FFmpeg sources. This script needs163to be invoked with a configuration file as its first argument.164</p>165<div class="example">166<pre class="example-preformatted">tests/fate.sh /path/to/fate_config167</pre></div>168 169<p>A configuration file template with comments describing the individual170configuration variables can be found at <samp class="file">doc/fate_config.sh.template</samp>.171</p>172<p>The mentioned configuration template is also available here:173</p><pre class="verbatim">slot=                                    # some unique identifier174repo=https://git.ffmpeg.org/ffmpeg.git   # the source repository175#branch=release/2.6                       # the branch to test176samples=                                 # path to samples directory177workdir=                                 # directory in which to do all the work178#fate_recv=&quot;ssh -T fate@fate.ffmpeg.org&quot; # command to submit report179comment=                                 # optional description180build_only=     # set to &quot;yes&quot; for a compile-only instance that skips tests181skip_clean=     # set to &quot;yes&quot; to preserve build/install directories182ignore_tests=183 184# the following are optional and map to configure options185arch=186cpu=187toolchain=188cross_prefix=189ar=190as=191cc=192cxx=193ld=194nm=195target_os=196sysroot=197target_exec=198target_path=199target_samples=200extra_cflags=201extra_cxxflags=202extra_objcflags=203extra_ldflags=204extra_libs=205extra_conf=     # extra configure options not covered above206 207#make=          # name of GNU make if not 'make'208makeopts=       # extra options passed to 'make'209#makeopts_fate= # extra options passed to 'make' when running tests,210                # defaulting to makeopts above if this is not set211#tar=           # command to create a tar archive from its arguments on stdout,212                # defaults to 'tar c'213#fate_targets=  # targets to make when running fate; defaults to &quot;fate&quot;,214                # can be set to run a subset of tests, e.g. &quot;fate-checkasm&quot;.215 216#fate_environments=  # a list of names of configurations to run tests for;217                     # each round is run with variables from ${${name}_env} set.218 219# One example of using fate_environments:220 221# target_exec=&quot;qemu-aarch64-static&quot;222# fate_targets=&quot;fate-checkasm fate-cpu&quot;223# fate_environments=&quot;sve128 sve256&quot;224# sve128_env=&quot;QEMU_CPU=max,sve128=on&quot;225# sve256_env=&quot;QEMU_CPU=max,sve256=on&quot;226 227# The variables set by fate_environments can also be used explicitly228# by target_exec, e.g. like this:229 230# target_exec=&quot;qemu-aarch64-static -cpu \$(MY_CPU)&quot;231# fate_targets=&quot;fate-checkasm fate-cpu&quot;232# fate_environments=&quot;sve128 sve256&quot;233# sve128_env=&quot;MY_CPU=max,sve128=on&quot;234# sve256_env=&quot;MY_CPU=max,sve256=on&quot;235</pre>236<p>Create a configuration that suits your needs, based on the configuration237template. The <code class="env">slot</code> configuration variable can be any string that is not238yet used, but it is suggested that you name it adhering to the following239pattern &lsquo;<samp class="samp"><var class="var">arch</var>-<var class="var">os</var>-<var class="var">compiler</var>-<var class="var">compiler version</var></samp>&rsquo;. The240configuration file itself will be sourced in a shell script, therefore all241shell features may be used. This enables you to setup the environment as you242need it for your build.243</p>244<p>For your first test runs the <code class="env">fate_recv</code> variable should be empty or245commented out. This will run everything as normal except that it will omit246the submission of the results to the server. The following files should be247present in $workdir as specified in the configuration file:248</p>249<ul class="itemize mark-bullet">250<li>configure.log251    </li><li>compile.log252    </li><li>test.log253    </li><li>report254    </li><li>version255</li></ul>256 257<p>When you have everything working properly you can create an SSH key pair258and send the public key to the FATE server administrator who can be contacted259at the email address <a class="email" href="mailto:fate-admin@ffmpeg.org">fate-admin@ffmpeg.org</a>.260</p>261<p>Configure your SSH client to use public key authentication with that key262when connecting to the FATE server. Also do not forget to check the identity263of the server and to accept its host key. This can usually be achieved by264running your SSH client manually and killing it after you accepted the key.265The FATE server&rsquo;s fingerprint is:266</p>267<dl class="table">268<dt>&lsquo;<samp class="samp">RSA</samp>&rsquo;</dt>269<dd><p>d3:f1:83:97:a4:75:2b:a6:fb:d6:e8:aa:81:93:97:51270</p></dd>271<dt>&lsquo;<samp class="samp">ECDSA</samp>&rsquo;</dt>272<dd><p>76:9f:68:32:04:1e:d5:d4:ec:47:3f:dc:fc:18:17:86273</p></dd>274</dl>275 276<p>If you have problems connecting to the FATE server, it may help to try out277the <code class="command">ssh</code> command with one or more <samp class="option">-v</samp> options. You should278get detailed output concerning your SSH configuration and the authentication279process.280</p>281<p>The only thing left is to automate the execution of the fate.sh script and282the synchronisation of the samples directory.283</p>284<a name="Uploading-new-samples-to-the-fate-suite"></a>285<h2 class="chapter">4 Uploading new samples to the fate suite<span class="pull-right"><a class="anchor hidden-xs" href="#Uploading-new-samples-to-the-fate-suite" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Uploading-new-samples-to-the-fate-suite" aria-hidden="true">TOC</a></span></h2>286 287<p>If you need a sample uploaded send a mail to samples-request.288</p>289<p>This is for developers who have an account on the fate suite server.290If you upload new samples, please make sure they are as small as possible,291space on each client, network bandwidth and so on benefit from smaller test cases.292Also keep in mind older checkouts use existing sample files, that means in293practice generally do not replace, remove or overwrite files as it likely would294break older checkouts or releases.295Also all needed samples for a commit should be uploaded, ideally 24296hours, before the push.297If you need an account for frequently uploading samples or you wish to help298others by doing that send a mail to ffmpeg-devel.299</p>300<div class="example">301<pre class="example-preformatted">#First update your local samples copy:302rsync -vauL --chmod=Dg+s,Duo+x,ug+rw,o+r,o-w,+X fate-suite.ffmpeg.org:/home/samples/fate-suite/ ~/fate-suite303 304#Then do a dry run checking what would be uploaded:305rsync -vanL --no-g --chmod=Dg+s,Duo+x,ug+rw,o+r,o-w,+X ~/fate-suite/ fate-suite.ffmpeg.org:/home/samples/fate-suite306 307#Upload the files:308rsync -vaL  --no-g --chmod=Dg+s,Duo+x,ug+rw,o+r,o-w,+X ~/fate-suite/ fate-suite.ffmpeg.org:/home/samples/fate-suite309</pre></div>310 311 312<a name="FATE-makefile-targets-and-variables"></a>313<h2 class="chapter">5 FATE makefile targets and variables<span class="pull-right"><a class="anchor hidden-xs" href="#FATE-makefile-targets-and-variables" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-FATE-makefile-targets-and-variables" aria-hidden="true">TOC</a></span></h2>314 315<a name="Makefile-targets"></a>316<h3 class="section">5.1 Makefile targets<span class="pull-right"><a class="anchor hidden-xs" href="#Makefile-targets" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Makefile-targets" aria-hidden="true">TOC</a></span></h3>317 318<dl class="table">319<dt><samp class="option">fate-rsync</samp></dt>320<dd><p>Download/synchronize sample files to the configured samples directory.321</p>322</dd>323<dt><samp class="option">fate-list</samp></dt>324<dd><p>Will list all fate/regression test targets.325</p>326</dd>327<dt><samp class="option">fate-list-failing</samp></dt>328<dd><p>List the fate tests that failed the last time they were executed.329</p>330</dd>331<dt><samp class="option">fate-clear-reports</samp></dt>332<dd><p>Remove the test reports from previous test executions (getting rid of333potentially stale results from fate-list-failing).334</p>335</dd>336<dt><samp class="option">fate</samp></dt>337<dd><p>Run the FATE test suite (requires the fate-suite dataset).338</p></dd>339</dl>340 341<a name="Makefile-variables"></a>342<h3 class="section">5.2 Makefile variables<span class="pull-right"><a class="anchor hidden-xs" href="#Makefile-variables" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Makefile-variables" aria-hidden="true">TOC</a></span></h3>343<a class="anchor" id="makefile-variables"></a>344<dl class="table">345<dt><code class="env">V</code></dt>346<dd><p>Verbosity level, can be set to 0, 1 or 2.347    </p><ul class="itemize mark-bullet">348<li>0: show just the test arguments349        </li><li>1: show just the command used in the test350        </li><li>2: show everything351    </li></ul>352 353</dd>354<dt><code class="env">SAMPLES</code></dt>355<dd><p>Specify or override the path to the FATE samples at make time, it has a356meaning only while running the regression tests.357</p>358</dd>359<dt><code class="env">THREADS</code></dt>360<dd><p>Specify how many threads to use while running regression tests, it is361quite useful to detect thread-related regressions.362</p>363<p>This variable may be set to the string &quot;random&quot;, optionally followed by a364number, like &quot;random99&quot;, This will cause each test to use a random number of365threads. If a number is specified, it is used as a maximum number of threads,366otherwise 16 is the maximum.367</p>368<p>In case a test fails, the thread count used for it will be written into the369errfile.370</p>371</dd>372<dt><code class="env">THREAD_TYPE</code></dt>373<dd><p>Specify which threading strategy test, either &lsquo;<samp class="samp">slice</samp>&rsquo; or &lsquo;<samp class="samp">frame</samp>&rsquo;,374by default &lsquo;<samp class="samp">slice+frame</samp>&rsquo;375</p>376</dd>377<dt><code class="env">CPUFLAGS</code></dt>378<dd><p>Specify CPU flags.379</p>380</dd>381<dt><code class="env">TARGET_EXEC</code></dt>382<dd><p>Specify or override the wrapper used to run the tests.383The <code class="env">TARGET_EXEC</code> option provides a way to run FATE wrapped in384<code class="command">valgrind</code>, <code class="command">qemu-user</code> or <code class="command">wine</code> or on remote targets385through <code class="command">ssh</code>.386</p>387</dd>388<dt><code class="env">GEN</code></dt>389<dd><p>Set to &lsquo;<samp class="samp">1</samp>&rsquo; to generate the missing or mismatched references.390</p>391</dd>392<dt><code class="env">HWACCEL</code></dt>393<dd><p>Specify which hardware acceleration to use while running regression tests,394by default &lsquo;<samp class="samp">none</samp>&rsquo; is used.395</p>396</dd>397<dt><code class="env">KEEP</code></dt>398<dd><p>Set to &lsquo;<samp class="samp">1</samp>&rsquo; to keep temp files generated by fate test(s) when test is successful.399Default is &lsquo;<samp class="samp">0</samp>&rsquo;, which removes these files. Files are always kept when a test400fails.401</p>402</dd>403</dl>404 405<a name="Examples"></a>406<h3 class="section">5.3 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples" aria-hidden="true">TOC</a></span></h3>407 408<div class="example">409<pre class="example-preformatted">make V=1 SAMPLES=/var/fate/samples THREADS=2 CPUFLAGS=mmx fate410</pre></div>411      <p style="font-size: small;">412        This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.413      </p>414    </div>415  </body>416</html>417 
codekingpro/portable-devtools · Team Ai