Page MenuHomeFreeBSD

grep(1) testing: More sanity checks, remove atf_expect_fail as now appropriate
ClosedPublic

Authored by kevans on Apr 20 2017, 9:37 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 23 2024, 12:53 PM
Unknown Object (File)
Dec 23 2023, 9:39 AM
Unknown Object (File)
Dec 20 2023, 10:22 AM
Unknown Object (File)
Dec 11 2023, 2:40 AM
Unknown Object (File)
Nov 8 2023, 1:38 PM
Unknown Object (File)
Nov 6 2023, 4:08 AM
Unknown Object (File)
Nov 5 2023, 11:05 PM
Unknown Object (File)
Oct 5 2023, 3:05 AM
Subscribers
None

Details

Summary

The test suite currently lacks basic sanity checks to ensure that egrep,
fgrep, and grep are actually matching the right expression types, i.e. passing
the right flags to regcomp(3). Amend the test suite to make sure that not only
are the individual versions doing the right thing, but also that we don't have some
kind of frankenregex situation happening where egrep is accepting a BRE or
grep an ERE.

I've chosen to not expand the 'basic' test but to add the 'grep_sanity' checks
to their own test case since this is testing for more than just 'grep matches things',
but actual expression types.

I've also removed previously expected failures that no longer fail on -HEAD,
i.e. context and context2.

Test Plan

Run the tests that I just created with both GNU grep and BSD grep. =)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Do the new tests pass on ^/head with gnu grep?

contrib/netbsd-tests/usr.bin/grep/t_grep.sh
162 โ†—(On Diff #27592)

I'll commit the atf_expect_fail chunks separately.

In D10444#216567, @ngie wrote:

Do the new tests pass on ^/head with gnu grep?

Indeed, I'm checking all of the tests I create against bsdgrep and then gnugrep before I create their reviews. They're all good with textproc/gnugrep as well -- I tend to double-check behavior with a recent gnugrep on Debian before I even start working on a thing, unless it's something I deal with regularly and know it works with recent gnugrep.

contrib/netbsd-tests/usr.bin/grep/t_grep.sh
162 โ†—(On Diff #27592)

Excellent! FWIW- these were cleared up and passing as of r317051.

  • Add atf_expect_fail's back in, ngie@ will take care of them separately

@ngie will you take care of committing these?

This revision is now accepted and ready to land.Apr 21 2017, 3:18 PM

@ngie will you take care of committing these?

Done in rS317297 -- thanks :)!

This revision was automatically updated to reflect the committed changes.