[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Test suite failures without libtextstyle
From: |
Jose E. Marchesi |
Subject: |
Re: Test suite failures without libtextstyle |
Date: |
Tue, 05 Nov 2019 11:56:35 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Hello.
When testing in an environment where libtextstyle is not visible I see
four tests unexpectedly fail on master, in this kind of way:
FAIL: poke.pkl/printf-class-1.pk output pattern test
Output was:
10
Should match:
<span class="foo">10</span>
I think you are relying unconditionally on libtextstyle being present.
Oops true. I just pushed the patch below, that must get rid of it:
Running /home/jemarch/gnu/hacks/poke/testsuite/poke.cmd/cmd.exp ...
Running /home/jemarch/gnu/hacks/poke/testsuite/poke.map/map.exp ...
Running /home/jemarch/gnu/hacks/poke/testsuite/poke.pkl/pkl.exp ...
Running /home/jemarch/gnu/hacks/poke/testsuite/poke.std/std.exp ...
exit
=== poke Summary ===
# of expected passes 1581
# of unsupported tests 4
Thanks for reporting!
commit e64f03bd6f0e4e660e7ae9e8abc3c549a4dc01d5
Author: Jose E. Marchesi <address@hidden>
Date: Tue Nov 5 11:54:17 2019 +0100
testsuite: add support for dg-require libtextstyle
Now it is possible for tests requiring libtextstyle to declare so by
specifying:
/* { dg-require libtextstyle } */
In case the requirement is not fulfilled, then the test is marked as
UNSUPPORTED.
2019-11-05 Jose E. Marchesi <address@hidden>
* testsuite/Makefile.am (POKESTYLESDIR): Define when invoking
dejagnu.
* testsuite/lib/poke-dg.exp (dg-require): Mark the test as
unsupported if appropriate.
* testsuite/poke.pkl/printf-class-1.pk: Require libtextstyle.
* testsuite/poke.pkl/printf-class-4.pk: Likewise.
* testsuite/poke.pkl/printf-class-3.pk: Likewise.
* testsuite/poke.pkl/printf-class-2.pk: Likewise.
diff --git a/ChangeLog b/ChangeLog
index 50e3cce..642e4dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2019-11-05 Jose E. Marchesi <address@hidden>
+ * testsuite/Makefile.am (POKESTYLESDIR): Define when invoking
+ dejagnu.
+ * testsuite/lib/poke-dg.exp (dg-require): Mark the test as
+ unsupported if appropriate.
+ * testsuite/poke.pkl/printf-class-1.pk: Require libtextstyle.
+ * testsuite/poke.pkl/printf-class-4.pk: Likewise.
+ * testsuite/poke.pkl/printf-class-3.pk: Likewise.
+ * testsuite/poke.pkl/printf-class-2.pk: Likewise.
+
+2019-11-05 Jose E. Marchesi <address@hidden>
+
* HACKING (Building): it is no longer necessary to pass
--with-jitter to configure.
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index 1c1fc3c..fb50110 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -25,6 +25,7 @@ check-DEJAGNU: site.exp
runtest=$(RUNTEST); \
if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
CC_FOR_TARGET="$(CC_FOR_TARGET)" CFLAGS_FOR_TARGET="$(CFLAGS)" \
+ HAVE_LIBTEXTSTYLE="$(HAVE_LIBTEXTSTYLE)" \
POKESTYLESDIR="$(top_srcdir)/etc" \
POKEDATADIR="$(top_srcdir)/src" \
$$runtest --tool $(DEJATOOL) --srcdir $${srcdir} --objdir
$(builddir) \
diff --git a/testsuite/lib/poke-dg.exp b/testsuite/lib/poke-dg.exp
index 3d0391e..f49c87d 100644
--- a/testsuite/lib/poke-dg.exp
+++ b/testsuite/lib/poke-dg.exp
@@ -33,7 +33,7 @@ proc dg-command { args } {
global poke_commands
if { [llength $args] > 2 } {
- error "[linex $args 0]: too many arguments"
+ error "[lindex $args 0]: too many arguments"
}
# Prepare the command for shell unquoting.
@@ -46,6 +46,21 @@ proc dg-command { args } {
set poke_commands "$poke_commands -c $cmd"
}
+# Require a certain capability.
+
+set skip_test 0;
+
+proc dg-require { args } {
+
+ upvar dg-do-what do-what
+
+ if {[lindex $args 1] == "libtextstyle" \
+ && $::env(HAVE_LIBTEXTSTYLE) != "yes"} {
+ # Mark the test as unsupported
+ set do-what [list [lindex do-what 0] N P]
+ }
+}
+
# Create a temporary data file containing the data specified as an
# argument, with a random name. The incoming data is encoded in
# a Tcl list, like in:
@@ -91,9 +106,6 @@ proc dg-data { args } {
setenv LC_ALL C
setenv LANG C
-# The default do-what keyword
-set dg-do-what-default compile
-
proc poke-dg-test { prog do_what extra_tool_flags } {
global poke_commands
diff --git a/testsuite/poke.pkl/printf-class-1.pk
b/testsuite/poke.pkl/printf-class-1.pk
index 9923a59..9042a52 100644
--- a/testsuite/poke.pkl/printf-class-1.pk
+++ b/testsuite/poke.pkl/printf-class-1.pk
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "--color=html" } */
+/* { dg-require libtextstyle } */
/* { dg-command {printf "%<foo:%i32d%>", 10} } */
/* { dg-output "<span class=\"foo\">10</span>" } */
diff --git a/testsuite/poke.pkl/printf-class-2.pk
b/testsuite/poke.pkl/printf-class-2.pk
index 053c3e0..ef0c25a 100644
--- a/testsuite/poke.pkl/printf-class-2.pk
+++ b/testsuite/poke.pkl/printf-class-2.pk
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "--color=html" } */
+/* { dg-require libtextstyle } */
/* { dg-command {printf "xxx%<foo:%i32d%>yyy", 10} } */
/* { dg-output "xxx<span class=\"foo\">10</span>yyy" } */
diff --git a/testsuite/poke.pkl/printf-class-3.pk
b/testsuite/poke.pkl/printf-class-3.pk
index 322ca8d..0fc66bf 100644
--- a/testsuite/poke.pkl/printf-class-3.pk
+++ b/testsuite/poke.pkl/printf-class-3.pk
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "--color=html" } */
+/* { dg-require libtextstyle } */
/* { dg-command {printf "xxx%<foo:%i32d%>yyy%<bar:%i32d%>", 10, 20} } */
/* { dg-output "xxx<span class=\"foo\">10</span>yyy<span
class=\"bar\">20</span>" } */
diff --git a/testsuite/poke.pkl/printf-class-4.pk
b/testsuite/poke.pkl/printf-class-4.pk
index edfaf22..8380c54 100644
--- a/testsuite/poke.pkl/printf-class-4.pk
+++ b/testsuite/poke.pkl/printf-class-4.pk
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "--color=html" } */
+/* { dg-require libtextstyle } */
/* { dg-command {printf "xxx%<foo:%i32dyyy%<bar:%i32d%>%>zzz", 10, 20} } */
/* { dg-output "xxx<span class=\"foo\">10yyy<span
class=\"bar\">20</span></span>zzz" } */