fate.html 17 KB

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