[Avida-SVN] r1457 - in trunk: source/main tests/_testrunner
brysonda at myxo.css.msu.edu
brysonda at myxo.css.msu.edu
Wed Apr 4 18:46:11 PDT 2007
Author: brysonda
Date: 2007-04-04 21:46:11 -0400 (Wed, 04 Apr 2007)
New Revision: 1457
Modified:
trunk/source/main/cStats.cc
trunk/tests/_testrunner/testrunner.py
Log:
Fix uninitialized resampling stats variables that were throwing off some stats.dat consistency tests.
Upgrade TestRunner to v1.1, adding --show-diff option that shows full file diff for failed consistency tests.
Modified: trunk/source/main/cStats.cc
===================================================================
--- trunk/source/main/cStats.cc 2007-04-04 13:43:36 UTC (rev 1456)
+++ trunk/source/main/cStats.cc 2007-04-05 01:46:11 UTC (rev 1457)
@@ -82,6 +82,8 @@
, tot_thresh_species(0)
, tot_lineages(0)
, tot_executed(0)
+ , num_resamplings(0)
+ , num_failedResamplings(0)
, last_update(0)
, num_bought(0)
, num_sold(0)
Modified: trunk/tests/_testrunner/testrunner.py
===================================================================
--- trunk/tests/_testrunner/testrunner.py 2007-04-04 13:43:36 UTC (rev 1456)
+++ trunk/tests/_testrunner/testrunner.py 2007-04-05 01:46:11 UTC (rev 1457)
@@ -51,7 +51,7 @@
# Global Constants
# ---------------------------------------------------------------------------------------------------------------------------
-TESTRUNNER_VERSION = "1.0"
+TESTRUNNER_VERSION = "1.1"
TESTRUNNER_COPYRIGHT = "2007"
TRUE_STRINGS = ("y","Y","yes","Yes","true","True","1")
@@ -134,6 +134,9 @@
Reset performance test baseline results. Old baseline results are
saved in the 'perf' directory.
+ --show-diff
+ Show full file diff for failed consistency tests.
+
--skip-tests
Do not run tests. Only generate new results, where applicable.
@@ -402,12 +405,16 @@
differ = difflib.Differ()
elines = getStrippedLines(path)
tlines = getStrippedLines(expectstruct[key][0])
- diff = list(differ.compare(elines, tlines))
+ diff = list(differ.compare(tlines, elines))
match = True
for line in diff:
if line[0] != ' ':
expectstruct[key][2] = cTest.DONOTMATCH
+ if settings.has_key("show-diff"):
+ expectstruct[key][2] += "\n\n"
+ for l in diff: expectstruct[key][2] += l
+ expectstruct[key][2] += "\n"
match = False
break
@@ -865,8 +872,8 @@
try:
opts, args = getopt.getopt(argv[1:], "fhj:lm:ps:v", \
["builddir=", "disable-svn", "force-perf", "help", "list-tests", "long-tests", "mode=", "reset-perf-base", \
- "run-perf-tests", "skip-tests", "svnmetadir=", "svn=", "svnversion=", "testdir=", "verbose", "version", \
- "-testrunner-name="])
+ "run-perf-tests", "show-diff", "skip-tests", "svnmetadir=", "svn=", "svnversion=", "testdir=", "verbose", \
+ "version", "-testrunner-name="])
except getopt.GetoptError:
usage()
return -1
@@ -903,6 +910,8 @@
settings["reset-perf-base"] = ""
elif opt in ("-p", "--run-perf-tests"):
opt_runperf = True
+ elif opt == "--show-diff":
+ settings["show-diff"] = ""
elif opt == "--skip-tests":
settings["skip-tests"] = ""
elif opt == "--svnmetadir":
More information about the Avida-cvs
mailing list