summaryrefslogtreecommitdiff
path: root/docs/reference/intel-gpu-tools/generate_description_xml.sh
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2017-12-05 11:16:49 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-12-05 16:19:53 +0100
commit491e8c173e288931101e21f5f6f48f098f16d876 (patch)
treee6ca29c20c7d4ca3608657028fae4afa31a7eb58 /docs/reference/intel-gpu-tools/generate_description_xml.sh
parent10e3e5d4ef04e4b6318aa05795dd5aba60ded689 (diff)
meson: gtkdoc support
Bunch of neat improvements: - xml generates correctly depend upon the test binaries - no need to re-run autogen.sh when new chapters/functions get added, all handed by meson Still one issue: - the gtkdoc target doesn't depend upon the custom_target yet, hacked around using build_by_default: true This is an issue known to upstream already: https://github.com/mesonbuild/meson/issues/2148 v2: Bump meson version to 0.42, since that's the first release which adds the build dir when running the gtkdoc tools, and hence allows including generated files. v2: - Undo the bump, it's only needed for generated source files. Other generated files as input should work with 0.40 already. - Generate version.xml from version.xml.in, which allows us to keep the &version; entity. v3: Add github issue link. v4: - Resurrect lost KEYWORDS (Petri) - Fix issue when running with a clean build, files() doesn't work on generate files (Petri). Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'docs/reference/intel-gpu-tools/generate_description_xml.sh')
-rw-r--r--docs/reference/intel-gpu-tools/generate_description_xml.sh46
1 files changed, 46 insertions, 0 deletions
diff --git a/docs/reference/intel-gpu-tools/generate_description_xml.sh b/docs/reference/intel-gpu-tools/generate_description_xml.sh
new file mode 100644
index 00000000..705a7bf3
--- /dev/null
+++ b/docs/reference/intel-gpu-tools/generate_description_xml.sh
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+output=$1
+filter=$2
+testlist=$3
+testdir=$(dirname $testlist)
+
+KEYWORDS="(invalid|hang|swap|thrash|crc|tiled|tiling|rte|ctx|render|blt|bsd|vebox|exec|rpm)"
+
+echo "<?xml version=\"1.0\"?>" > $output
+echo "<!DOCTYPE refsect1 PUBLIC \"-//OASIS//DTD DocBook XML V4.3//EN\"" >> $output
+echo " \"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd\"" >> $output
+echo "[" >> $output
+echo " <!ENTITY % local.common.attrib \"xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'\">" >> $output
+echo " <!ENTITY version SYSTEM \"version.xml\">" >> $output
+echo "]>" >> $output
+echo "<refsect1>" >> $output
+echo "<title>Description</title>" >> $output
+for test in `cat $testlist | tr ' ' '\n' | grep "^$filter" | sort`; do
+ echo "<refsect2 id=\"$test\"><title>" >> $output;
+ echo "$test" | perl -pe "s/(?<=_)$KEYWORDS(?=(_|\\W))/<acronym>\\1<\\/acronym>/g" >> $output;
+ echo "</title><para><![CDATA[" >> $output;
+ testprog=$testdir/$test;
+ ./$testprog --help-description >> $output;
+ echo "]]></para>" >> $output;
+ if ./$testprog --list-subtests > /dev/null ; then
+ echo "<refsect3><title>Subtests</title>" >> $output;
+ subtest_list=`./$testprog --list-subtests`;
+ subtest_count=`echo $subtest_list | wc -w`;
+ if [ $subtest_count -gt 100 ]; then
+ echo "<para>This test has over 100 subtests. " >> $output;
+ echo "Run <command>$test</command> <option>--list-subtests</option> to list them.</para>" >> $output;
+ else
+ echo "<simplelist>" >> $output;
+ for subtest in $subtest_list; do
+ echo "<member>" >> $output;
+ echo "$subtest" | perl -pe "s/\\b$KEYWORDS\\b/<acronym>\\1<\\/acronym>/g" >> $output;
+ echo "</member>" >> $output;
+ done;
+ echo "</simplelist>" >> $output;
+ fi;
+ echo "</refsect3>" >> $output;
+ fi;
+ echo "</refsect2>" >> $output;
+done;
+echo "</refsect1>" >> $output