FFMS / ffms2

An FFmpeg based source library and Avisynth/VapourSynth plugin for easy frame accurate access
Other
582 stars 105 forks source link

[RFC][WIP] Add Unit Testing #331

Closed dwbuiten closed 5 years ago

dwbuiten commented 6 years ago

See the commit message below.

This is a rough draft of a test framework for FFMS2, based on googletest, based on an old initial patch by @lotharkript.

Some things to note:

Please comment on anything and everything. This is rough.

Commit Message:

This adds support within the build system for googletest, as well
as an inital test. googletest is added as submodule. Tested to work
both in-tree and out-of-tree.

Run with:

    $ .../configure
    $ make test-sync # if needed
    $ make test

Commands may also have the following make variables set via command line:

    * SAMPLES_URL
    * SAMPLES_DIR

Example:
    $ make test-sync SAMPLES_DIR=/home/user/sampels SAMPLES_URL=https://localsamples.com/samples

Syncing currently relies on wget.

This does not currently include MSVC project integration.

A simple tool is included for generating the test data. It can be run
as, for example:

    $ cd $SAMPLES_DIR
    $ .../gendata sample.mp4 samplemp4data 0 > .../data/sample.mp4.cpp

This tool is not comprehensive, and is just a starting point. Sample data
may need to be manually generated for some problem samples.

CC: @lotharkript @isasi @tgoyne @myrsloik

dwbuiten commented 5 years ago

Ping.

myrsloik commented 5 years ago

I skimmed through and it looks reasonable

dwbuiten commented 5 years ago

Updated with parameterized tests, as per @lotharkript, along with version info in the test data, to help bisect FFmpeg if it happens to break (as it does).

Lots of other little bits fixed as per IRC convos.