public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: timo.myyra@wickedbsd.net (Timo Myyrä)
To: kawa@sourceware.org
Subject: [PATCH 1/2] Tweak xquery tests so that they pass on OpenBSD
Date: Mon, 08 May 2017 16:42:00 -0000	[thread overview]
Message-ID: <8737cfl2qj.fsf@phobos.TeleWell.gateway> (raw)


OpenBSD's diff doesn't have -B flag so work around it by formatting the
expected test outputs to not have newline in the end. Also tweak sed
command to delete empty lines before diffing files in format-users test.

diff --git a/gnu/xquery/testsuite/Makefile.am b/gnu/xquery/testsuite/Makefile.am
index 81873e67a..0ef9f4d93 100644
--- a/gnu/xquery/testsuite/Makefile.am
+++ b/gnu/xquery/testsuite/Makefile.am
@@ -2,6 +2,7 @@ include $(top_srcdir)/Make-rules
 
 KAWALIB = $(top_builddir)
 KAWA = ../../../bin/kawa.sh
+DIFF = diff -b
 EXTRA_CLEAN = tmp* *.log testing.zip */*.class
 mostlyclean-am: mostlyclean-generic
 	rm -rf Mod1 Mod2
@@ -34,7 +35,7 @@ XQTS_JAVA_FLAGS = -Xmx120m
 check-XQTS: RunXQTS.class
 	CLASSPATH=$(KAWALIB) \
 	  $(JAVA) $(XQTS_JAVA_FLAGS) gnu.xquery.testsuite.RunXQTS $(XQTS_DIR)
-	@if diff -b $(srcdir)/XQTS-trace.exp XQuery-trace.log; \
+	@if $(DIFF) $(srcdir)/XQTS-trace.exp XQuery-trace.log; \
 	  then echo '# XQTS trace output matches'; \
 	  else echo FAIL XQuery trace output mismatch; fi
 
@@ -47,7 +48,7 @@ check-suite:  TestSuite.class
 
 check-maketab1:  maketab1.xql
 	CLASSPATH=".$(CLASSPATH_SEPARATOR)$(KAWALIB)" $(KAWA) $< >tmp2
-	@if diff -b $(srcdir)/tab.html tmp2; then echo '# maketab1 test passes'; else echo FAIL maketab1 test; fi
+	@if $(DIFF) $(srcdir)/tab.html tmp2; then echo '# maketab1 test passes'; else echo FAIL maketab1 test; fi
 
 # FIXME - this does not do the correct thing
 check-desc:
@@ -59,29 +60,29 @@ multab.class:  multab.xql
 check-multab:  multab.class
 	CLASSPATH=".$(CLASSPATH_SEPARATOR)$(KAWALIB)" $(JAVA) multab \
 	  max=10 caption="Multiplication table " out:xml-indent=pretty >tmpmul
-	@if diff -b $(srcdir)/expectedmul.xml tmpmul; then echo '# multab test passes'; else echo FAIL multab test; fi
+	@if $(DIFF) $(srcdir)/expectedmul.xml tmpmul; then echo '# multab test passes'; else echo FAIL multab test; fi
 
 descend.class:  descend.xql
 	$(KAWA) --main --xquery -C $<
 
 check-descend:  descend.class
 	CLASSPATH=".$(CLASSPATH_SEPARATOR)$(KAWALIB)" $(JAVA) descend >tmpdesc
-	@if diff -b $(srcdir)/expdescend.xml tmpdesc; then echo '# descend test passes'; else echo FAIL descend test; fi
+	@if $(DIFF) $(srcdir)/expdescend.xml tmpdesc; then echo '# descend test passes'; else echo FAIL descend test; fi
 
 check-latin1a:
 	$(KAWA) --xquery $(srcdir)/latin1a.xql >tmplatin1a
-	@if diff -b $(srcdir)/latin1a.expected tmplatin1a; then echo '# latin1a test passes'; else echo FAIL latin1a test; fi
+	@if $(DIFF) $(srcdir)/latin1a.expected tmplatin1a; then echo '# latin1a test passes'; else echo FAIL latin1a test; fi
 
 check-xsltest1:
 	$(KAWA) --xslt -f $(srcdir)/xsltest1.xsl $(srcdir)/outline.xml >tmp-xsltest1.log
-	@if diff -b $(srcdir)/xsltest1.expected tmp-xsltest1.log; \
+	@if $(DIFF) $(srcdir)/xsltest1.expected tmp-xsltest1.log; \
 	  then echo '# xsltest1 test passes'; \
 	  else echo FAIL xsltest1 test; fi
 
 check-format-users:
 	$(KAWA) --xslt $(srcdir)/format-users.xsl $(srcdir)/users.xml \
-	  |sed 's/^ *//'>tmp-format-users.html
-	@if diff -b -B $(srcdir)/exp-format-users.html tmp-format-users.html; then echo '#  format-users test passes'; else echo FAIL format-users test; fi
+	  |sed 's/^ *//; /^\s*$$/d' >tmp-format-users.html
+	@if $(DIFF) $(srcdir)/exp-format-users.html tmp-format-users.html; then echo '#  format-users test passes'; else echo FAIL format-users test; fi
 
 ./Mod1/mod1.class: mod1.xql
 	$(CLASSPATH_ENV) $(KAWA) --module-static -d ../../.. -C $<
