| 1 |
AM_LIBTOOLFLAGS=--silent |
| 2 |
|
| 3 |
AM_CPPFLAGS=-I $(top_srcdir)/src -I $(top_srcdir)/include |
| 4 |
|
| 5 |
LIBKATE=../lib/libkate.la |
| 6 |
|
| 7 |
LIBKATE_EXEC=$(LIBTOOL) --mode=execute $(VALGRIND) |
| 8 |
LOG_COMPILER=$(LIBTOOL) --mode=execute $(VALGRIND) |
| 9 |
|
| 10 |
TESTS=bitwise check_sizes language metadata overflow text |
| 11 |
|
| 12 |
noinst_PROGRAMS=$(TESTS) gen_srt gen_lrc |
| 13 |
|
| 14 |
check_sizes_SOURCES=check_sizes.c |
| 15 |
check_sizes_LDADD=$(LIBKATE) |
| 16 |
|
| 17 |
language_SOURCES=language.c |
| 18 |
language_LDADD=$(LIBKATE) |
| 19 |
|
| 20 |
text_SOURCES=text.c |
| 21 |
text_LDADD=$(LIBKATE) |
| 22 |
|
| 23 |
overflow_SOURCES=overflow.c |
| 24 |
overflow_LDADD=$(LIBKATE) |
| 25 |
|
| 26 |
gen_srt_SOURCES=gen_srt.c |
| 27 |
|
| 28 |
gen_lrc_SOURCES=gen_lrc.c |
| 29 |
|
| 30 |
metadata_SOURCES=metadata.c |
| 31 |
metadata_LDADD=$(LIBKATE) |
| 32 |
|
| 33 |
bitwise_SOURCES=bitwise.c ../src/kate_bitwise.c |
| 34 |
|
| 35 |
STREAMS=@STREAMS@ |
| 36 |
|
| 37 |
tmp_ogg1="$(top_builddir)/kate-check-1.kate.ogg" |
| 38 |
tmp_ogg2="$(top_builddir)/kate-check-2.kate.ogg" |
| 39 |
tmp_kate1="$(top_builddir)/kate-check-1.kate" |
| 40 |
tmp_kate2="$(top_builddir)/kate-check-2.kate" |
| 41 |
tmp_srt1="$(top_builddir)/kate-check-1.srt" |
| 42 |
tmp_srt2="$(top_builddir)/kate-check-2.srt" |
| 43 |
|
| 44 |
KATEENC_OPTS=-s 0 -c test -l en -K 5 -R 15 |
| 45 |
|
| 46 |
check-local: |
| 47 |
@echo " Checking Kate namespace" |
| 48 |
@! @NM@ $(top_builddir)/lib/.libs/*.{a,so} \ |
| 49 |
| $(GREP) "^[0123456789abcdef]\+ [ABCDEFGHIJKLMOPQRSTUVWXYZ] [^\.]" \ |
| 50 |
| $(GREP) -v "^[0123456789abcdef]\+ . _" \ |
| 51 |
| $(GREP) -v "^[0123456789abcdef]\+ . kate_" |
| 52 |
@echo " Checking memory allocation routines" |
| 53 |
@! $(GREP) -EHn '[^_](malloc|realloc|free|calloc|memalign)\(' \ |
| 54 |
$(top_srcdir)/src/*.[ch] $(top_srcdir)/include/kate/*.h \ |
| 55 |
$(top_srcdir)/tools/katedesc.h \ |
| 56 |
$(top_srcdir)/tools/kateenc.c $(top_srcdir)/tools/katedec.c \ |
| 57 |
$(top_srcdir)/tools/*.[ly] \ |
| 58 |
| $(GREP) -v "^include/kate/kate.h:#define kate_" |
| 59 |
@echo " Checking forgotten debug traces" |
| 60 |
@! $(GREP) -EHn '[^sn]printf' \ |
| 61 |
$(top_srcdir)/src/*.[ch] $(top_srcdir)/include/kate/*.h \ |
| 62 |
$(top_srcdir)/tools/katedesc.h \ |
| 63 |
| $(GREP) . |
| 64 |
if HAVE_OGG |
| 65 |
@echo " Checking SRT round-trip" |
| 66 |
@for loop in - 0 1 2 3 4 5 6 7 8 9; do \ |
| 67 |
$(LIBKATE_EXEC) $(top_builddir)/tests/gen_srt $$loop > $(tmp_srt1) && \ |
| 68 |
$(LIBKATE_EXEC) $(top_builddir)/tools/kateenc -c SUB -l en -t srt -o $(tmp_ogg1) $(tmp_srt1) && \ |
| 69 |
$(LIBKATE_EXEC) $(top_builddir)/tools/katedec -t srt -o $(tmp_srt2) $(tmp_ogg1) && \ |
| 70 |
diff -u $(tmp_srt1) $(tmp_srt2); \ |
| 71 |
done && rm -f $(tmp_srt1) $(tmp_srt2) $(tmp_ogg1) |
| 72 |
@echo " Checking LRC round-trip" |
| 73 |
@for loop in - 0 1 2 3 4 5 6 7 8 9; do \ |
| 74 |
$(LIBKATE_EXEC) $(top_builddir)/tests/gen_lrc $$loop > $(tmp_srt1) && \ |
| 75 |
$(LIBKATE_EXEC) $(top_builddir)/tools/kateenc -c LRC -l en -t lrc -o $(tmp_ogg1) $(tmp_srt1) && \ |
| 76 |
$(LIBKATE_EXEC) $(top_builddir)/tools/katedec -t lrc -o $(tmp_srt2) $(tmp_ogg1) && \ |
| 77 |
diff -u $(tmp_srt1) $(tmp_srt2); \ |
| 78 |
done && rm -f $(tmp_srt1) $(tmp_srt2) $(tmp_ogg1) |
| 79 |
@for stream in $(STREAMS); do \ |
| 80 |
echo " Checking Kate stream $$stream" && \ |
| 81 |
$(LIBKATE_EXEC) $(top_builddir)/tools/kateenc $(KATEENC_OPTS) -t kate -o $(tmp_ogg1) $(top_srcdir)/examples/kate/$$stream.kate && \ |
| 82 |
$(LIBKATE_EXEC) $(top_builddir)/tools/katedec -o $(tmp_kate1) $(tmp_ogg1) && \ |
| 83 |
$(LIBKATE_EXEC) $(top_builddir)/tools/kateenc $(KATEENC_OPTS) -t kate -o $(tmp_ogg2) $(tmp_kate1) && \ |
| 84 |
$(OGG_DIFF) $(tmp_ogg1) $(tmp_ogg2) && \ |
| 85 |
$(LIBKATE_EXEC) $(top_builddir)/tools/katedec -o $(tmp_kate2) $(tmp_ogg2) && \ |
| 86 |
cmp $(tmp_kate1) $(tmp_kate2); \ |
| 87 |
done && rm -f $(tmp_ogg1) $(tmp_ogg2) $(tmp_kate1) $(tmp_kate2) |
| 88 |
endif |
| 89 |
|