[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GNUism in groff tests
From: |
Ingo Schwarze |
Subject: |
Re: GNUism in groff tests |
Date: |
Mon, 30 Dec 2019 18:12:58 +0100 |
User-agent: |
Mutt/1.12.2 (2019-09-21) |
Hi,
here is a patch to make the test suite portable.
Do you think something like this should be done?
Problems fixed:
- The lone "'" inside the here document inside $() results in
./src/roff/groff/tests/on-latin1-device-oq-is-0x27.sh[36]: no closing quote
with ksh. So much quoting and escaping is hard to read either way.
- The <() syntax looks like a GNUism to me.
- Everything else doesn't appear to actually require bash(1).
Yours,
Ingo
diff --git a/src/roff/groff/tests/on-latin1-device-oq-is-0x27.sh
b/src/roff/groff/tests/on-latin1-device-oq-is-0x27.sh
index a0d81f19..20406333 100755
--- a/src/roff/groff/tests/on-latin1-device-oq-is-0x27.sh
+++ b/src/roff/groff/tests/on-latin1-device-oq-is-0x27.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
#
# Copyright (C) 2019 Free Software Foundation, Inc.
#
@@ -22,10 +22,10 @@ groff="${abs_top_builddir:-.}/test-groff"
expected="' = '"
-actual=$("$groff" -Tlatin1 <<EOF
-.pl 1v
-\[oq] = '
-EOF
-)
+actual=$(printf ".pl 1v\n\\\\[oq] = '\n" | "$groff" -Tlatin1)
-diff -u <(echo "$expected") <(echo "$actual")
+test "X$actual" = "X$expected" && exit 0
+
+echo "expected: $expected"
+echo "actual: $actual"
+exit 1
diff --git a/src/roff/groff/tests/string_case_xform_errors.sh
b/src/roff/groff/tests/string_case_xform_errors.sh
index 56f322d7..3fcae68f 100755
--- a/src/roff/groff/tests/string_case_xform_errors.sh
+++ b/src/roff/groff/tests/string_case_xform_errors.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
#
# Copyright (C) 2019 Free Software Foundation, Inc.
#
@@ -27,4 +27,8 @@ actual=$("$groff" -Tutf8 2>&1 <<EOF
EOF
)
-diff -u <(echo "$expected") <(echo "$actual")
+test "X$actual" = "X$expected" && exit 0
+
+echo "expected: $expected"
+echo "actual: $actual"
+exit 1
diff --git a/src/roff/groff/tests/string_case_xform_requests.sh
b/src/roff/groff/tests/string_case_xform_requests.sh
index a5f4c955..42367dcc 100755
--- a/src/roff/groff/tests/string_case_xform_requests.sh
+++ b/src/roff/groff/tests/string_case_xform_requests.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
#
# Copyright (C) 2019 Free Software Foundation, Inc.
#
@@ -33,4 +33,8 @@ actual=$("$groff" -Tutf8 <<EOF
EOF
)
-diff -u <(echo "$expected") <(echo "$actual")
+test "X$actual" = "X$expected" && exit 0
+
+echo "expected: $expected"
+echo "actual: $actual"
+exit 1
diff --git a/src/roff/groff/tests/string_case_xform_unicode_escape.sh
b/src/roff/groff/tests/string_case_xform_unicode_escape.sh
index 8f9e3906..3d686855 100755
--- a/src/roff/groff/tests/string_case_xform_unicode_escape.sh
+++ b/src/roff/groff/tests/string_case_xform_unicode_escape.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
#
# Copyright (C) 2019 Free Software Foundation, Inc.
#
@@ -38,4 +38,8 @@ actual=$("$groff" -Tutf8 2>&1 > /dev/null <<EOF
EOF
)
-diff -u <(echo "$expected") <(echo "$actual")
+test "X$actual" = "X$expected" && exit 0
+
+echo "expected: $expected"
+echo "actual: $actual"
+exit 1
diff --git a/tmac/tests/an-old_CS_register_off.sh
b/tmac/tests/an-old_CS_register_off.sh
index d896233d..1990c2f7 100755
--- a/tmac/tests/an-old_CS_register_off.sh
+++ b/tmac/tests/an-old_CS_register_off.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
#
# Copyright (C) 2019 Free Software Foundation, Inc.
#
diff --git a/tmac/tests/an-old_CS_register_on.sh
b/tmac/tests/an-old_CS_register_on.sh
index 5dfca32a..7ba59fe7 100755
--- a/tmac/tests/an-old_CS_register_on.sh
+++ b/tmac/tests/an-old_CS_register_on.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
#
# Copyright (C) 2019 Free Software Foundation, Inc.
#
diff --git a/tmac/tests/an-old_CS_register_unspecified.sh
b/tmac/tests/an-old_CS_register_unspecified.sh
index e53924cd..cbb26595 100755
--- a/tmac/tests/an-old_CS_register_unspecified.sh
+++ b/tmac/tests/an-old_CS_register_unspecified.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
#
# Copyright (C) 2019 Free Software Foundation, Inc.
#
diff --git a/tmac/tests/an-old_CT_register_off.sh
b/tmac/tests/an-old_CT_register_off.sh
index 38ee37f0..f4e51b8a 100755
--- a/tmac/tests/an-old_CT_register_off.sh
+++ b/tmac/tests/an-old_CT_register_off.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
#
# Copyright (C) 2019 Free Software Foundation, Inc.
#
diff --git a/tmac/tests/an-old_CT_register_on.sh
b/tmac/tests/an-old_CT_register_on.sh
index e6ca1ce2..1adde461 100755
--- a/tmac/tests/an-old_CT_register_on.sh
+++ b/tmac/tests/an-old_CT_register_on.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
#
# Copyright (C) 2019 Free Software Foundation, Inc.
#
diff --git a/tmac/tests/an-old_CT_register_unspecified.sh
b/tmac/tests/an-old_CT_register_unspecified.sh
index cf1ce121..4977faa5 100755
--- a/tmac/tests/an-old_CT_register_unspecified.sh
+++ b/tmac/tests/an-old_CT_register_unspecified.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
#
# Copyright (C) 2019 Free Software Foundation, Inc.
#
- Re: pic anomalies, (continued)
- Re: pic anomalies, Eric S. Raymond, 2019/12/27
- Re: pic anomalies, Ingo Schwarze, 2019/12/27
- Re: pic anomalies, Eric S. Raymond, 2019/12/27
- Re: pic anomalies, Ingo Schwarze, 2019/12/29
- Re: pic anomalies, Colin Watson, 2019/12/29
- Re: pic anomalies, Larry McVoy, 2019/12/29
- Re: pic anomalies, Ingo Schwarze, 2019/12/30
- Re: pic anomalies, Colin Watson, 2019/12/30
- GNUism in groff tests, was: pic anomalies, Ingo Schwarze, 2019/12/30
- Re: GNUism in groff tests,
Ingo Schwarze <=
- Re: GNUism in groff tests, Ralph Corderoy, 2019/12/30
- Re: GNUism in groff tests, G. Branden Robinson, 2019/12/31
- Re: GNUism in groff tests, Ralph Corderoy, 2019/12/31
- Re: GNUism in groff tests, Ingo Schwarze, 2019/12/31
- Re: GNUism in groff tests, Colin Watson, 2019/12/30
- Re: GNUism in groff tests, G. Branden Robinson, 2019/12/31
- Re: GNUism in groff tests, Ingo Schwarze, 2019/12/31
- Re: GNUism in groff tests, was: pic anomalies, John Gardner, 2019/12/30
- Re: GNUism in groff tests, was: pic anomalies, Larry McVoy, 2019/12/30
- Re: GNUism in groff tests, was: pic anomalies, G. Branden Robinson, 2019/12/31