From patchwork Fri Apr 16 08:58:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Rapp X-Patchwork-Id: 26949 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 4B8754499EE for ; Fri, 16 Apr 2021 11:58:48 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1B2F868A13F; Fri, 16 Apr 2021 11:58:48 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from server6.ceeqoo.com (server6.ceeqoo.com [178.77.101.243]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 25293689F20 for ; Fri, 16 Apr 2021 11:58:42 +0300 (EEST) Received: from mailix (www.noaport.de [109.90.164.154]) by server6.ceeqoo.com (Postfix) with ESMTPA id 2C118B9B61 for ; Fri, 16 Apr 2021 10:58:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=noa-archive.com; s=default; t=1618563521; bh=BMmasvtuif3wTiKFrgLSL+iNrZhSPgCNCdFNowNv1e4=; h=Received:From:To:Subject; b=QdHBxr42P+bZHUcNmxFlMhC8XWGKuzRwmC06Wrejuzuz4kNs5dbV9WFd3HM8U3Nbf vWgS63JdYhA28DKII0vCDCefJuP0f6t0TejBMuwkOJGEruVeOHydr5uCHZgHQ6lVHt 6TlblexhPkn92IXMNJcw7yVDk+agyexaTVKww/NQ= Authentication-Results: server6.ceeqoo.com; spf=pass (sender IP is 109.90.164.154) smtp.mailfrom=t.rapp@noa-archive.com smtp.helo=mailix Received-SPF: pass (server6.ceeqoo.com: connection is authenticated) Received: from frogstar-a.kuhnle.local (frogstar-a.kuhnle.local [192.168.0.26]) by mailix with ESMTPA ; Fri, 16 Apr 2021 10:58:40 +0200 From: Tobias Rapp To: ffmpeg-devel@ffmpeg.org Date: Fri, 16 Apr 2021 10:58:40 +0200 Message-Id: <1618563520-19130-1-git-send-email-t.rapp@noa-archive.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-PPP-Message-ID: <161856352162.20367.7122367065108335816@server6.ceeqoo.com> X-PPP-Vhost: noa-archive.com Subject: [FFmpeg-devel] [PATCH] fate/ffprobe: Verify ffprobe XML output against schema file X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Adds schema validation for ffprobe XML output so that updating the ffprobe.xsd file upon changes to ffprobe is not forgotten. This was suggested by Marton Balint in: http://ffmpeg.org/pipermail/ffmpeg-devel/2021-March/278428.html The schema FATE test is only run if xmllint command is available. Signed-off-by: Tobias Rapp --- configure | 3 +++ tests/fate/ffprobe.mak | 6 +++++ tests/ref/fate/ffprobe_xsd | 57 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 tests/ref/fate/ffprobe_xsd diff --git a/configure b/configure index d7a3f50..b8ad7f9 100755 --- a/configure +++ b/configure @@ -2341,6 +2341,7 @@ HAVE_LIST=" perl pod2man texi2html + xmllint " # options emitted with CONFIG_ prefix but not available on the command line @@ -6599,6 +6600,7 @@ disabled makeinfo_html && texi2html --help 2> /dev/null | grep -q 'init-file' && perl -v > /dev/null 2>&1 && enable perl || disable perl pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout +xmllint --version > /dev/null 2>&1 && enable xmllint || disable xmllint # check V4L2 codecs available in the API if enabled v4l2_m2m; then @@ -7365,6 +7367,7 @@ echo "perl enabled ${perl-no}" echo "pod2man enabled ${pod2man-no}" echo "makeinfo enabled ${makeinfo-no}" echo "makeinfo supports HTML ${makeinfo_html-no}" +echo "xmllint enabled ${xmllint-no}" test -n "$random_seed" && echo "random seed ${random_seed}" echo diff --git a/tests/fate/ffprobe.mak b/tests/fate/ffprobe.mak index c867beb..d2abe8a 100644 --- a/tests/fate/ffprobe.mak +++ b/tests/fate/ffprobe.mak @@ -29,6 +29,12 @@ FATE_FFPROBE-$(CONFIG_AVDEVICE) += fate-ffprobe_xml fate-ffprobe_xml: $(FFPROBE_TEST_FILE) fate-ffprobe_xml: CMD = run $(FFPROBE_COMMAND) -of xml +FATE_FFPROBE_SCHEMA-$(CONFIG_AVDEVICE) += fate-ffprobe_xsd +fate-ffprobe_xsd: $(FFPROBE_TEST_FILE) +fate-ffprobe_xsd: CMD = run $(FFPROBE_COMMAND) -noprivate -of xml=q=1:x=1 | \ + xmllint --schema $(SRC_PATH)/doc/ffprobe.xsd - + +FATE_FFPROBE-$(HAVE_XMLLINT) += $(FATE_FFPROBE_SCHEMA-yes) FATE_FFPROBE += $(FATE_FFPROBE-yes) fate-ffprobe: $(FATE_FFPROBE) diff --git a/tests/ref/fate/ffprobe_xsd b/tests/ref/fate/ffprobe_xsd new file mode 100644 index 0000000..cb3413e --- /dev/null +++ b/tests/ref/fate/ffprobe_xsd @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +