Page MenuHomeFreeBSD

awk: Move to using two sets of tests
ClosedPublic

Authored by imp on Aug 1 2021, 11:54 PM.

Details

Summary

Upstream one-true-awk has two sets of tests. These are in addition to
NetBSD's tests we're using. The 'bugs-fixed' tests from upstream are
ready to use as-is (more or less). However, the 'tests' from upstream
are not, so for now we'll just use the netbsd and bugs-fixed tests.
They provide an OK workout and are better than nothing, though the tests
themselves are for specific esoteric things.

The upstream bugs-fixed tests are *ALMOST* a drop in. However, 3 test
for errors and the upstream test jig mashes stdout and stderr together,
which atf doesn't do, so make a tiny tweak to the upstream tests that I
hope to upstream. Plus upstream has ../a.out: instead of awk: in the
output. Not sure how to deal with this yet, so I've not proposed
anything upstream.

This required moving the netbsd tests to a new direcotry, so update
mtree files as well. The change is useless for 'make check' without it.

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imp requested review of this revision.Aug 1 2021, 11:54 PM
imp created this revision.
This revision was not accepted when it landed; it landed in state Needs Review.Nov 5 2021, 2:55 PM
This revision was automatically updated to reflect the committed changes.

I'm sorry for not responding sooner.. just one comment (otherwise, it looks great!).

usr.bin/awk/tests/bugs-fixed/Makefile
12

I thought the general idea was to stay away from idioms like this because FreeBSD (as a project) prefers explicit instead of implicit, and implicit (autogenerated lists) could point to issues where someone didn't check in tests, for instance.

Plus upstream has ../a.out: instead of awk: in the
output. Not sure how to deal with this yet, so I've not proposed
anything upstream.

If a.out is in the output, *_PLAIN_TESTS_SH_SED_ could be used to change the files on the fly ;).

I could see the benefits of using a.out instead of a hardcoded awk binary, but I understand the minor pain.

In D31376#742662, @ngie wrote:

Plus upstream has ../a.out: instead of awk: in the
output. Not sure how to deal with this yet, so I've not proposed
anything upstream.

If a.out is in the output, *_PLAIN_TESTS_SH_SED_ could be used to change the files on the fly ;).

I could see the benefits of using a.out instead of a hardcoded awk binary, but I understand the minor pain.

It's easier to fix this beforehand. And I'd rather wait until I can work out what upstream is doing first.

usr.bin/awk/tests/bugs-fixed/Makefile
12

I think this is a good idea...