[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/9] tests: be robust to old versions of xlstproc
From: |
Akim Demaille |
Subject: |
[PATCH 2/9] tests: be robust to old versions of xlstproc |
Date: |
Thu, 12 Aug 2021 10:18:25 +0200 |
Reported by Christopher Nielsen <mascguy@github.com>.
<https://trac.macports.org/raw-attachment/ticket/59927/bison-test-results-20210811-95b72.log.xz>
* tests/report.at (AT_CHECK_HTML): New.
Use it.
---
tests/README.md | 1 +
tests/report.at | 19 ++++++++++++++++---
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/tests/README.md b/tests/README.md
index a23f6b8b..7039d0ae 100644
--- a/tests/README.md
+++ b/tests/README.md
@@ -19,6 +19,7 @@ synonyms.
- diagnostics
- glr
- graph
+- html: html reports
- java
- lac
- %merge
diff --git a/tests/report.at b/tests/report.at
index 231c8cb9..77b8af4e 100644
--- a/tests/report.at
+++ b/tests/report.at
@@ -17,6 +17,19 @@
AT_BANNER([[Test reports.]])
+
+# AT_CHECK_HTML(FILE, EXPECTED-CONTENT)
+# -------------------------------------
+# Old versions of xsltproc emit 'content="text/html; charset=UTF-8"'
+# instead of 'content="text/html;charset=UTF-8"'.
+#
<https://trac.macports.org/raw-attachment/ticket/59927/bison-test-results-20210811-95b72.log.xz>
+m4_define([AT_CHECK_HTML],
+[AT_KEYWORDS([html])
+AT_CHECK([sed -e 's|content="text/html;
charset=UTF-8"|content="text/html;charset=UTF-8"|g' $1],
+ [],
+ [$2])])
+
+
## --------- ##
## Reports. ##
## --------- ##
@@ -1140,7 +1153,7 @@ AT_SETUP([Reports])
]])
# Check HTML output.
-AT_CHECK([[cat input.html]], [],
+AT_CHECK_HTML([input.html],
[[<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:bison="https://www.gnu.org/software/bison/">
@@ -2651,7 +2664,7 @@ AT_SETUP([Multistart reports])
AT_CHECK([[$XSLTPROC \
`]]AT_SET_ENV[[ bison --print-datadir`/xslt/xml2xhtml.xsl \
input.xml >input.html]])
- AT_CHECK([cat input.html], [],
+ AT_CHECK_HTML([input.html],
[[<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:bison="https://www.gnu.org/software/bison/">
@@ -3749,7 +3762,7 @@ AT_SETUP([Reports with conflicts])
]])
-AT_CHECK([[cat input.html]], [],
+AT_CHECK_HTML([input.html],
[[<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:bison="https://www.gnu.org/software/bison/">
--
2.32.0
- [PATCH 0/9] Various fixes for the tests, Akim Demaille, 2021/08/12
- [PATCH 1/9] c: fix _Noreturn support detection, Akim Demaille, 2021/08/12
- [PATCH 2/9] tests: be robust to old versions of xlstproc,
Akim Demaille <=
- [PATCH 3/9] tests: remove obsolete checks, Akim Demaille, 2021/08/12
- [PATCH 4/9] build: check for C++ 20 and 2b, Akim Demaille, 2021/08/12
- [PATCH 5/9] build: reject C++ compilers that don't support std::vector::data, Akim Demaille, 2021/08/12
- Re: [PATCH 5/9] build: reject C++ compilers that don't support std::vector::data, Hans Åberg, 2021/08/12
- Re: [PATCH 5/9] build: reject C++ compilers that don't support std::vector::data, Akim Demaille, 2021/08/13
- Re: [PATCH 5/9] build: reject C++ compilers that don't support std::vector::data, Hans Åberg, 2021/08/13
- Re: [PATCH 5/9] build: reject C++ compilers that don't support std::vector::data, Akim Demaille, 2021/08/17
- Re: [PATCH 5/9] build: reject C++ compilers that don't support std::vector::data, Hans Åberg, 2021/08/17
- Re: [PATCH 5/9] build: reject C++ compilers that don't support std::vector::data, Hans Åberg, 2021/08/17
- Re: [PATCH 5/9] build: reject C++ compilers that don't support std::vector::data, Akim Demaille, 2021/08/19