doc/fate.texi
1ebbdda1
 \input texinfo @c -*- texinfo -*-
b4917514
 @documentencoding UTF-8
1ebbdda1
 
0922633f
 @settitle FFmpeg Automated Testing Environment
1ebbdda1
 @titlepage
0922633f
 @center @titlefont{FFmpeg Automated Testing Environment}
1ebbdda1
 @end titlepage
 
a4872cfe
 @node Top
1ebbdda1
 @top
 
 @contents
 
 @chapter Introduction
 
641ef7d4
 FATE is an extended regression suite on the client-side and a means
a4872cfe
 for results aggregation and presentation on the server-side.
1ebbdda1
 
641ef7d4
 The first part of this document explains how you can use FATE from
a4872cfe
 your FFmpeg source directory to test your ffmpeg binary. The second
 part describes how you can run FATE to submit the results to FFmpeg's
 FATE server.
1ebbdda1
 
641ef7d4
 In any way you can have a look at the publicly viewable FATE results
a4872cfe
 by visiting this website:
1ebbdda1
 
641ef7d4
 @url{http://fate.ffmpeg.org/}
1ebbdda1
 
641ef7d4
 This is especially recommended for all people contributing source
a4872cfe
 code to FFmpeg, as it can be seen if some test on some platform broke
36babfdc
 with their recent contribution. This usually happens on the platforms
a4872cfe
 the developers could not test on.
1ebbdda1
 
641ef7d4
 The second part of this document describes how you can run FATE to
a4872cfe
 submit your results to FFmpeg's FATE server. If you want to submit your
 results be sure to check that your combination of CPU, OS and compiler
 is not already listed on the above mentioned website.
 
641ef7d4
 In the third part you can find a comprehensive listing of FATE makefile
a4872cfe
 targets and variables.
 
 
 @chapter Using FATE from your FFmpeg source directory
 
641ef7d4
 If you want to run FATE on your machine you need to have the samples
a4872cfe
 in place. You can get the samples via the build target fate-rsync.
 Use this command from the top-level source directory:
 
 @example
 make fate-rsync SAMPLES=fate-suite/
 make fate       SAMPLES=fate-suite/
 @end example
 
641ef7d4
 The above commands set the samples location by passing a makefile
a4872cfe
 variable via command line. It is also possible to set the samples
 location at source configuration time by invoking configure with
641ef7d4
 @option{--samples=<path to the samples directory>}. Afterwards you can
 invoke the makefile targets without setting the @var{SAMPLES} makefile
a4872cfe
 variable. This is illustrated by the following commands:
1ebbdda1
 
 @example
a4872cfe
 ./configure --samples=fate-suite/
 make fate-rsync
 make fate
1ebbdda1
 @end example
 
641ef7d4
 Yet another way to tell FATE about the location of the sample
a4872cfe
 directory is by making sure the environment variable FATE_SAMPLES
 contains the path to your samples directory. This can be achieved
 by e.g. putting that variable in your shell profile or by setting
 it in your interactive session.
 
1ebbdda1
 @example
a4872cfe
 FATE_SAMPLES=fate-suite/ make fate
1ebbdda1
 @end example
 
a4872cfe
 @float NOTE
 Do not put a '~' character in the samples path to indicate a home
 directory. Because of shell nuances, this will cause FATE to fail.
 @end float
 
53ce9905
 To use a custom wrapper to run the test, pass @option{--target-exec} to
 @command{configure} or set the @var{TARGET_EXEC} Make variable.
 
a4872cfe
 
 @chapter Submitting the results to the FFmpeg result aggregation server
 
641ef7d4
 To submit your results to the server you should run fate through the
10fa37c5
 shell script @file{tests/fate.sh} from the FFmpeg sources. This script needs
a4872cfe
 to be invoked with a configuration file as its first argument.
 
 @example
 tests/fate.sh /path/to/fate_config
 @end example
 
641ef7d4
 A configuration file template with comments describing the individual
99b18b11
 configuration variables can be found at @file{doc/fate_config.sh.template}.
a4872cfe
 
 @ifhtml
641ef7d4
 The mentioned configuration template is also available here:
99b18b11
 @verbatiminclude fate_config.sh.template
a4872cfe
 @end ifhtml
 
641ef7d4
 Create a configuration that suits your needs, based on the configuration
 template. The @env{slot} configuration variable can be any string that is not
a4872cfe
 yet used, but it is suggested that you name it adhering to the following
641ef7d4
 pattern @samp{@var{arch}-@var{os}-@var{compiler}-@var{compiler version}}. The
 configuration file itself will be sourced in a shell script, therefore all
 shell features may be used. This enables you to setup the environment as you
 need it for your build.
a4872cfe
 
641ef7d4
 For your first test runs the @env{fate_recv} variable should be empty or
a4872cfe
 commented out. This will run everything as normal except that it will omit
 the submission of the results to the server. The following files should be
 present in $workdir as specified in the configuration file:
 
 @itemize
     @item configure.log
     @item compile.log
     @item test.log
     @item report
     @item version
 @end itemize
 
641ef7d4
 When you have everything working properly you can create an SSH key pair
52a3d57e
 and send the public key to the FATE server administrator who can be contacted
5fc74f02
 at the email address @email{fate-admin@@ffmpeg.org}.
a4872cfe
 
641ef7d4
 Configure your SSH client to use public key authentication with that key
a4872cfe
 when connecting to the FATE server. Also do not forget to check the identity
 of the server and to accept its host key. This can usually be achieved by
 running your SSH client manually and killing it after you accepted the key.
 The FATE server's fingerprint is:
 
641ef7d4
 @table @samp
71b7427e
 @item RSA
    d3:f1:83:97:a4:75:2b:a6:fb:d6:e8:aa:81:93:97:51
 @item ECDSA
    76:9f:68:32:04:1e:d5:d4:ec:47:3f:dc:fc:18:17:86
 @end table
1ebbdda1
 
641ef7d4
 If you have problems connecting to the FATE server, it may help to try out
c44cae7e
 the @command{ssh} command with one or more @option{-v} options. You should
 get detailed output concerning your SSH configuration and the authentication
 process.
 
641ef7d4
 The only thing left is to automate the execution of the fate.sh script and
a4872cfe
 the synchronisation of the samples directory.
 
fba00b74
 @chapter Uploading new samples to the fate suite
 
 This is for developers who have an account on the fate suite server.
 If you upload new samples, please make sure they are as small as possible,
 space on each client, network bandwidth and so on benefit from smaller test cases.
 Also keep in mind older checkouts use existing sample files, that means in
 practice generally do not replace, remove or overwrite files as it likely would
 break older checkouts or releases.
793a3e7b
 Also all needed samples for a commit should be uploaded, ideally 24
 hours, before the push.
fba00b74
 
 @example
 #First update your local samples copy:
 rsync -vauL --chmod=Dg+s,Duo+x,ug+rw,o+r,o-w,+X fate-suite.ffmpeg.org:/home/samples/fate-suite/ ~/fate-suite
 
 #Then do a dry run checking what would be uploaded:
 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
 
 #Upload the files:
 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
 @end example
 
a4872cfe
 
 @chapter FATE makefile targets and variables
 
 @section Makefile targets
1ebbdda1
 
 @table @option
 @item fate-rsync
f0308af5
 Download/synchronize sample files to the configured samples directory.
a4872cfe
 
 @item fate-list
f0308af5
 Will list all fate/regression test targets.
a4872cfe
 
1ebbdda1
 @item fate
 Run the FATE test suite (requires the fate-suite dataset).
 @end table
 
a4872cfe
 @section Makefile variables
 
641ef7d4
 @table @env
1ebbdda1
 @item V
 Verbosity level, can be set to 0, 1 or 2.
a4872cfe
     @itemize
         @item 0: show just the test arguments
         @item 1: show just the command used in the test
         @item 2: show everything
     @end itemize
 
1ebbdda1
 @item SAMPLES
 Specify or override the path to the FATE samples at make time, it has a
 meaning only while running the regression tests.
a4872cfe
 
1ebbdda1
 @item THREADS
 Specify how many threads to use while running regression tests, it is
 quite useful to detect thread-related regressions.
270d7e3a
 
d2d193c9
 @item THREAD_TYPE
641ef7d4
 Specify which threading strategy test, either @samp{slice} or @samp{frame},
 by default @samp{slice+frame}
270d7e3a
 
018f39ef
 @item CPUFLAGS
f0308af5
 Specify CPU flags.
270d7e3a
 
b0970a69
 @item TARGET_EXEC
 Specify or override the wrapper used to run the tests.
641ef7d4
 The @env{TARGET_EXEC} option provides a way to run FATE wrapped in
f0308af5
 @command{valgrind}, @command{qemu-user} or @command{wine} or on remote targets
 through @command{ssh}.
270d7e3a
 
b01b60a2
 @item GEN
641ef7d4
 Set to @samp{1} to generate the missing or mismatched references.
963b3ab1
 
 @item HWACCEL
 Specify which hardware acceleration to use while running regression tests,
33dc6fcc
 by default @samp{none} is used.
963b3ab1
 
0bd48ab2
 @item KEEP
 Set to @samp{1} to keep temp files generated by fate test(s) when test is successful.
 Default is @samp{0}, which removes these files. Files are always kept when a test
 fails.
 
1ebbdda1
 @end table
 
e1613476
 @section Examples
 
1ebbdda1
 @example
6df42f98
 make V=1 SAMPLES=/var/fate/samples THREADS=2 CPUFLAGS=mmx fate
1ebbdda1
 @end example