summaryrefslogtreecommitdiff
path: root/xdelta3/xdelta3-regtest.py
diff options
context:
space:
mode:
Diffstat (limited to 'xdelta3/xdelta3-regtest.py')
-rwxr-xr-xxdelta3/xdelta3-regtest.py40
1 files changed, 17 insertions, 23 deletions
diff --git a/xdelta3/xdelta3-regtest.py b/xdelta3/xdelta3-regtest.py
index e86c621..f9a11bd 100755
--- a/xdelta3/xdelta3-regtest.py
+++ b/xdelta3/xdelta3-regtest.py
@@ -1,6 +1,6 @@
1#!/usr/bin/python2.5 1#!/usr/bin/python2.5
2# xdelta 3 - delta compression tools and library 2# xdelta 3 - delta compression tools and library
3# Copyright (C) 2003, 2006, 2007. Joshua P. MacDonald 3# Copyright (C) 2003, 2006, 2007, 2008. Joshua P. MacDonald
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
@@ -19,7 +19,6 @@
19# TODO: test 1.5 vs. greedy 19# TODO: test 1.5 vs. greedy
20 20
21import os, sys, math, re, time, types, array, random 21import os, sys, math, re, time, types, array, random
22import xdelta3main
23import xdelta3 22import xdelta3
24 23
25#RCSDIR = '/mnt/polaroid/Polaroid/orbit_linux/home/jmacd/PRCS' 24#RCSDIR = '/mnt/polaroid/Polaroid/orbit_linux/home/jmacd/PRCS'
@@ -27,7 +26,10 @@ import xdelta3
27#SAMPLEDIR = "/tmp/WESNOTH_tmp/diff" 26#SAMPLEDIR = "/tmp/WESNOTH_tmp/diff"
28 27
29#RCSDIR = 'G:/jmacd/PRCS_copy' 28#RCSDIR = 'G:/jmacd/PRCS_copy'
30SAMPLEDIR = "C:/sample_data/Wesnoth/tar" 29#SAMPLEDIR = "C:/sample_data/Wesnoth/tar"
30
31#RCSDIR = '/Users/jmacd/src/ftp.kernel.org/pub/scm/linux/kernel/bkcvs/linux-2.4/net/x25'
32RCSDIR = '/Users/jmacd/src/ftp.kernel.org'
31 33
32# 34#
33MIN_SIZE = 0 35MIN_SIZE = 0
@@ -38,8 +40,6 @@ SKIP_TRIALS = 2
38MIN_TRIALS = 3 40MIN_TRIALS = 3
39MAX_TRIALS = 15 41MAX_TRIALS = 15
40 42
41SKIP_DECODE = 1
42
43# 10 = fast 1.5 = slow 43# 10 = fast 1.5 = slow
44MIN_STDDEV_PCT = 1.5 44MIN_STDDEV_PCT = 1.5
45 45
@@ -57,7 +57,7 @@ MAX_RUN = 1000 * 1000 * 10
57 57
58# Testwide defaults 58# Testwide defaults
59ALL_ARGS = [ 59ALL_ARGS = [
60 # -v 60 '-vv'
61 ] 61 ]
62 62
63# The first 7 args go to -C 63# The first 7 args go to -C
@@ -231,11 +231,6 @@ class TimedTest:
231 lambda x: x.Encode(self.target, self.source, DFILE)) 231 lambda x: x.Encode(self.target, self.source, DFILE))
232 self.encode_size = runnable.EncodeSize(DFILE) 232 self.encode_size = runnable.EncodeSize(DFILE)
233 233
234 if SKIP_DECODE:
235 self.decode_time = StatList([1, 1], 'not decoded')
236 return
237 #end
238
239 self.decode_time = self.DoTest(RFILE, 234 self.decode_time = self.DoTest(RFILE,
240 lambda x: x.Decode(DFILE, self.source, RFILE), 235 lambda x: x.Decode(DFILE, self.source, RFILE),
241 ) 236 )
@@ -404,9 +399,10 @@ class Xdelta3Runner:
404 399
405 def Main(self, args): 400 def Main(self, args):
406 try: 401 try:
407 xdelta3main.main(args) 402 #print 'Run %s' % (' '.join(args))
403 xdelta3.xd3_main_cmdline(args)
408 except Exception, e: 404 except Exception, e:
409 raise CommandError(args, "xdelta3.main exception") 405 raise CommandError(args, "xdelta3.main exception: %s" % e)
410 #end 406 #end
411 #end 407 #end
412#end 408#end
@@ -904,10 +900,7 @@ class RandomTest:
904 #end 900 #end
905 901
906 def __str__(self): 902 def __str__(self):
907 decodestr = '' 903 decodestr = ' %.6f' % self.decodetime
908 if not SKIP_DECODE:
909 decodestr = ' %.6f' % self.decodetime
910 #end
911 return 'time %.6f%s size %d%s << %s >>%s' % ( 904 return 'time %.6f%s size %d%s << %s >>%s' % (
912 self.time(), ((self.time_pos != None) and (" (%s)" % self.time_pos) or ""), 905 self.time(), ((self.time_pos != None) and (" (%s)" % self.time_pos) or ""),
913 self.size(), ((self.size_pos != None) and (" (%s)" % self.size_pos) or ""), 906 self.size(), ((self.size_pos != None) and (" (%s)" % self.size_pos) or ""),
@@ -1202,19 +1195,20 @@ if __name__ == "__main__":
1202 RunCommand(['rm', '-rf', TMPDIR]) 1195 RunCommand(['rm', '-rf', TMPDIR])
1203 os.mkdir(TMPDIR) 1196 os.mkdir(TMPDIR)
1204 1197
1205 #rcsf = GetTestRcsFiles() 1198 rcsf = GetTestRcsFiles()
1206 #generator = rcsf.Generator() 1199 #generator = rcsf.Generator()
1207 1200
1208 sample = SampleDataTest([SAMPLEDIR]) 1201 #sample = SampleDataTest([SAMPLEDIR])
1209 generator = sample.Generator() 1202 #generator = sample.Generator()
1210 1203
1211 rand = random.Random(135135135135135) 1204 #rand = random.Random(135135135135135)
1212 RunTestLoop(rand, generator, TEST_ROUNDS) 1205 #RunTestLoop(rand, generator, TEST_ROUNDS)
1213 1206
1214 #RunSpeedTest() 1207 #RunSpeedTest()
1215 1208
1216 #x3r = rcsf.AllPairsByDate(Xdelta3RunClass(['-9'])) 1209 #x3r = rcsf.AllPairsByDate(Xdelta3RunClass(['-9']))
1217 #x3r = rcsf.AllPairsByDate(Xdelta3RunClass(['-9', '-S', 'djw'])) 1210 x3r = rcsf.AllPairsByDate(Xdelta3RunClass(['-9', '-S', 'djw']))
1211 x3r = rcsf.AllPairsByDate(Xdelta3RunClass(['-1', '-S', 'djw']))
1218 #x3r = rcsf.AllPairsByDate(Xdelta3RunClass(['-9', '-T'])) 1212 #x3r = rcsf.AllPairsByDate(Xdelta3RunClass(['-9', '-T']))
1219 1213
1220 #x1r = rcsf.AllPairsByDate(Xdelta1RunClass()) 1214 #x1r = rcsf.AllPairsByDate(Xdelta1RunClass())