You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

346 lines
15KB

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