Re: GNUism in groff tests

2020-01-16 Thread G. Branden Robinson
At 2019-12-31T09:02:52+, Ralph Corderoy wrote: > It looks like the test harness needs a common shell script that provides > convenience functions. Then the test script can read more like > > # All run under `set -eu' with a trap on EXIT. > > title 'Check -Tlatin1's \(oq' > > in=

Re: GNUism in groff tests

2020-01-16 Thread G. Branden Robinson
At 2019-12-31T13:11:49+0100, Ingo Schwarze wrote: > I won't touch this here document until it's clear whether there > is an ksh(1) bug. Working on shell bugs tends to be very time > comsuming, so there may be a substantial delay, which shouldn't > be a problem because this doesn't harm groff's use

Re: GNUism in groff tests

2020-01-16 Thread G. Branden Robinson
At 2019-12-31T13:59:26+0100, Ingo Schwarze wrote: > You are right, i didn't realize "X$" is an old idiom from per-POSIX > times and not needed with POSIX shells. No worries. I hope I didn't come across too harshly; the construction makes my eyes bleed. :-O > I did not commit these yet such that

Re: GNUism in groff tests, was: pic anomalies

2020-01-16 Thread G. Branden Robinson
At 2020-01-03T14:09:46+0100, Ingo Schwarze wrote: [what senior engineers should and should not be doing] > This seems excessively strict to me. Yes, in retrospect I was trying on a somewhat exaggerated position for size. > Yes, i know rms@ is no longer writing much new code nowadays. Not the exa

Re: Testing groff. Was: GNUism in groff tests

2020-01-16 Thread Bertrand Garrigues via
Hi Ralph, On Sun, Jan 05 2020 at 06:20:10 PM, Ralph Corderoy wrote: >> Werner wrote: >> > I think the proper way for testing groff would be to make it run >> > with a fuzzer, >> >> Yes, that would no doubt be useful. > ... >> is kind of orthogonal to developing a test suite, though. > ... >> A t

Re: Testing groff. Was: GNUism in groff tests

2020-01-05 Thread John Gardner
> and they don't have to be unit tests. In some ways, that's the worst > option because they tend to be trivial functions being tested Nobody's saying they should *all* be unit-tests. It's better to test components in isolation first, verify they do what they're supposed to, then follow up with m

Re: Testing groff. Was: GNUism in groff tests

2020-01-05 Thread Ralph Corderoy
Hi Ingo, > Werner wrote: > > I think the proper way for testing groff would be to make it run > > with a fuzzer, > > Yes, that would no doubt be useful. ... > is kind of orthogonal to developing a test suite, though. ... > A test suite, on the other hand, is most useful for making sure no > regres

Re: GNUism in groff tests, was: pic anomalies

