Commit 5d48e4ea authored by Clément Bœsch's avatar Clément Bœsch

Merge commit 'a6a750c7'

* commit 'a6a750c7':
  tests: Move all test programs to a subdirectory
Merged-by: 's avatarClément Bœsch <clement@stupeflix.com>
parents 989a614b a6a750c7
......@@ -18,7 +18,6 @@
*.so.*
*.swp
*.ver
*-test
*_g
\#*
.\#*
......
......@@ -114,8 +114,8 @@ FFEXTRALIBS := $(LDLIBS:%=$(LD_LIB)) $(EXTRALIBS)
OBJS := $(sort $(OBJS:%=$(SUBDIR)%))
SLIBOBJS := $(sort $(SLIBOBJS:%=$(SUBDIR)%))
TESTOBJS := $(TESTOBJS:%=$(SUBDIR)%) $(TESTPROGS:%=$(SUBDIR)%-test.o)
TESTPROGS := $(TESTPROGS:%=$(SUBDIR)%-test$(EXESUF))
TESTOBJS := $(TESTOBJS:%=$(SUBDIR)tests/%) $(TESTPROGS:%=$(SUBDIR)tests/%.o)
TESTPROGS := $(TESTPROGS:%=$(SUBDIR)tests/%$(EXESUF))
HOSTOBJS := $(HOSTPROGS:%=$(SUBDIR)%.o)
HOSTPROGS := $(HOSTPROGS:%=$(SUBDIR)%$(HOSTEXESUF))
TOOLS += $(TOOLS-yes)
......@@ -158,8 +158,7 @@ LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
define RULES
clean::
$(RM) $(HOSTPROGS)
$(RM) $(TOOLS)
$(RM) $(HOSTPROGS) $(TESTPROGS) $(TOOLS)
endef
$(eval $(RULES))
......
......@@ -1042,7 +1042,7 @@ HOSTPROGS = aacps_tablegen \
CLEANFILES = *_tables.c *_tables.h *_tablegen$(HOSTEXESUF)
$(SUBDIR)dct-test$(EXESUF): $(SUBDIR)dctref.o $(SUBDIR)aandcttab.o
$(SUBDIR)tests/dct$(EXESUF): $(SUBDIR)dctref.o $(SUBDIR)aandcttab.o
$(SUBDIR)dv_tablegen$(HOSTEXESUF): $(SUBDIR)dvdata_host.o
TRIG_TABLES = cos cos_fixed sin
......
/avfft
/cabac
/dct
/fft
/fft-fixed
/fft-fixed32
/golomb
/iirfilter
/imgconvert
/jpeg2000dwt
/mathops
/motion
/options
/rangecoder
/snowenc
/utils
......@@ -18,7 +18,7 @@
#include "config.h"
#include "idct.h"
#include "libavcodec/arm/idct.h"
static const struct algo fdct_tab_arch[] = {
{ 0 }
......
......@@ -18,7 +18,7 @@
#include "config.h"
#include "libavutil/mem.h"
#include "avfft.h"
#include "libavcodec/avfft.h"
int main(int argc, char **argv)
{
......
......@@ -18,12 +18,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "cabac.c"
#include "libavcodec/cabac.c"
#define SIZE 10240
#include "libavutil/lfg.h"
#include "avcodec.h"
#include "libavcodec/avcodec.h"
static inline void put_cabac_bit(CABACContext *c, int b){
put_bits(&c->pb, 1, b);
......
......@@ -36,17 +36,18 @@
#include "libavutil/cpu.h"
#include "libavutil/common.h"
#include "libavutil/internal.h"
#include "libavutil/lfg.h"
#include "libavutil/time.h"
#include "dct.h"
#include "idctdsp.h"
#include "simple_idct.h"
#include "xvididct.h"
#include "aandcttab.h"
#include "faandct.h"
#include "faanidct.h"
#include "dctref.h"
#include "libavcodec/dct.h"
#include "libavcodec/idctdsp.h"
#include "libavcodec/simple_idct.h"
#include "libavcodec/xvididct.h"
#include "libavcodec/aandcttab.h"
#include "libavcodec/faandct.h"
#include "libavcodec/faanidct.h"
#include "libavcodec/dctref.h"
struct algo {
const char *name;
......@@ -94,11 +95,11 @@ static const struct algo idct_tab[] = {
};
#if ARCH_ARM
#include "arm/dct-test.c"
#include "arm/dct.c"
#elif ARCH_PPC
#include "ppc/dct-test.c"
#include "ppc/dct.c"
#elif ARCH_X86
#include "x86/dct-test.c"
#include "x86/dct.c"
#else
static const struct algo fdct_tab_arch[] = { { 0 } };
static const struct algo idct_tab_arch[] = { { 0 } };
......
......@@ -17,4 +17,4 @@
*/
#define FFT_FLOAT 0
#include "fft-test.c"
#include "fft.c"
......@@ -18,4 +18,4 @@
#define FFT_FLOAT 0
#define FFT_FIXED_32 1
#include "fft-test.c"
#include "fft.c"
......@@ -39,10 +39,10 @@
#include "libavutil/mathematics.h"
#include "libavutil/time.h"
#include "fft.h"
#include "libavcodec/fft.h"
#if FFT_FLOAT
#include "dct.h"
#include "rdft.h"
#include "libavcodec/dct.h"
#include "libavcodec/rdft.h"
#endif
/* reference fft */
......
......@@ -23,9 +23,9 @@
#include "libavutil/mem.h"
#include "get_bits.h"
#include "golomb.h"
#include "put_bits.h"
#include "libavcodec/get_bits.h"
#include "libavcodec/golomb.h"
#include "libavcodec/put_bits.h"
#define COUNT 8191
#define SIZE (COUNT * 4)
......
......@@ -22,7 +22,7 @@
#include "libavutil/libm.h"
#include "iirfilter.h"
#include "libavcodec/iirfilter.h"
#define FILT_ORDER 4
#define SIZE 1024
......
......@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "imgconvert.c"
#include "libavcodec/imgconvert.c"
#if FF_API_AVPICTURE
FF_DISABLE_DEPRECATION_WARNINGS
......
......@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "jpeg2000dwt.c"
#include "libavcodec/jpeg2000dwt.c"
#include "libavutil/lfg.h"
......
......@@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "mathops.h"
#include "libavcodec/mathops.h"
#include <stdlib.h>
......
......@@ -28,7 +28,7 @@
#include <string.h>
#include "config.h"
#include "me_cmp.h"
#include "libavcodec/me_cmp.h"
#include "libavutil/internal.h"
#include "libavutil/lfg.h"
#include "libavutil/mem.h"
......
......@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "options.c"
#include "libavcodec/options.c"
static int dummy_init(AVCodecContext *ctx)
{
......
......@@ -18,7 +18,7 @@
#include "config.h"
#include "fdct.h"
#include "libavcodec/ppc/fdct.h"
static const struct algo fdct_tab_arch[] = {
#if HAVE_ALTIVEC
......
......@@ -22,7 +22,7 @@
#include "libavutil/lfg.h"
#include "libavutil/log.h"
#include "rangecoder.h"
#include "libavcodec/rangecoder.h"
#define SIZE 10240
......
......@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "snowenc.c"
#include "libavcodec/snowenc.c"
#undef malloc
#undef free
......
......@@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "avcodec.h"
#include "libavcodec/avcodec.h"
int main(void){
AVCodec *codec = NULL;
......
......@@ -18,9 +18,9 @@
#include "config.h"
#include "fdct.h"
#include "xvididct.h"
#include "simple_idct.h"
#include "libavcodec/x86/fdct.h"
#include "libavcodec/x86/xvididct.h"
#include "libavcodec/x86/simple_idct.h"
#if (CONFIG_PRORES_DECODER || CONFIG_PRORES_LGPL_DECODER) && ARCH_X86_64 && HAVE_YASM
void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize,
......
......@@ -21,7 +21,7 @@
#include "libavutil/common.h"
#include "libavutil/lfg.h"
#include "timefilter.h"
#include "libavdevice/timefilter.h"
#define LFG_MAX ((1LL << 32) - 1)
......
/drawutils
/filtfmts
/formats
......@@ -19,7 +19,7 @@
#include <stdio.h>
#include "libavutil/pixdesc.h"
#include "drawutils.h"
#include "libavfilter/drawutils.h"
int main(void)
{
......
......@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "formats.c"
#include "libavfilter/formats.c"
#undef printf
......
......@@ -1559,23 +1559,20 @@ static int mkv_write_header(AVFormatContext *s)
if ((tag = av_dict_get(s->metadata, "title", NULL, 0)))
put_ebml_string(pb, MATROSKA_ID_TITLE, tag->value);
if (!(s->flags & AVFMT_FLAG_BITEXACT)) {
uint32_t segment_uid[4];
AVLFG lfg;
av_lfg_init(&lfg, av_get_random_seed());
for (i = 0; i < 4; i++)
segment_uid[i] = av_lfg_get(&lfg);
put_ebml_string(pb, MATROSKA_ID_MUXINGAPP, LIBAVFORMAT_IDENT);
if ((tag = av_dict_get(s->metadata, "encoding_tool", NULL, 0)))
put_ebml_string(pb, MATROSKA_ID_WRITINGAPP, tag->value);
else
put_ebml_string(pb, MATROSKA_ID_WRITINGAPP, LIBAVFORMAT_IDENT);
if (mkv->mode != MODE_WEBM) {
uint32_t segment_uid[4];
AVLFG lfg;
av_lfg_init(&lfg, av_get_random_seed());
for (i = 0; i < 4; i++)
segment_uid[i] = av_lfg_get(&lfg);
put_ebml_binary(pb, MATROSKA_ID_SEGMENTUID, segment_uid, 16);
}
put_ebml_binary(pb, MATROSKA_ID_SEGMENTUID, segment_uid, 16);
} else {
const char *ident = "Lavf";
put_ebml_string(pb, MATROSKA_ID_MUXINGAPP , ident);
......
/movenc
/noproxy
/rtmpdh
/seek
/srtp
/url
......@@ -24,7 +24,7 @@
#include "libavutil/mathematics.h"
#include "libavutil/md5.h"
#include "avformat.h"
#include "libavformat/avformat.h"
#if HAVE_UNISTD_H
#include <unistd.h>
......
......@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "network.h"
#include "libavformat/network.h"
static void test(const char *pattern, const char *host)
{
......
......@@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "rtmpdh.c"
#include "libavformat/rtmpdh.c"
#include <stdio.h>
......
......@@ -26,6 +26,7 @@
#include "libavutil/common.h"
#include "libavutil/mathematics.h"
#include "libavformat/avformat.h"
static char buffer[20];
......
......@@ -20,8 +20,8 @@
#include <stdio.h>
#include <string.h>
#include "rtpdec.h"
#include "srtp.h"
#include "libavformat/rtpdec.h"
#include "libavformat/srtp.h"
static const char *aes128_80_key = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn";
......
......@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "url.h"
#include "libavformat/url.h"
static void test(const char *base, const char *rel)
{
......
......@@ -30,7 +30,8 @@
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/samplefmt.h"
#include "avresample.h"
#include "libavresample/avresample.h"
static double dbl_rand(AVLFG *lfg)
{
......
......@@ -221,4 +221,4 @@ TOOLS = crypto_bench ffhash ffeval ffescape
tools/crypto_bench$(EXESUF): ELIBS += $(if $(VERSUS),$(subst +, -l,+$(VERSUS)),)
tools/crypto_bench$(EXESUF): CFLAGS += -DUSE_EXT_LIBS=0$(if $(VERSUS),$(subst +,+USE_,+$(VERSUS)),)
$(SUBDIR)lzo-test$(EXESUF): ELIBS = -llzo2
$(SUBDIR)tests/lzo$(EXESUF): ELIBS = -llzo2
......@@ -104,7 +104,7 @@ static const uint8_t S_boxes[8][32] = {
#else
/**
* This table contains the results of applying both the S-box and P-shuffle.
* It can be regenerated by compiling des-test.c with "-DCONFIG_SMALL -DGENTABLES".
* It can be regenerated by compiling tests/des.c with "-DCONFIG_SMALL -DGENTABLES".
*/
static const uint32_t S_boxes_P_shuffle[8][64] = {
{ 0x00808200, 0x00000000, 0x00008000, 0x00808202, 0x00808002, 0x00008202, 0x00000002, 0x00008000,
......
/adler32
/aes
/atomic
/avstring
/base64
/blowfish
/bprint
/camellia
/cast5
/color_utils
/cpu
/crc
/des
/dict
/display
/error
/eval
/fifo
/file
/float_dsp
/hash
/hmac
/lfg
/lls
/log
/lzo
/md5
/murmur3
/opt
/parseutils
/pca
/pixdesc
/pixelutils
/random_seed
/rational
/ripemd
/sha
/sha512
/softfloat
/tea
/tree
/twofish
/utf8
/xtea
......@@ -19,9 +19,9 @@
// LCOV_EXCL_START
#include <string.h>
#include "log.h"
#include "timer.h"
#include "adler32.h"
#include "libavutil/log.h"
#include "libavutil/timer.h"
#include "libavutil/adler32.h"
#define LEN 7001
......
......@@ -19,10 +19,10 @@
// LCOV_EXCL_START
#include <string.h>
#include "aes.h"
#include "lfg.h"
#include "log.h"
#include "mem.h"
#include "libavutil/aes.h"
#include "libavutil/lfg.h"
#include "libavutil/log.h"
#include "libavutil/mem.h"
int main(int argc, char **argv)
{
......
......@@ -16,8 +16,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "atomic.h"
#include "avassert.h"
#include "libavutil/atomic.h"
#include "libavutil/avassert.h"
int main(void)
{
......
......@@ -18,9 +18,9 @@
#include <stdio.h>
#include "common.h"
#include "mem.h"
#include "avstring.h"
#include "libavutil/common.h"
#include "libavutil/mem.h"
#include "libavutil/avstring.h"
int main(void)
{
......
......@@ -20,9 +20,9 @@
#include <stdint.h>
#include <stdio.h>
#include "common.h"
#include "base64.h"
#include "timer.h"
#include "libavutil/common.h"
#include "libavutil/base64.h"
#include "libavutil/timer.h"
#define MAX_DATA_SIZE 1024
#define MAX_ENCODED_SIZE 2048
......
......@@ -21,7 +21,7 @@
#include <stdlib.h>
#include <string.h>
#include "blowfish.h"
#include "libavutil/blowfish.h"
#define NUM_VARIABLE_KEY_TESTS 34
......
......@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "bprint.c"
#include "libavutil/bprint.c"
#undef printf
......
......@@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "camellia.h"
#include "log.h"
#include "libavutil/camellia.h"
#include "libavutil/log.h"
int main(int argc, char *argv[])
{
......
......@@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "cast5.h"
#include "log.h"
#include "libavutil/cast5.h"
#include "libavutil/log.h"
int main(int argc, char** argv)
{
......
......@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "color_utils.c"
#include "libavutil/color_utils.c"
int main(int argc, char *argv[])
{
......
......@@ -19,8 +19,9 @@
#include <stdio.h>
#include "config.h"
#include "cpu.h"
#include "avstring.h"
#include "libavutil/cpu.h"
#include "libavutil/avstring.h"
#if HAVE_UNISTD_H
#include <unistd.h>
......
......@@ -19,7 +19,7 @@
#include <stdint.h>
#include <stdio.h>
#include "crc.h"
#include "libavutil/crc.h"
int main(void)
{
......
......@@ -16,14 +16,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "des.c"
#include "libavutil/des.c"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "time.h"
#include "libavutil/time.h"
static uint64_t rand64(void)
{
......
......@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "dict.c"
#include "libavutil/dict.c"
static void print_dict(const AVDictionary *m)
{
......
......@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "display.c"
#include "libavutil/display.c"
static void print_matrix(int32_t matrix[9])
{
......
......@@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "error.c"
#include "libavutil/error.c"
#undef printf
......
......@@ -20,9 +20,9 @@
#include <stdio.h>
#include <string.h>
#include "libm.h"
#include "timer.h"
#include "eval.h"
#include "libavutil/libm.h"
#include "libavutil/timer.h"
#include "libavutil/eval.h"
static const double const_values[] = {
M_PI,
......
......@@ -18,7 +18,7 @@
#include <stdio.h>
#include "fifo.h"
#include "libavutil/fifo.h"
int main(void)
{
......
......@@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "file.c"
#include "libavutil/file.c"