From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 130341 invoked by alias); 8 May 2017 16:42:40 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 130280 invoked by uid 89); 8 May 2017 16:42:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.2 required=5.0 tests=BAYES_05,DATE_IN_PAST_12_24,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=Hx-spam-relays-external:sk:mail.wi, H*r:sk:mail.wi, H*RU:sk:mail.wi, Van X-HELO: gw02.mail.saunalahti.fi Received: from gw02.mail.saunalahti.fi (HELO gw02.mail.saunalahti.fi) (195.197.172.116) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 08 May 2017 16:42:37 +0000 Received: from deimos.wickedbsd.net (a91-153-249-219.elisa-laajakaista.fi [91.153.249.219]) by gw02.mail.saunalahti.fi (Postfix) with ESMTP id 476D040145 for ; Mon, 8 May 2017 19:42:36 +0300 (EEST) Received: from phobos.TeleWell.gateway.wickedbsd.net (10.0.0.6 [10.0.0.6]) by mail.wickedbsd.net (OpenSMTPD) with ESMTPSA id d2524a6a (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Mon, 8 May 2017 19:42:35 +0300 (EEST) From: timo.myyra@wickedbsd.net (Timo =?utf-8?Q?Myyr=C3=A4?=) 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 Message-ID: <8737cfl2qj.fsf@phobos.TeleWell.gateway> MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2017-q2/txt/msg00051.txt.bz2 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 @@ Rip Van Winkle B - + \ 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 @@ -

Norwegian letters: ae:æ oe:ø aa:å

+

Norwegian letters: ae:æ oe:ø aa:å

\ No newline at end of file -- 2.12.2