2020-01-04 Thread Tadziu Hoffmann
> A debugging build I made in December is about 20k lines > before the preprocessor runs and about 30k afterwards. > The formal verification code, written in Isabelle/HOL[2], > is about an order of magnitude greater than that. Just out of curiosity (since I'm unfamiliar with the concepts), w

Re: GNUism in groff tests, was: pic anomalies

2020-01-03 Thread G. Branden Robinson
At 2019-12-31T08:37:00+, Ralph Corderoy wrote: > Hi Branden, > > > And who knows--maybe a gditroff page counting utility is something we > > should write and add to the distribution. > > $ printf '%s\n.bp\n' `seq 42` | groff -Z | grep -c ^p > 43 X-D Thanks! It's tempting to rewrite

Re: GNUism in groff tests, was: pic anomalies

2020-01-03 Thread G. Branden Robinson
At 2020-01-03T13:21:47-0500, Mike Bianchi wrote: > On Fri, Jan 03, 2020 at 12:45:22PM -0500, Doug McIlroy wrote: > > > C is one of the worst possible foundation languages conceivable for > > > automated formal verification > > > > Yet the Mars rovers run on a wholly checked code base written > >

Re: GNUism in groff tests, was: pic anomalies

2020-01-03 Thread Damian McGuckin
On Fri, 3 Jan 2020, Larry McVoy wrote: yep, agreed. I'd throw in some stuff I did in http://little-lang.org which was really sort of a prototype for what I wanted C to evolve to. I was always sad that the development of C that became Alef never got off the ground. Regards - Damian Pacific

Re: GNUism in groff tests, was: pic anomalies

2020-01-03 Thread G. Branden Robinson
At 2020-01-03T12:45:22-0500, Doug McIlroy wrote: > > C is one of the worst possible foundation languages conceivable for > > automated formal verification > > Yet the Mars rovers run on a wholly checked code base written > in C, subject to certain mechanically enforced restrictions on > coding st

Re: GNUism in groff tests, was: pic anomalies

2020-01-03 Thread Larry McVoy
On Fri, Jan 03, 2020 at 01:21:47PM -0500, Mike Bianchi wrote: > On Fri, Jan 03, 2020 at 12:45:22PM -0500, Doug McIlroy wrote: > > > C is one of the worst possible foundation languages conceivable for > > > automated formal verification > > > > Yet the Mars rovers run on a wholly checked code base

Re: GNUism in groff tests, was: pic anomalies

2020-01-03 Thread Mike Bianchi
On Fri, Jan 03, 2020 at 12:45:22PM -0500, Doug McIlroy wrote: > > C is one of the worst possible foundation languages conceivable for > > automated formal verification > > Yet the Mars rovers run on a wholly checked code base written > in C, ... I sometimes think that C would be greatly improved

Re: GNUism in groff tests, was: pic anomalies

2020-01-03 Thread Doug McIlroy
> C is one of the worst possible foundation languages conceivable for > automated formal verification Yet the Mars rovers run on a wholly checked code base written in C, subject to certain mechanically enforced restrictions on coding style. I'm not aware of comparably challenging systems having b

Re: GNUism in groff tests, was: pic anomalies

2020-01-03 Thread Nate Bargmann
Echoing these thoughts was this thread on the Ag Talk (agricultural focused set of forums) forum yesterday regarding an update to the Weather Underground app: https://talk.newagtalk.com/forums/thread-view.asp?tid=897280&mid=7946171#M7946171 Perhaps companies, or rather the management of companies

Re: GNUism in groff tests, was: pic anomalies

2020-01-03 Thread Ingo Schwarze
Hi Branden, G. Branden Robinson wrote on Fri, Jan 03, 2020 at 04:35:52PM +1100: > Right. I've started to adopt the philosophy that _especially_ for > critical stuff, a senior engineer should not be writing an > implementation--he or se should be producing a spec, which junior > engineers then im

Re: GNUism in groff tests, was: pic anomalies

2020-01-02 Thread G. Branden Robinson
At 2020-01-01T23:49:38-0500, Larry Kollar wrote: > > G. Branden Robinson wrote: > > > A rock star cowboy with a smoke machine to conceal the spit and > > bailing wire in his implementation is hailed as a genius. > > > > An engineer who spends effort building a robust system is regarded > > as a

Re: GNUism in groff tests, was: pic anomalies

2020-01-01 Thread Larry Kollar
G. Branden Robinson wrote: > A rock star cowboy with a smoke machine to conceal the spit and bailing > wire in his implementation is hailed as a genius. > > An engineer who spends effort building a robust system is regarded as a > cost center. Can I steal these quotes (with attribution)? The

Re: GNUism in groff tests, was: pic anomalies

2019-12-31 Thread Ingo Schwarze
Hi Werner, Werner LEMBERG wrote on Tue, Dec 31, 2019 at 03:34:17PM +0100: > I think the proper way for testing groff would be to make it run > with a fuzzer, Yes, that would no doubt be useful. We did that for mandoc. It found about 50 bugs in the first year and a few dozen more later on. I pre

Re: GNUism in groff tests, was: pic anomalies

2019-12-31 Thread Werner LEMBERG
> A framework helps with none of that. But a framework can easily be > so heavy that it distracts from the actual job. Certainly, we don't > need a framework without content. I think the proper way for testing groff would be to make it run with a fuzzer, using some very simple and small input

Re: GNUism in groff tests, was: pic anomalies

2019-12-31 Thread Ingo Schwarze
Hi John, John Gardner wrote on Tue, Dec 31, 2019 at 01:13:19PM +1100: > Wouldn't having a TAP harness be > preferable to hand-spun shell-scripts? Introducing a test framework is a solution in search of a problem. :-/ There are important things to do in groff. It is

Re: GNUism in groff tests, was: pic anomalies

2019-12-31 Thread Ingo Schwarze
Hi Ralph, Ralph Corderoy wrote on Tue, Dec 31, 2019 at 12:43:48PM +: >>> For some version of POSIX. :-) > ... >> But POSIX is actually unusually benign in this respect. POSIX 2008 is >> still in force and widely adopted (though of course, many commercial >> UNIXes still implement POSIX 2001

Re: GNUism in groff tests

2019-12-31 Thread Ingo Schwarze
Hi Branden, G. Branden Robinson wrote on Tue, Dec 31, 2019 at 04:25:36PM +1100: > At 2019-12-30T18:12:58+0100, Ingo Schwarze wrote: >> +test "X$actual" = "X$expected" && exit 0 > test "$actual" = "$expected" is entirely adequate, and POSIX-compliant. > Adding string literals is a bodge to work a

Re: GNUism in groff tests, was: pic anomalies

2019-12-31 Thread Ralph Corderoy
Hi Ingo, > > For some version of POSIX. :-) ... > But POSIX is actually unusually benign in this respect. POSIX 2008 is > still in force and widely adopted (though of course, many commercial > UNIXes still implement POSIX 2001, but i doubt that's relevant in the > present context). In a few yea

Re: GNUism in groff tests

2019-12-31 Thread Ingo Schwarze
Hi Branden, G. Branden Robinson wrote on Tue, Dec 31, 2019 at 04:34:56PM +1100: > I still prefer my here document because it _looks_ like an actual > groff document, and therefore more valuable for pedagogical purposes, I agree that your here document is the most readable of the three, and i als

Re: GNUism in groff tests, was: pic anomalies

2019-12-31 Thread John Gardner
> For some standards, clarifying which one you want to follow can > be a tough problem (e.g. CSS, anyone?) CSS isn't one standard, but a family of standards . Each of which has varying levels of maturity, and only those that are listed as "Recommendation"

Re: GNUism in groff tests, was: pic anomalies

2019-12-31 Thread Ingo Schwarze
Hi Ralph, Ralph Corderoy wrote on Tue, Dec 31, 2019 at 08:32:30AM +: > Branden Robinson wrote: >> I don't mind limiting ourselves to portable POSIX sh > For some version of POSIX. :-) For some standards, clarifying which one you want to follow can be a tough problem (e.g. CSS, anyone?). B

Re: GNUism in groff tests, was: pic anomalies

2019-12-31 Thread John Gardner
> I've just read the specification and I don't think it buys us much. I wasn't suggesting TAP so much as recommending Perl's prove(1) for handling unit tests. It eliminates portability headaches and issues with Bashisms , and is pretty time-tested as far as assu

Re: GNUism in groff tests

2019-12-31 Thread Ralph Corderoy
Hi Branden, > > Heirloom sh is happy with it if I replace $() with ``. > > Oy vey. That's a cure worse than the disease! I was just using that as an another data point; a Bourne shell doesn't require the single quote to be escaped. Returning to the original, http://git.savannah.gnu.org/cg

Re: GNUism in groff tests, was: pic anomalies

2019-12-31 Thread Ralph Corderoy
Hi Branden, > And who knows--maybe a gditroff page counting utility is something we > should write and add to the distribution. $ printf '%s\n.bp\n' `seq 42` | groff -Z | grep -c ^p 43 -- Cheers, Ralph.

Re: GNUism in groff tests, was: pic anomalies

2019-12-31 Thread Ralph Corderoy
Hi Branden, > I don't mind limiting ourselves to portable POSIX sh For some version of POSIX. :-) > I do regret losing the elegance of: > > diff <(expected) <(actual) Users of this syntax often ignore the exit status of the cmd in <(cmd). -- Cheers, Ralph.

Re: GNUism in groff tests, was: pic anomalies

2019-12-31 Thread Ralph Corderoy
Hi John, > Wouldn't having a TAP harness be > preferable to hand-spun shell-scripts? I've just read the specification and I don't think it buys us much. Something still needs to set up the test, run it, echo `ok' for TAP, and clean up, and something above that needs to

Re: GNUism in groff tests

2019-12-30 Thread G. Branden Robinson
At 2019-12-30T17:30:29+, Ralph Corderoy wrote: > > - 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. > > I think that's a ksh bug. https://manned.org/ksh.1 can be searched for

Re: GNUism in groff tests

2019-12-30 Thread G. Branden Robinson
At 2019-12-30T18:12:58+0100, Ingo Schwarze wrote: > - The <() syntax looks like a GNUism to me. It's an rc-ism. Or Tom Duff-ism, if you will[1]. > - Everything else doesn't appear to actually require bash(1). Probably cut-and-pastage on my part. > diff --git a/src/roff/groff/tests/on-latin1-

Re: GNUism in groff tests, was: pic anomalies

2019-12-30 Thread G. Branden Robinson
Apologies for some non-specifity regarding the existing tests in the groff tree at present; I am on vacation and can't comfortably do any real research at the moment. I'll be back in the saddle in a week or so. At 2019-12-31T13:13:19+1100, John Gardner wrote: > > As long as these tests use bash(1

Re: GNUism in groff tests, was: pic anomalies

2019-12-30 Thread G. Branden Robinson
At 2019-12-30T17:14:12+0100, Ingo Schwarze wrote: > I had a closer look and it turns out all nine failing tests start > with the line > > #!/usr/bin/env bash That's my fault. > I just temporarily installed bash(1) for testing purposes to make sure > that's currently the only problem, and it is

Re: GNUism in groff tests, was: pic anomalies

2019-12-30 Thread Larry McVoy
I can also offer up BitKeeper's test harness, it's super simple but worked really well for us. Here is an example test: echo $N Demonstrate symlink chain to bk bin .$NL if [ "$PLATFORM" = "WIN32" ] thenecho skipped exit 0 fi mkdir -p a/bin mkdir -p b/bin ln -s

Re: GNUism in groff tests, was: pic anomalies

2019-12-30 Thread John Gardner
> As long as these tests use bash(1), i'm very reluctant to do that, > even though in general, running a test suite certainly makes sense > before you commit a package update. Given the so far very small > test coverage, the tests don't help much for package testing yet. > Then again, that is like

Re: GNUism in groff tests

2019-12-30 Thread Colin Watson
On Mon, Dec 30, 2019 at 06:12:58PM +0100, Ingo Schwarze wrote: > here is a patch to make the test suite portable. > > Do you think something like this should be done? I'm generally in favour of making shell scripts be /bin/sh where feasible. Your patch looks fine to me (though I think I agree wi

Re: GNUism in groff tests

2019-12-30 Thread Ralph Corderoy
Hi Ingo, > - 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. I think that's a ksh bug. https://manned.org/ksh.1 can be searched for `<<' and the entry doesn't suggest quote needs escaping

Re: GNUism in groff tests

2019-12-30 Thread Ingo Schwarze
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 e

GNUism in groff tests, was: pic anomalies

2019-12-30 Thread Ingo Schwarze
Hi, Colin Watson wrote on Mon, Dec 30, 2019 at 01:39:08PM +: > On Mon, Dec 30, 2019 at 01:39:38PM +0100, Ingo Schwarze wrote: >> For example, right now, after "git pull" and building from source, >> nine out of the fourteen tests fail for me on OpenBSD-current, schwarze@isnote $ make check