@@ -93,7 +94,7 @@ usemod.class: usemod.xql ./Mod1/mod1.class ./Mod2/mod2.class ./Mod2/mod2a.class
 	$(CLASSPATH_ENV) $(KAWA) --main -C $<
 check-mod: usemod.class
 	CLASSPATH=".$(CLASSPATH_SEPARATOR)$(KAWALIB)" $(JAVA) usemod >tmp-usemod
-	@if diff -b $(srcdir)/usemod.exp tmp-usemod; \
+	@if $(DIFF) $(srcdir)/usemod.exp tmp-usemod; \
 	  then echo '# usemod test passes'; \
 	  else echo FAIL usemod test; fi
 
@@ -101,7 +102,7 @@ bad-1.log: $(srcdir)/bad-1.xql
 	-CLASSPATH=$(KAWALIB) $(KAWA) -C $< 2>&1 \
 	| sed -e '1d' -e 's|^.*/bad-1.xql|bad-1.xql|' >bad-1.log
 check-bad-1: bad-1.log
-	@if diff -b $(srcdir)/expected-1.errs bad-1.log; \
+	@if $(DIFF) $(srcdir)/expected-1.errs bad-1.log; \
 	  then echo '# bad-1 test passes'; \
 	  else echo FAIL bad-1 test; fi
 
diff --git a/gnu/xquery/testsuite/exp-format-users.html b/gnu/xquery/testsuite/exp-format-users.html
index d7d511708..bc9e6f581 100644
--- a/gnu/xquery/testsuite/exp-format-users.html
+++ b/gnu/xquery/testsuite/exp-format-users.html
@@ -29,4 +29,4 @@
 <td>Rip Van Winkle</td>
 <td>B</td>
 </tr>
-</table>
+</table>
\ No newline at end of file
diff --git a/gnu/xquery/testsuite/latin1a.expected b/gnu/xquery/testsuite/latin1a.expected
index fe6fcc12e..7dd81ec47 100644
--- a/gnu/xquery/testsuite/latin1a.expected
+++ b/gnu/xquery/testsuite/latin1a.expected
@@ -1 +1 @@
-<p>Norwegian letters: ae:&#xE6; oe:&#xF8; aa:&#xE5;</p>
+<p>Norwegian letters: ae:&#xE6; oe:&#xF8; aa:&#xE5;</p>
\ No newline at end of file
-- 
2.12.2

             reply	other threads:[~2017-05-08 16:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-08 16:42 Timo Myyrä [this message]
2017-05-08 18:39 ` Per Bothner
2017-05-09  4:02   ` Timo Myyrä

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8737cfl2qj.fsf@phobos.TeleWell.gateway \
    --to=timo.myyra@wickedbsd.net \
    --cc=kawa@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).