fate.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  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 Environment
  8. </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 Environment
  17. </h1>
  18. <a name="Top"></a>
  19. <a name="SEC_Top"></a>
  20. <div class="element-contents" id="SEC_Contents">
  21. <h2 class="contents-heading">Table of Contents</h2>
  22. <div class="contents">
  23. <ul class="toc-numbered-mark">
  24. <li><a id="toc-Introduction" href="#Introduction">1 Introduction</a></li>
  25. <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>
  26. <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>
  27. <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>
  28. <li><a id="toc-FATE-makefile-targets-and-variables" href="#FATE-makefile-targets-and-variables">5 FATE makefile targets and variables</a>
  29. <ul class="toc-numbered-mark">
  30. <li><a id="toc-Makefile-targets" href="#Makefile-targets">5.1 Makefile targets</a></li>
  31. <li><a id="toc-Makefile-variables" href="#Makefile-variables">5.2 Makefile variables</a></li>
  32. <li><a id="toc-Examples" href="#Examples">5.3 Examples</a></li>
  33. </ul></li>
  34. </ul>
  35. </div>
  36. </div>
  37. <a name="Introduction"></a>
  38. <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>
  39. <p>FATE is an extended regression suite on the client-side and a means
  40. for results aggregation and presentation on the server-side.
  41. </p>
  42. <p>The first part of this document explains how you can use FATE from
  43. your FFmpeg source directory to test your ffmpeg binary. The second
  44. part describes how you can run FATE to submit the results to FFmpeg&rsquo;s
  45. FATE server.
  46. </p>
  47. <p>In any way you can have a look at the publicly viewable FATE results
  48. by visiting this website:
  49. </p>
  50. <p><a class="url" href="http://fate.ffmpeg.org/">http://fate.ffmpeg.org/</a>
  51. </p>
  52. <p>This is especially recommended for all people contributing source
  53. code to FFmpeg, as it can be seen if some test on some platform broke
  54. with their recent contribution. This usually happens on the platforms
  55. the developers could not test on.
  56. </p>
  57. <p>The second part of this document describes how you can run FATE to
  58. submit your results to FFmpeg&rsquo;s FATE server. If you want to submit your
  59. results be sure to check that your combination of CPU, OS and compiler
  60. is not already listed on the above mentioned website.
  61. </p>
  62. <p>In the third part you can find a comprehensive listing of FATE makefile
  63. targets and variables.
  64. </p>
  65. <a name="Using-FATE-from-your-FFmpeg-source-directory"></a>
  66. <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>
  67. <p>If you want to run FATE on your machine, FFmpeg needs to be configured first.
  68. You may specify the location of samples during configuration by adding the
  69. argument <code class="code">--samples=/path/to/fate-suite</code>.
  70. </p>
  71. <div class="example">
  72. <pre class="example-preformatted">./configure --enable-somelib --samples=/path/to/fate-suite
  73. </pre></div>
  74. <p>After successful configuration, you need to add and/or update the samples in place:
  75. </p>
  76. <div class="example">
  77. <pre class="example-preformatted">make fate-rsync
  78. </pre></div>
  79. <p>Now you are ready to run FATE:
  80. </p>
  81. <div class="example">
  82. <pre class="example-preformatted">make fate
  83. </pre></div>
  84. <p>See <a class="ref" href="#makefile-variables">makefile variables</a> for a list of arguments that can be added.
  85. </p>
  86. <p>If you did not set the samples path during configuration, or if you wish to
  87. override it just before starting FATE, you can do so in one of three ways.
  88. </p>
  89. <p>Either by setting a make variable:
  90. </p>
  91. <div class="example">
  92. <pre class="example-preformatted">make fate-rsync SAMPLES=/path/to/fate-suite
  93. make fate SAMPLES=/path/to/fate-suite
  94. </pre></div>
  95. <p>or by setting an environment variable for the current session:
  96. </p>
  97. <div class="example">
  98. <pre class="example-preformatted">export FATE_SAMPLES=/path/to/fate-suite
  99. make fate-rsync
  100. make fate
  101. </pre></div>
  102. <p>or in isolation for a single command by prepending it:
  103. </p>
  104. <div class="example">
  105. <pre class="example-preformatted">FATE_SAMPLES=/path/to/fate-suite make fate-rsync
  106. FATE_SAMPLES=/path/to/fate-suite make fate
  107. </pre></div>
  108. <p>This variable can also be set in your shell profile to make it permanent.
  109. </p>
  110. <div class="info">
  111. <p>Do not put a &rsquo;~&rsquo; character in the samples path to indicate a home
  112. directory. Because of shell nuances, this will cause FATE to fail.
  113. Also, on Windows the path has to be relative to the build path
  114. which in this case is the FFmpeg source directory.
  115. </p></div>
  116. <p>Beware that some assertions are disabled by default, so mind setting
  117. <samp class="option">--assert-level=&lt;level&gt;</samp> at configuration time, e.g. when seeking
  118. the highest possible test coverage:
  119. </p><div class="example">
  120. <pre class="example-preformatted">./configure --assert-level=2
  121. </pre></div>
  122. <p>Note that raising the assert level could have a performance impact.
  123. </p>
  124. <p>To get the complete list of tests, run the command:
  125. </p><div class="example">
  126. <pre class="example-preformatted">make fate-list
  127. </pre></div>
  128. <p>You can specify a subset of tests to run by specifying the
  129. corresponding elements from the list with the <code class="code">fate-</code> prefix,
  130. e.g. as in:
  131. </p><div class="example">
  132. <pre class="example-preformatted">make fate-ffprobe_compact fate-ffprobe_xml
  133. </pre></div>
  134. <p>This makes it easier to run a few tests in case of failure without
  135. running the complete test suite.
  136. </p>
  137. <p>To use a custom wrapper to run the test, pass <samp class="option">--target-exec</samp> to
  138. <code class="command">configure</code> or set the <var class="var">TARGET_EXEC</var> Make variable.
  139. </p>
  140. <a name="Submitting-the-results-to-the-FFmpeg-result-aggregation-server"></a>
  141. <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>
  142. <p>To submit your results to the server you should run fate through the
  143. shell script <samp class="file">tests/fate.sh</samp> from the FFmpeg sources. This script needs
  144. to be invoked with a configuration file as its first argument.
  145. </p>
  146. <div class="example">
  147. <pre class="example-preformatted">tests/fate.sh /path/to/fate_config
  148. </pre></div>
  149. <p>A configuration file template with comments describing the individual
  150. configuration variables can be found at <samp class="file">doc/fate_config.sh.template</samp>.
  151. </p>
  152. <p>The mentioned configuration template is also available here:
  153. </p><pre class="verbatim">slot= # some unique identifier
  154. repo=https://git.ffmpeg.org/ffmpeg.git # the source repository
  155. #branch=release/2.6 # the branch to test
  156. samples= # path to samples directory
  157. workdir= # directory in which to do all the work
  158. #fate_recv=&quot;ssh -T fate@fate.ffmpeg.org&quot; # command to submit report
  159. comment= # optional description
  160. build_only= # set to &quot;yes&quot; for a compile-only instance that skips tests
  161. skip_clean= # set to &quot;yes&quot; to preserve build/install directories
  162. ignore_tests=
  163. # the following are optional and map to configure options
  164. arch=
  165. cpu=
  166. toolchain=
  167. cross_prefix=
  168. ar=
  169. as=
  170. cc=
  171. cxx=
  172. ld=
  173. nm=
  174. target_os=
  175. sysroot=
  176. target_exec=
  177. target_path=
  178. target_samples=
  179. extra_cflags=
  180. extra_cxxflags=
  181. extra_objcflags=
  182. extra_ldflags=
  183. extra_libs=
  184. extra_conf= # extra configure options not covered above
  185. #make= # name of GNU make if not 'make'
  186. makeopts= # extra options passed to 'make'
  187. #makeopts_fate= # extra options passed to 'make' when running tests,
  188. # defaulting to makeopts above if this is not set
  189. #tar= # command to create a tar archive from its arguments on stdout,
  190. # defaults to 'tar c'
  191. #fate_targets= # targets to make when running fate; defaults to &quot;fate&quot;,
  192. # can be set to run a subset of tests, e.g. &quot;fate-checkasm&quot;.
  193. #fate_environments= # a list of names of configurations to run tests for;
  194. # each round is run with variables from ${${name}_env} set.
  195. # One example of using fate_environments:
  196. # target_exec=&quot;qemu-aarch64-static&quot;
  197. # fate_targets=&quot;fate-checkasm fate-cpu&quot;
  198. # fate_environments=&quot;sve128 sve256&quot;
  199. # sve128_env=&quot;QEMU_CPU=max,sve128=on&quot;
  200. # sve256_env=&quot;QEMU_CPU=max,sve256=on&quot;
  201. # The variables set by fate_environments can also be used explicitly
  202. # by target_exec, e.g. like this:
  203. # target_exec=&quot;qemu-aarch64-static -cpu \$(MY_CPU)&quot;
  204. # fate_targets=&quot;fate-checkasm fate-cpu&quot;
  205. # fate_environments=&quot;sve128 sve256&quot;
  206. # sve128_env=&quot;MY_CPU=max,sve128=on&quot;
  207. # sve256_env=&quot;MY_CPU=max,sve256=on&quot;
  208. </pre>
  209. <p>Create a configuration that suits your needs, based on the configuration
  210. template. The <code class="env">slot</code> configuration variable can be any string that is not
  211. yet used, but it is suggested that you name it adhering to the following
  212. pattern &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;. The
  213. configuration file itself will be sourced in a shell script, therefore all
  214. shell features may be used. This enables you to setup the environment as you
  215. need it for your build.
  216. </p>
  217. <p>For your first test runs the <code class="env">fate_recv</code> variable should be empty or
  218. commented out. This will run everything as normal except that it will omit
  219. the submission of the results to the server. The following files should be
  220. present in $workdir as specified in the configuration file:
  221. </p>
  222. <ul class="itemize mark-bullet">
  223. <li>configure.log
  224. </li><li>compile.log
  225. </li><li>test.log
  226. </li><li>report
  227. </li><li>version
  228. </li></ul>
  229. <p>When you have everything working properly you can create an SSH key pair
  230. and send the public key to the FATE server administrator who can be contacted
  231. at the email address <a class="email" href="mailto:fate-admin@ffmpeg.org">fate-admin@ffmpeg.org</a>.
  232. </p>
  233. <p>Configure your SSH client to use public key authentication with that key
  234. when connecting to the FATE server. Also do not forget to check the identity
  235. of the server and to accept its host key. This can usually be achieved by
  236. running your SSH client manually and killing it after you accepted the key.
  237. The FATE server&rsquo;s fingerprint is:
  238. </p>
  239. <dl class="table">
  240. <dt>&lsquo;<samp class="samp">RSA</samp>&rsquo;</dt>
  241. <dd><p>d3:f1:83:97:a4:75:2b:a6:fb:d6:e8:aa:81:93:97:51
  242. </p></dd>
  243. <dt>&lsquo;<samp class="samp">ECDSA</samp>&rsquo;</dt>
  244. <dd><p>76:9f:68:32:04:1e:d5:d4:ec:47:3f:dc:fc:18:17:86
  245. </p></dd>
  246. </dl>
  247. <p>If you have problems connecting to the FATE server, it may help to try out
  248. the <code class="command">ssh</code> command with one or more <samp class="option">-v</samp> options. You should
  249. get detailed output concerning your SSH configuration and the authentication
  250. process.
  251. </p>
  252. <p>The only thing left is to automate the execution of the fate.sh script and
  253. the synchronisation of the samples directory.
  254. </p>
  255. <a name="Uploading-new-samples-to-the-fate-suite"></a>
  256. <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>
  257. <p>If you need a sample uploaded send a mail to samples-request.
  258. </p>
  259. <p>This is for developers who have an account on the fate suite server.
  260. If you upload new samples, please make sure they are as small as possible,
  261. space on each client, network bandwidth and so on benefit from smaller test cases.
  262. Also keep in mind older checkouts use existing sample files, that means in
  263. practice generally do not replace, remove or overwrite files as it likely would
  264. break older checkouts or releases.
  265. Also all needed samples for a commit should be uploaded, ideally 24
  266. hours, before the push.
  267. If you need an account for frequently uploading samples or you wish to help
  268. others by doing that send a mail to ffmpeg-devel.
  269. </p>
  270. <div class="example">
  271. <pre class="example-preformatted">#First update your local samples copy:
  272. rsync -vauL --chmod=Dg+s,Duo+x,ug+rw,o+r,o-w,+X fate-suite.ffmpeg.org:/home/samples/fate-suite/ ~/fate-suite
  273. #Then do a dry run checking what would be uploaded:
  274. rsync -vanL --no-g --chmod=Dg+s,Duo+x,ug+rw,o+r,o-w,+X ~/fate-suite/ fate-suite.ffmpeg.org:/home/samples/fate-suite
  275. #Upload the files:
  276. rsync -vaL --no-g --chmod=Dg+s,Duo+x,ug+rw,o+r,o-w,+X ~/fate-suite/ fate-suite.ffmpeg.org:/home/samples/fate-suite
  277. </pre></div>
  278. <a name="FATE-makefile-targets-and-variables"></a>
  279. <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>
  280. <a name="Makefile-targets"></a>
  281. <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>
  282. <dl class="table">
  283. <dt><samp class="option">fate-rsync</samp></dt>
  284. <dd><p>Download/synchronize sample files to the configured samples directory.
  285. </p>
  286. </dd>
  287. <dt><samp class="option">fate-list</samp></dt>
  288. <dd><p>Will list all fate/regression test targets.
  289. </p>
  290. </dd>
  291. <dt><samp class="option">fate-list-failing</samp></dt>
  292. <dd><p>List the fate tests that failed the last time they were executed.
  293. </p>
  294. </dd>
  295. <dt><samp class="option">fate-clear-reports</samp></dt>
  296. <dd><p>Remove the test reports from previous test executions (getting rid of
  297. potentially stale results from fate-list-failing).
  298. </p>
  299. </dd>
  300. <dt><samp class="option">fate</samp></dt>
  301. <dd><p>Run the FATE test suite (requires the fate-suite dataset).
  302. </p></dd>
  303. </dl>
  304. <a name="Makefile-variables"></a>
  305. <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>
  306. <a class="anchor" id="makefile-variables"></a>
  307. <dl class="table">
  308. <dt><code class="env">V</code></dt>
  309. <dd><p>Verbosity level, can be set to 0, 1 or 2.
  310. </p><ul class="itemize mark-bullet">
  311. <li>0: show just the test arguments
  312. </li><li>1: show just the command used in the test
  313. </li><li>2: show everything
  314. </li></ul>
  315. </dd>
  316. <dt><code class="env">SAMPLES</code></dt>
  317. <dd><p>Specify or override the path to the FATE samples at make time, it has a
  318. meaning only while running the regression tests.
  319. </p>
  320. </dd>
  321. <dt><code class="env">THREADS</code></dt>
  322. <dd><p>Specify how many threads to use while running regression tests, it is
  323. quite useful to detect thread-related regressions.
  324. </p>
  325. <p>This variable may be set to the string &quot;random&quot;, optionally followed by a
  326. number, like &quot;random99&quot;, This will cause each test to use a random number of
  327. threads. If a number is specified, it is used as a maximum number of threads,
  328. otherwise 16 is the maximum.
  329. </p>
  330. <p>In case a test fails, the thread count used for it will be written into the
  331. errfile.
  332. </p>
  333. </dd>
  334. <dt><code class="env">THREAD_TYPE</code></dt>
  335. <dd><p>Specify which threading strategy test, either &lsquo;<samp class="samp">slice</samp>&rsquo; or &lsquo;<samp class="samp">frame</samp>&rsquo;,
  336. by default &lsquo;<samp class="samp">slice+frame</samp>&rsquo;
  337. </p>
  338. </dd>
  339. <dt><code class="env">CPUFLAGS</code></dt>
  340. <dd><p>Specify CPU flags.
  341. </p>
  342. </dd>
  343. <dt><code class="env">TARGET_EXEC</code></dt>
  344. <dd><p>Specify or override the wrapper used to run the tests.
  345. The <code class="env">TARGET_EXEC</code> option provides a way to run FATE wrapped in
  346. <code class="command">valgrind</code>, <code class="command">qemu-user</code> or <code class="command">wine</code> or on remote targets
  347. through <code class="command">ssh</code>.
  348. </p>
  349. </dd>
  350. <dt><code class="env">GEN</code></dt>
  351. <dd><p>Set to &lsquo;<samp class="samp">1</samp>&rsquo; to generate the missing or mismatched references.
  352. </p>
  353. </dd>
  354. <dt><code class="env">HWACCEL</code></dt>
  355. <dd><p>Specify which hardware acceleration to use while running regression tests,
  356. by default &lsquo;<samp class="samp">none</samp>&rsquo; is used.
  357. </p>
  358. </dd>
  359. <dt><code class="env">KEEP</code></dt>
  360. <dd><p>Set to &lsquo;<samp class="samp">1</samp>&rsquo; to keep temp files generated by fate test(s) when test is successful.
  361. Default is &lsquo;<samp class="samp">0</samp>&rsquo;, which removes these files. Files are always kept when a test
  362. fails.
  363. </p>
  364. </dd>
  365. </dl>
  366. <a name="Examples"></a>
  367. <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>
  368. <div class="example">
  369. <pre class="example-preformatted">make V=1 SAMPLES=/var/fate/samples THREADS=2 CPUFLAGS=mmx fate
  370. </pre></div>
  371. <p style="font-size: small;">
  372. This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
  373. </p>
  374. </div>
  375. </body>
  376. </html>