Porting patch(1) from NetBSD to FreeBSD (was Re: FreeBSD in Google Code-In 2012? You can help too!)

Garrett Cooper yanegomi at gmail.com
Sun Oct 28 19:13:47 UTC 2012


On Sun, Oct 28, 2012 at 9:07 AM, Adrian Chadd <adrian at freebsd.org> wrote:
> On 28 October 2012 03:55, Gabor Kovesdan <gabor at kovesdan.org> wrote:
>
>> Hi Hiren,
>>
>> good to hear that someone is working on this! However, porting these
>> utilies is much tougher than it apparently seems. There are much more
>> criteria than just it compiles and works. More specifically, you should
>> make sure that:
>
> [snip]
>
> * It's totally bug compatible for now with gnu patch/diff.
> * You write a _lot_ of test cases for the test framework, so people
> can do automated regression testing on both performance and behaviour.
>
> It'd be nice to have more regression testing. :-)

If you're looking for bug compatibility with GNU patch, I would start
with the tests produced by upstream [1] as a base for determining how
compatible BSD patch really is. Similar steps could and should have
been done for BSD grep [2] (unfortunately GNU sort doesn't have any
tests, but if we develop the guts (inputs and expected output) of some
tests and commit them back to GNU, I'm sure they would appreciate it).

Thanks,
-Garrett

1. http://git.savannah.gnu.org/cgit/patch.git/tree/tests
2. http://git.savannah.gnu.org/cgit/grep.git/tree/tests


More information about the freebsd-hackers mailing list