groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

About testing a test.


From: Bjarni Ingi Gislason
Subject: About testing a test.
Date: Sun, 22 Nov 2020 17:26:17 +0000
User-agent: Mutt/1.5.20 (2009-12-10)

  See groff bugs #58164 and #59461 for the history of this.

  I have simplified the testing script, making it internally independent
of any locale issues.

  So, what is left, is testing by others in their real or created
environment.

  The original test is in
"src/roff/groff/tests/smoke-test_html_device.sh".

#!/bin/sh
#
groff="${abs_top_builddir:-.}/test-groff"

# Extra code for general testing

if test -x $groff;
then
  :
else
  groff=test-groff
  if command -v $groff > /dev/null
  then
    :
  else
    groff=groff
  fi
fi

echo Used groff is `which "$groff"`

# End of extra code for general testing
#set -e

unset GROFF_ENCODING

echo 'Testing -C -Thtml with'" \('a" >&2

printf "\('a" | "$groff" -C -Thtml | grep -qx '<p>&aacute;</p>' || \
  { echo Test failed >&2; exit 1; }

echo 'Testing -C -Thtml with a latin1 character "�"' >&2

printf '�' | "$groff" -C -Thtml | grep -qx '<p>&aacute;</p>' || \
  { echo Test failed >&2; exit 1; }

echo 'Testing -Thtml with UTF-8 encoding' >&2

printf '\303\241' | preconv -e utf8 | "$groff" -Thtml | \
 grep -qx '<p>&aacute;</p>' || { echo Test failed; exit 1; }

-- 
Bjarni I. Gislason



reply via email to

[Prev in Thread] Current Thread [Next in Thread]