summaryrefslogtreecommitdiffstats
path: root/lrm/test/testcases/xmllint.sh
diff options
context:
space:
mode:
Diffstat (limited to 'lrm/test/testcases/xmllint.sh')
-rwxr-xr-xlrm/test/testcases/xmllint.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/lrm/test/testcases/xmllint.sh b/lrm/test/testcases/xmllint.sh
new file mode 100755
index 0000000..f61288c
--- /dev/null
+++ b/lrm/test/testcases/xmllint.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+gawk -v many="$1" '
+BEGIN{XMLLINT="xmllint --noout -";}
+function chkoutput(ra) {
+ if( ra=="" ) return;
+ if( close(XMLLINT) ) # we need gawk for this
+ print "xmllint reported error in RA:",ra;
+}
+many=="many" && /^[a-zA-Z][^:]*:[a-zA-Z0-9]+$/ {
+ chkoutput(ra);
+ ra=$0;
+ next;
+}
+{ print | XMLLINT }
+END{
+ if( many!="many" )
+ chkoutput("noname");
+}
+'