[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Diff lib

From: Greg Stein <gstein_at_lyra.org>
Date: 2003-01-10 00:32:42 CET

On Thu, Jan 09, 2003 at 06:55:30PM +0100, Sander Striker wrote:
>...
> > (We already have two: a simple C and simple python framework. We use
> > the C framework to directly test libsvn_* APIs, and we use the python
> > framework to test the 'svn' commandline client.)
>
> For output comparison and running commands, python is very usefull.
> Consider:
>
> ./mydiff original modified >mypatch
> cp original original.patched
> cat mypatch | patch original.patched
>
> [compare original.patched to modified, they should be the same]

Here is a fun test:

  * write a simple C wrapper to produce a simple style of diff
  * write a tool that:
    - chooses two files at random [from one or more source trees would be an
      easy input set]
    - diff them using 'diff' and using the wrapper
    - compare the output; log an error if different
    - repeat

Feed it the httpd or SVN or whatever source tree for ample input, let it run
for a few hours or ten, and see what happens.

Hmm. I guess two the tools could select different add/delete sections, huh?
So now I see why Sander suggested the "patch" route. Well, the iteration
still works.

The second followup is how to get source material that is a bit closer match
to each other, so that the diff won't report "the whole file" as changed.
Then it gets a bit tougher. Maybe have the tool run 'svn log -q FILE' to get
a set of changed revs for a file, pick two, fetch them, and run the test.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jan 10 00:31:35 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.