From 001e08e5a463a3c6d71d3b9500bf4a13cc493c97 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 16 Aug 2013 14:12:32 +0100 Subject: [PATCH] tests: add test-header-compile script https://bugzilla.gnome.org/show_bug.cgi?id=695889 --- tests/icles/test-header-compile | 88 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 tests/icles/test-header-compile diff --git a/tests/icles/test-header-compile b/tests/icles/test-header-compile new file mode 100644 index 0000000..1e1ffcc --- /dev/null +++ b/tests/icles/test-header-compile @@ -0,0 +1,88 @@ +#!/bin/bash + +#prefix=/usr/local + +fail_on_error=true +#fail_on_error=false + +output=tail +#output=cat + +set -e + +for lib in allocators app audio fft pbutils riff rtp rtsp sdp tag video ; do + #files=$(cd ${prefix}/include/gstreamer-1.0/ && find . -name '*.h') + if test $lib = "allocators"; then + files="allocators.h gstdmabuf.h" + elif test $lib = "app"; then + files="app.h gstappsrc.h gstappsink.h" + elif test $lib = "audio"; then + files="audio.h audio-format.h audio-channels.h audio-info.h \ + gstaudioringbuffer.h gstaudioclock.h gstaudiofilter.h \ + gstaudiocdsrc.h gstaudiodecoder.h gstaudioencoder.h \ + gstaudiobasesink.h gstaudiobasesrc.h gstaudiometa.h \ + gstaudiosink.h gstaudiosrc.h streamvolume.h gstaudioiec61937.h" + elif test $lib = "fft"; then + files="fft.h gstfft.h gstffts16.h gstffts32.h gstfftf32.h gstfftf64.h" + elif test $lib = "pbutils"; then + files="pbutils.h codec-utils.h descriptions.h encoding-profile.h \ + encoding-target.h install-plugins.h missing-plugins.h \ + gstdiscoverer.h" + elif test $lib = "riff"; then + files="riff.h riff-ids.h riff-media.h riff-read.h" + elif test $lib = "rtp"; then + files="rtp.h gstrtpbuffer.h gstrtcpbuffer.h gstrtppayloads.h \ + gstrtphdrext.h gstrtpbaseaudiopayload.h gstrtpbasepayload.h \ + gstrtpbasedepayload.h" + elif test $lib = "rtsp"; then + files="rtsp.h gstrtsp.h gstrtsptransport.h gstrtspurl.h \ + gstrtspmessage.h gstrtspconnection.h gstrtspdefs.h \ + gstrtspextension.h gstrtsprange.h" + elif test $lib = "sdp"; then + files="sdp.h gstsdp.h gstsdpmessage.h" + elif test $lib = "tag"; then + files="tag.h gsttagdemux.h gsttagmux.h xmpwriter.h" + elif test $lib = "video"; then + files="colorbalance.h colorbalancechannel.h navigation.h video.h \ + video-event.h video-format.h video-chroma.h video-color.h \ + video-info.h video-frame.h gstvideosink.h gstvideofilter.h \ + gstvideometa.h gstvideopool.h videoorientation.h videooverlay.h \ + gstvideodecoder.h gstvideoencoder.h gstvideoutils.h \ + video-blend.h video-overlay-composition.h" + fi + +CFLAGS=`pkg-config --cflags gstreamer-1.0 gstreamer-$lib-1.0` +CFLAGS="$CFLAGS -DGST_USE_UNSTABLE_API" + +for each in $files ; do + each="gst/$lib/$each" + echo Testing $each... + rm -f test.o + cat >test.c <<-EOF +#include +#include +#include <$each> +EOF + cc $CFLAGS -Wall -Werror -c test.c -o test.o 2>&1 | tail + $fail_on_error && test ! -f test.o && exit 1 + + echo Testing $each "(no gst)..." + rm -f test.o + cat >test.c <<-EOF +#include +#include <$each> +EOF + cc $CFLAGS -Wall -Werror -c test.c -o test.o 2>&1 | tail + $fail_on_error && test ! -f test.o && exit 1 + + echo Testing $each "(no glib)..." + rm -f test.o + cat >test.c <<-EOF +#include <$each> +EOF + cc $CFLAGS -Wall -Werror -c test.c -o test.o 2>&1 | tail + $fail_on_error && test ! -f test.o && exit 1 + +done # for each file + +done # for each lib -- 2.7.4