diff --git a/test/boundanalyze.py b/test/boundanalyze.py new file mode 100755 index 0000000..a7a8660 --- /dev/null +++ b/test/boundanalyze.py @@ -0,0 +1,62 @@ +#!/usr/bin/python + +import os + +def analyze(file): + + claim = 0 + correct = 0 + attack = 0 + boundokay = 0 + notoccurs = 0 + + if os.path.isfile(file): + fp = open(file,'r') + for l in fp.readlines(): + if l.startswith("claim"): + claim = claim + 1 + if l.find("\tFail\t") >= 0: + attack = attack + 1 + else: + if l.find("bounds") >= 0: + boundokay = boundokay + 1 + else: + if l.find("proof") >= 0: + correct = correct + 1 + else: + if l.find("does not occur") >= 0: + notoccurs = notoccurs + 1 + else: + print "Huh? ", l.strip() + + + fp.close() + + if claim > 0: + ratio = (100.0 * (attack+correct)) / claim + print "[%s]\t%i\t%i\t%i\t%s%%" % (file, claim,attack,correct, str(ratio)) + +def timed(file): + + if os.path.isfile(file): + fp = open(file,'r') + for l in fp.readlines(): + l = l.strip() + if l.find("User time (seconds)") >= 0: + x = l.find(":") + time = float(l[(x+1):]) + print file, time + return + print file, " no time found" + +def all(): + for i in range(1,8): + analyze("boundruns%i.txt" % (i)) + for i in range(1,8): + timed("boundtime%i.txt" % (i)) + +all() + + + + diff --git a/test/boundtest.sh b/test/boundtest.sh new file mode 100755 index 0000000..d35ea1d --- /dev/null +++ b/test/boundtest.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +rm boundtime?.txt +rm boundruns?.txt + +\time -v -o boundtime1.txt ./test-all.sh scyther -r1 --plain >boundruns1.txt +\time -v -o boundtime2.txt ./test-all.sh scyther -r2 --plain >boundruns2.txt +\time -v -o boundtime3.txt ./test-all.sh scyther -r3 --plain >boundruns3.txt +\time -v -o boundtime4.txt ./test-all.sh scyther -r4 --plain >boundruns4.txt +\time -v -o boundtime5.txt ./test-all.sh scyther -r5 --plain >boundruns5.txt +\time -v -o boundtime6.txt ./test-all.sh scyther -r6 --plain >boundruns6.txt +\time -v -o boundtime7.txt ./test-all.sh scyther -r6 --plain >boundruns7.txt diff --git a/test/compareheuristics.py b/test/compareheuristics.py index 7c1a126..238b13c 100755 --- a/test/compareheuristics.py +++ b/test/compareheuristics.py @@ -198,7 +198,8 @@ def main(): sharedproblems = [] firstproblem = True - for g in range(1,8): + for g in range(-1,512): + if (g != 0) and ((g == -1) or ((g & (64+16+8+4+1)) == 0)): (ra,rb,rp,nc,np,st,timeouts,prot_undec) = test_goal_selector(g, options, boundstatesmax.get()) diff --git a/test/protocollist.py b/test/protocollist.py index 3b2b913..5ca4ff9 100644 --- a/test/protocollist.py +++ b/test/protocollist.py @@ -152,17 +152,9 @@ def select(type): def main(): - (good, bad, others) = make_lists() - - def show (tag, list): - print tag + " (%i)" % len(list) - print - for l in list: - print l - - show ("Good", good) - show ("Bad", bad) - show ("Others", others) + l = from_all() + for f in l: + print f if __name__ == '__main__': diff --git a/test/test-all.sh b/test/test-all.sh new file mode 100755 index 0000000..740d841 --- /dev/null +++ b/test/test-all.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +./protocollist.py | xargs -n 1 $* + diff --git a/test/test-one.sh b/test/test-one.sh new file mode 100755 index 0000000..698e340 --- /dev/null +++ b/test/test-one.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +echo $* + +scyther $*