[med-svn] [Git][med-team/libsonlib][master] Deleted 4 commits: Cutest is now provided as separate package.
Andreas Tille (@tille)
gitlab at salsa.debian.org
Mon Nov 2 20:21:44 GMT 2026
Andreas Tille pushed to branch master at Debian Med / libsonlib
WARNING: The push did not contain any new commits, but force pushed to delete the commits and changes below.
Deleted commits:
d57be42b by Andreas Tille at 2026-11-02T17:28:57+01:00
Cutest is now provided as separate package.
- - - - -
1c824698 by Andreas Tille at 2026-11-02T17:29:26+01:00
New upstream version 1.1+git20220915.5cbc158+dfsg1
- - - - -
28dfaf2e by Andreas Tille at 2026-11-02T17:29:26+01:00
Update upstream source from tag 'upstream/1.1+git20220915.5cbc158+dfsg1'
Update to upstream version '1.1+git20220915.5cbc158+dfsg1'
with Debian dir 33c6b155dcd055cdc3740fb094b51e3ae670a2cb
- - - - -
998127c9 by Andreas Tille at 2026-11-02T17:33:42+01:00
externalTools removed completely since libcutest-dev can be used now
- - - - -
20 changed files:
- − .gitignore
- debian/changelog
- debian/control
- debian/copyright
- debian/libsonlib-dev.install
- debian/patches/2to3.patch
- debian/patches/fix_test.patch
- debian/patches/use_debian_packaged_quicktree.patch
- debian/tests/control
- − externalTools/Makefile
- − externalTools/cutest/AllTests.c
- − externalTools/cutest/CuTest.c
- − externalTools/cutest/CuTest.h
- − externalTools/cutest/CuTestTest.c
- − externalTools/cutest/Makefile
- − externalTools/cutest/README.txt
- − externalTools/cutest/index.html
- − externalTools/cutest/license.txt
- − externalTools/cutest/make-tests.sh
- − externalTools/cutest/style.css
Changes:
=====================================
.gitignore deleted
=====================================
@@ -1 +0,0 @@
-/.pc/
=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+libsonlib (1.1+git20220915.5cbc158+dfsg1-1) UNRELEASED; urgency=medium
+
+ * Cutest is now provided as separate package.
+
+ -- Andreas Tille <tille at debian.org> Mon, 02 Nov 2026 17:28:12 +0100
+
libsonlib (1.1+git20220915.5cbc158+dfsg-2) unstable; urgency=medium
* Ship CuTest.h and cuTest.a in libsonlib-dev for packages whose
=====================================
debian/control
=====================================
@@ -8,6 +8,7 @@ Section: science
Build-Depends:
debhelper-compat (= 14),
libbz2-dev,
+ libcutest-dev,
libquicktree-dev,
libtokyocabinet-dev,
zlib1g-dev,
=====================================
debian/copyright
=====================================
@@ -1,7 +1,7 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: sonlib
Source: https://github.com/benedictpaten/sonLib
-Files-Excluded: externalTools/quicktree*
+Files-Excluded: externalTools
*/*.swp
*/.git*
@@ -9,28 +9,6 @@ Files: *
Copyright: 2009-2017 by Benedict Paten <benedictpaten at gmail.com>
License: MIT
-Files: externalTools/cutest/*
-Copyright: 2002-2003, Asim Jalis <asimjalis at gmail.com>
-License: Zlib
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
- .
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
- .
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software in
- a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- .
- 2. Altered source versions must be plainly marked as such, and must not
- be misrepresented as being the original software.
- .
- 3. This notice may not be removed or altered from any source
- distribution.
-
Files: C/impl/avl.c
C/inc/avl.h
Copyright: 1998-2002, 2004 Free Software Foundation, Inc.
=====================================
debian/libsonlib-dev.install
=====================================
@@ -1,2 +1 @@
lib/sonLib.a usr/lib/${DEB_HOST_MULTIARCH}/
-lib/cuTest.a usr/lib/${DEB_HOST_MULTIARCH}/
=====================================
debian/patches/2to3.patch
=====================================
@@ -2,9 +2,9 @@ Author: Andreas Tille <tille at debian.org>
Last-Update: 2020-06-16
Description: Port to Python3
---- libsonlib.orig/treeTest.py
-+++ libsonlib/treeTest.py
-@@ -17,7 +17,7 @@
+--- a/treeTest.py
++++ b/treeTest.py
+@@ -17,7 +17,7 @@ from misc import close
from tree import moveRoot
from tree import calculateDupsAndLossesByReconcilingTrees
from tree import calculateProbableRootOfGeneTree
@@ -13,7 +13,7 @@ Description: Port to Python3
class TestCase(unittest.TestCase):
-@@ -29,29 +29,29 @@
+@@ -29,29 +29,29 @@ class TestCase(unittest.TestCase):
unittest.TestCase.tearDown(self)
def testRemodelTreeRemovingRoot(self):
@@ -50,7 +50,7 @@ Description: Port to Python3
binaryTree_depthFirstNumbers(remodTree)
#distances = mapTraversalIDsBetweenTrees(binaryTree, remodTree)
#d = getDistancesBetweenLeaves(binaryTree)
-@@ -62,7 +62,7 @@
+@@ -62,7 +62,7 @@ class TestCase(unittest.TestCase):
# assert close(d2[key], d[key], 0.0001)
def testCalculateDupsAndLossesByReconcilingTrees(self):
@@ -59,7 +59,7 @@ Description: Port to Python3
speciesTree = getRandomTree()
binaryTree_depthFirstNumbers(speciesTree)
geneTree = getRandomTree()
-@@ -102,13 +102,13 @@
+@@ -102,13 +102,13 @@ class TestCase(unittest.TestCase):
geneStrings = [ geneString1, geneString2, geneString3, geneString4, \
geneString5, geneString6, geneString7, geneString8,
geneString9, geneString10, geneString11 ]
@@ -76,7 +76,7 @@ Description: Port to Python3
assert dupCount == dupCount2
assert lossCount == lossCount2
-@@ -144,11 +144,11 @@
+@@ -144,11 +144,11 @@ class TestCase(unittest.TestCase):
rootedGeneTree = newickTreeParser(geneString)
binaryTree_depthFirstNumbers(geneTree)
rootedGeneTree2, dupCount, lossCount = calculateProbableRootOfGeneTree(speciesTree, geneTree)
@@ -90,9 +90,9 @@ Description: Port to Python3
speciesTree = getRandomTree()
binaryTree_depthFirstNumbers(speciesTree)
geneTree = getRandomTree()
---- libsonlib.orig/allTests.py
-+++ libsonlib/allTests.py
-@@ -18,9 +18,9 @@
+--- a/allTests.py
++++ b/allTests.py
+@@ -18,9 +18,9 @@ try:
except ImportError:
networkx_installed = False
@@ -105,9 +105,9 @@ Description: Port to Python3
class TestCase(unittest.TestCase):
---- libsonlib.orig/sonLib_daemonize.py
-+++ libsonlib/sonLib_daemonize.py
-@@ -66,7 +66,7 @@
+--- a/sonLib_daemonize.py
++++ b/sonLib_daemonize.py
+@@ -66,7 +66,7 @@ else:
if __name__ == '__main__':
if len(sys.argv) != 2:
@@ -116,9 +116,9 @@ Description: Port to Python3
pid = os.fork()
if pid > 0:
---- libsonlib.orig/nxnewick.py
-+++ libsonlib/nxnewick.py
-@@ -13,11 +13,11 @@
+--- a/nxnewick.py
++++ b/nxnewick.py
+@@ -13,11 +13,11 @@ import re
import math
import random
from string import whitespace as ws
@@ -132,7 +132,7 @@ Description: Port to Python3
class NXNewick(object):
-@@ -187,15 +187,15 @@
+@@ -187,15 +187,15 @@ def main():
parser.parseFile(args[0])
NX.drawing.nx_agraph.write_dot(parser.nxTree.nxDg, args[1])
parser.writeFile(args[2])
@@ -154,9 +154,9 @@ Description: Port to Python3
return 0
if __name__ == '__main__':
---- libsonlib.orig/bioio.py
-+++ libsonlib/bioio.py
-@@ -421,14 +421,14 @@
+--- a/bioio.py
++++ b/bioio.py
+@@ -421,14 +421,14 @@ def nameValue(name, value, valueType=str
def getRandomAlphaNumericString(length=10):
"""Returns a random alpha numeric string of the given length.
"""
@@ -173,7 +173,7 @@ Description: Port to Python3
return dirName
def getTempFile(suffix="", rootDir=None):
-@@ -441,7 +441,7 @@
+@@ -441,7 +441,7 @@ def getTempFile(suffix="", rootDir=None)
else:
tmpFile = os.path.join(rootDir, "tmp_" + getRandomAlphaNumericString() + suffix)
open(tmpFile, 'w').close()
@@ -182,7 +182,7 @@ Description: Port to Python3
return tmpFile
def getTempDirectory(rootDir=None):
-@@ -468,7 +468,7 @@
+@@ -468,7 +468,7 @@ def getTempDirectory(rootDir=None):
break
os.mkdir(tmpDir)
@@ -191,7 +191,7 @@ Description: Port to Python3
return tmpDir
class TempFileTree:
-@@ -744,7 +744,7 @@
+@@ -744,7 +744,7 @@ def fastaWrite(fileHandleOrFile, name, s
fileHandle = _getFileHandle(fileHandleOrFile, mode)
valid_chars = {x for x in string.ascii_letters + "-"}
try:
@@ -200,7 +200,7 @@ Description: Port to Python3
except AssertionError:
raise RuntimeError("Sequence is not unicode or string")
try:
-@@ -754,7 +754,7 @@
+@@ -754,7 +754,7 @@ def fastaWrite(fileHandleOrFile, name, s
raise RuntimeError("Invalid FASTA character(s) see in fasta sequence: {}".format(bad_chars))
fileHandle.write(">%s\n" % name)
chunkSize = 100
@@ -209,7 +209,7 @@ Description: Port to Python3
fileHandle.write("%s\n" % seq[i:i+chunkSize])
if isinstance(fileHandleOrFile, "".__class__):
fileHandle.close()
-@@ -849,23 +849,23 @@
+@@ -849,23 +849,23 @@ def fastaAlignmentRead(fasta, mapFn=(lam
else:
l = l[:]
seqNo = len(l)
@@ -238,7 +238,7 @@ Description: Port to Python3
assert column[j] != '>' and column[j] != ''
column[j] = mapFn(column[j])
yield column[:]
-@@ -878,8 +878,8 @@
+@@ -878,8 +878,8 @@ def fastaAlignmentWrite(columnAlignment,
Writes out column alignment to given file multi-fasta format
"""
fastaFile = open(fastaFile, 'w')
@@ -249,7 +249,7 @@ Description: Port to Python3
fastaFile.write(">%s\n" % names[seq])
for column in columnAlignment:
fastaFile.write(column[seq])
-@@ -890,10 +890,10 @@
+@@ -890,10 +890,10 @@ def getRandomSequence(length=500):
"""Generates a random name and sequence.
"""
fastaHeader = ""
@@ -262,7 +262,7 @@ Description: Port to Python3
def _expLength(i=0, prob=0.95):
if random.random() >= prob:
-@@ -1043,9 +1043,9 @@
+@@ -1043,9 +1043,9 @@ def pWMRead(fileHandle, alphabetSize=4):
for line in lines[1:]:
l2 = [ float(i) for i in line.split() ]
assert len(l) == len(l2)
@@ -274,7 +274,7 @@ Description: Port to Python3
j = sum(l[i]) + 0.0
l[i] = [ k/j for k in l[i] ]
return l
-@@ -1053,8 +1053,8 @@
+@@ -1053,8 +1053,8 @@ def pWMRead(fileHandle, alphabetSize=4):
def pWMWrite(fileHandle, pWM, alphabetSize=4):
"""Writes file in standard PWM format, is reverse of pWMParser
"""
@@ -285,7 +285,7 @@ Description: Port to Python3
#########################################################
#########################################################
-@@ -1229,8 +1229,8 @@
+@@ -1229,8 +1229,8 @@ def cigarWrite(fileHandle, pairwiseAlign
def _getRandomSegment():
contig = random.choice([ "one", "two", "three", "four" ])
@@ -296,7 +296,7 @@ Description: Port to Python3
strand = random.choice([ True, False ])
if not strand:
start, end = end, start
-@@ -1244,7 +1244,7 @@
+@@ -1244,7 +1244,7 @@ def getRandomOperationList(xLength, yLen
if operationMaxLength == 1:
length = 1
else:
@@ -305,7 +305,7 @@ Description: Port to Python3
if opType != PairwiseAlignment.PAIRWISE_INDEL_Y and xLength - length < 0:
continue
if opType != PairwiseAlignment.PAIRWISE_INDEL_X and yLength - length < 0:
-@@ -1262,7 +1262,7 @@
+@@ -1262,7 +1262,7 @@ def getRandomPairwiseAlignment():
"""
i, j, k, l = _getRandomSegment()
m, n, o, p = _getRandomSegment()
@@ -314,9 +314,9 @@ Description: Port to Python3
return PairwiseAlignment(i, j, k, l, m, n, o, p, score, getRandomOperationList(abs(k - j), abs(o - n)))
#########################################################
---- libsonlib.orig/bioioTest.py
-+++ libsonlib/bioioTest.py
-@@ -33,7 +33,7 @@
+--- a/bioioTest.py
++++ b/bioioTest.py
+@@ -33,7 +33,7 @@ from bioio import cigarWrite
from bioio import PairwiseAlignment
from bioio import getRandomPairwiseAlignment
@@ -325,7 +325,7 @@ Description: Port to Python3
from bioio import system
from bioio import logger
-@@ -61,12 +61,12 @@
+@@ -61,12 +61,12 @@ class TestCase(unittest.TestCase):
#########################################################
def testTempFileTree(self):
@@ -342,7 +342,7 @@ Description: Port to Python3
tempFileTreeRootDir = os.path.join(self.tempDir, getRandomAlphaNumericString())
tempFileTree = TempFileTree(tempFileTreeRootDir, fileNo, levels)
-@@ -74,7 +74,7 @@
+@@ -74,7 +74,7 @@ class TestCase(unittest.TestCase):
tempFiles = []
tempDirs = []
#Check we can mac number of temp files.
@@ -351,7 +351,7 @@ Description: Port to Python3
if random.random() > 0.5:
tempFile = tempFileTree.getTempFile()
assert os.path.isfile(tempFile)
-@@ -132,9 +132,9 @@
+@@ -132,9 +132,9 @@ class TestCase(unittest.TestCase):
def testFastaReadWrite(self):
tempFile = getTempFile()
self.tempFiles.append(tempFile)
@@ -364,7 +364,7 @@ Description: Port to Python3
fileHandle = open(tempFile, 'w')
for name, seq in l:
fastaWrite(fileHandle, name, seq)
-@@ -150,9 +150,9 @@
+@@ -150,9 +150,9 @@ class TestCase(unittest.TestCase):
def testFastqReadWrite(self):
tempFile = getTempFile()
self.tempFiles.append(tempFile)
@@ -377,7 +377,7 @@ Description: Port to Python3
fH = open(tempFile, 'w')
for name, seq, quals in fastqs:
fastqWrite(fH, name, seq, quals)
-@@ -170,9 +170,9 @@
+@@ -170,9 +170,9 @@ class TestCase(unittest.TestCase):
self.tempFiles.append(tempFile)
tempFile2 = getTempFile()
self.tempFiles.append(tempFile2)
@@ -390,7 +390,7 @@ Description: Port to Python3
fileHandle = open(tempFile, 'w')
for name, seq in l:
fastaWrite(fileHandle, name, seq)
-@@ -180,7 +180,7 @@
+@@ -180,7 +180,7 @@ class TestCase(unittest.TestCase):
command = "sonLib_fastaCTest %s %s" % (tempFile, tempFile2)
@@ -399,7 +399,7 @@ Description: Port to Python3
system(command)
-@@ -205,12 +205,12 @@
+@@ -205,12 +205,12 @@ class TestCase(unittest.TestCase):
d = '((human,baboon),chimp);'
e = newickTreeParser(d)
f = printBinaryTree(e, False)
@@ -414,7 +414,7 @@ Description: Port to Python3
tree = getRandomTreeString()
logger.debug("tree to try\t", tree)
tree2 = newickTreeParser(tree, reportUnaryNodes=True)
-@@ -229,7 +229,7 @@
+@@ -229,7 +229,7 @@ class TestCase(unittest.TestCase):
def testPWMParser(self):
tempFile = getTempFile()
self.tempFiles.append(tempFile)
@@ -423,7 +423,7 @@ Description: Port to Python3
pWM = getRandomPWM()
fileHandle = open(tempFile, 'w')
-@@ -240,7 +240,7 @@
+@@ -240,7 +240,7 @@ class TestCase(unittest.TestCase):
pWM2 = pWMRead(fileHandle)
fileHandle.close()
@@ -432,7 +432,7 @@ Description: Port to Python3
pWM[i] == pWM2[i]
#########################################################
-@@ -254,9 +254,9 @@
+@@ -254,9 +254,9 @@ class TestCase(unittest.TestCase):
def testCigarReadWrite(self):
tempFile = getTempFile()
self.tempFiles.append(tempFile)
@@ -445,7 +445,7 @@ Description: Port to Python3
fileHandle = open(tempFile, 'w')
for cigar in l:
cigarWrite(fileHandle, cigar)
-@@ -292,10 +292,10 @@
+@@ -292,10 +292,10 @@ def getRandomPWM(length=-1):
if length == -1:
length = 1 + int(random.random()*10)
def fn():
@@ -458,9 +458,9 @@ Description: Port to Python3
if __name__ == '__main__':
unittest.main()
---- libsonlib.orig/cigarsTest.py
-+++ libsonlib/cigarsTest.py
-@@ -16,8 +16,8 @@
+--- a/cigarsTest.py
++++ b/cigarsTest.py
+@@ -16,8 +16,8 @@ from bioio import cigarRead
from bioio import cigarWrite
from bioio import getRandomPairwiseAlignment
from bioio import system
@@ -471,7 +471,7 @@ Description: Port to Python3
class TestCase(unittest.TestCase):
-@@ -36,9 +36,9 @@
+@@ -36,9 +36,9 @@ class TestCase(unittest.TestCase):
"""
tempFile = getTempFile()
self.tempFiles.append(tempFile)
@@ -484,9 +484,9 @@ Description: Port to Python3
fileHandle = open(tempFile, 'w')
keepProbs = random.random() > 0.5
---- libsonlib.orig/tree.py
-+++ libsonlib/tree.py
-@@ -10,7 +10,7 @@
+--- a/tree.py
++++ b/tree.py
+@@ -10,7 +10,7 @@ import re
import math
import random
@@ -495,7 +495,7 @@ Description: Port to Python3
#import bioio
#########################################################
-@@ -69,7 +69,7 @@
+@@ -69,7 +69,7 @@ def binaryTree_depthFirstNumbers(binaryT
return mid+1, leafNo+1
traverse(binaryTree)
if labelTree:
@@ -504,7 +504,7 @@ Description: Port to Python3
binaryTree.traversalID = traversalIDs[binaryTree]
return traversalIDs
-@@ -164,18 +164,18 @@
+@@ -164,18 +164,18 @@ def transformByDistance(wV, subModel, al
transform wV by given substitution matrix
"""
nc = [0.0]*alphabetSize
@@ -527,7 +527,7 @@ Description: Port to Python3
def normaliseWV(wV, normFac=1.0):
"""
-@@ -187,7 +187,7 @@
+@@ -187,7 +187,7 @@ def normaliseWV(wV, normFac=1.0):
def sumWVA(wVA, alphabetSize=4):
totals = [0.0]*alphabetSize
for wV in wVA:
@@ -536,7 +536,7 @@ Description: Port to Python3
totals[i] += wV[i]
return totals
-@@ -222,7 +222,7 @@
+@@ -222,7 +222,7 @@ def felsensteins(binaryTree, subMatrices
def calculateCharacterFrequencies(seq, map, alphabetSize):
counts = [0.0]*alphabetSize
for i in seq:
@@ -545,7 +545,7 @@ Description: Port to Python3
return counts
#########################################################
-@@ -261,9 +261,9 @@
+@@ -261,9 +261,9 @@ def calculateDNADistanceMatrix(seqNo, fa
transversions = [0.1]*seqNo*seqNo
counts = [1.0]*seqNo*seqNo
for column in fastaIter:
@@ -557,7 +557,7 @@ Description: Port to Python3
if column[j] in [ 'A', 'C', 'T', 'G' ]:
counts[i*seqNo + j] += 1
if column[i] != column[j]:
-@@ -277,9 +277,9 @@
+@@ -277,9 +277,9 @@ def calculateDNADistanceMatrix(seqNo, fa
transversions[i*seqNo + j] += 1
else:
transitions[i*seqNo + j] += 1
@@ -570,7 +570,7 @@ Description: Port to Python3
k = i * seqNo + j
distanceMatrix[i][j] = -0.75*math.log(1 - (4/3)*((transitions[k]+transversions[k])/counts[k])) #jukes cantor correction
distanceMatrix[j][i] = distanceMatrix[i][j]
-@@ -288,10 +288,10 @@
+@@ -288,10 +288,10 @@ def calculateDNADistanceMatrix(seqNo, fa
return distanceMatrix
def makeDistancePairs(distanceMatrix, iDs, seqNo):
@@ -584,7 +584,7 @@ Description: Port to Python3
distancePairs.append(DistancePair(distanceMatrix[i][j], binaryTrees[i], 1, binaryTrees[j], 1))
distancePairs.append(DistancePair(distanceMatrix[i][j], binaryTrees[j], 1, binaryTrees[i], 1))
return distancePairs
-@@ -327,10 +327,10 @@
+@@ -327,10 +327,10 @@ def upgmaI(distancePairs, leafNo):
holder1[i.leaf2] = i
if i.leaf1 == distancePair.leaf2 and i.leaf2 != distancePair.leaf1:
holder2[i.leaf2] = i
@@ -598,7 +598,7 @@ Description: Port to Python3
j = holder1[i]
k = holder2[i]
newDistance = (j.distance*j.leafNo1 + k.distance*k.leafNo1)/(j.leafNo1 + k.leafNo1)
-@@ -346,7 +346,7 @@
+@@ -346,7 +346,7 @@ def nj(distanceMatrix, iDs, leafNo):
def getMinPair(distancePairs, rValues, leafNo):
j = None
@@ -607,7 +607,7 @@ Description: Port to Python3
for i in distancePairs:
adjustD = i.distance - (rValues[i.leaf1] + rValues[i.leaf2])/(leafNo-2)
#print "the adjusted value ", adjustD, i.distance, rValues[i.leaf1]/(leafNo-2), rValues[i.leaf2]/(leafNo-2)
-@@ -359,11 +359,11 @@
+@@ -359,11 +359,11 @@ def getMinPair(distancePairs, rValues, l
def calculateRValues(distancePairs, leafNo):
j = {}
for i in distancePairs:
@@ -621,7 +621,7 @@ Description: Port to Python3
return j
def njI(distancePairs, leafNo):
-@@ -391,10 +391,10 @@
+@@ -391,10 +391,10 @@ def njI(distancePairs, leafNo):
holder1[i.leaf2] = i
if i.leaf1 == distancePair.leaf2 and i.leaf2 != distancePair.leaf1:
holder2[i.leaf2] = i
@@ -635,7 +635,7 @@ Description: Port to Python3
j = holder1[i]
k = holder2[i]
assert j.leaf2 == k.leaf2
-@@ -416,13 +416,13 @@
+@@ -416,13 +416,13 @@ def njI(distancePairs, leafNo):
def checkMatrix(m, fV, AS=4, reversible=True):
#print m
@@ -651,7 +651,7 @@ Description: Port to Python3
#print "comp2", (fV[i] * m[i][k]), (fV[k] * m[k][i] )
assert close(fV[i] * m[i][k], fV[k] * m[k][i], 0.00001)
-@@ -436,9 +436,9 @@
+@@ -436,9 +436,9 @@ def checkMatrix(m, fV, AS=4, reversible=
assert close(i, j, 0.00001)
def reverseSubMatrix(m, AS=4):
@@ -664,7 +664,7 @@ Description: Port to Python3
k[j][i] = m[i][j]
return k
-@@ -476,7 +476,7 @@
+@@ -476,7 +476,7 @@ def subMatrix_TamuraNei(d, fA, fC, fG, f
AS = 4
freq = ( fA, fC, fG, fT )
alpha = ( alphaPur, alphaPyr, alphaPur, alphaPyr )
@@ -673,7 +673,7 @@ Description: Port to Python3
#see page 203 of Felsenstein's Inferring Phylogenies for explanation of calculations
def watKro(j, k):
if (j % 2) == (k % 2):
-@@ -486,10 +486,10 @@
+@@ -486,10 +486,10 @@ def subMatrix_TamuraNei(d, fA, fC, fG, f
if i == j:
return 1.0
return 0.0
@@ -687,7 +687,7 @@ Description: Port to Python3
l += watKro(j, k) * freq[k]
matrix[i][j] =\
math.exp(-(alpha[i] + beta) * d) * kroenickerDelta(i, j) + \
-@@ -516,9 +516,9 @@
+@@ -516,9 +516,9 @@ def subMatrix_HKY(d, fA, fC, fG, fT, tra
def subMatrix_HalpernBruno(d, freqColumn, subMatrix, AS=4):
#return subMatrix_HKY(d, freqColumn[0], freqColumn[1], freqColumn[2], freqColumn[3], 2.0)
#return subMatrix
@@ -700,7 +700,7 @@ Description: Port to Python3
a = freqColumn[i] * subMatrix[i][j]
b = freqColumn[j] * subMatrix[j][i]
if not close(a, b, 0.0001):
-@@ -580,8 +580,8 @@
+@@ -580,8 +580,8 @@ def mapTraversalIDsBetweenTrees(oldTree,
internalMap[(fn(oldTree), fn(oldTree.left))] = fn(oldTree.right)
internalMap[(fn(oldTree.left), fn(oldTree))] = fn(oldTree.right)
fn3(oldTree)
@@ -711,7 +711,7 @@ Description: Port to Python3
def fn4(newTree):
if newTree.internal:
fn4(newTree.left)
-@@ -703,7 +703,7 @@
+@@ -703,7 +703,7 @@ def calculateDupsAndLossesByReconcilingT
if nodes.issubset(a[speciesTree.right.traversalID.mid]):
return fn2(nodes, speciesTree.right)
return speciesTree.traversalID.mid
@@ -720,7 +720,7 @@ Description: Port to Python3
nodes = b[iD]
b[iD] = fn2(nodes, speciesTree)
dups = []
-@@ -725,7 +725,7 @@
+@@ -725,7 +725,7 @@ def calculateDupsAndLossesByReconcilingT
nodes.append((node, losses+1))
return nodes
for node, losses in fn4(speciesTree):
@@ -729,7 +729,7 @@ Description: Port to Python3
losses = [0]
def fn5(geneTree, ancestor):
if geneTree.internal:
-@@ -745,7 +745,7 @@
+@@ -745,7 +745,7 @@ def calculateDupsAndLossesByReconcilingT
if speciesTree.internal:
fn6(speciesTree.left, speciesTree.traversalID.mid, node)
fn6(speciesTree.right, speciesTree.traversalID.mid, node)
@@ -738,18 +738,18 @@ Description: Port to Python3
assert ancestorHolder[0] is not None
fn5(geneTree, ancestorHolder[0])
return len(dups), losses[0]
---- libsonlib.orig/C/Makefile
-+++ libsonlib/C/Makefile
-@@ -59,4 +59,4 @@
+--- a/C/Makefile
++++ b/C/Makefile
+@@ -59,4 +59,4 @@ ${libPath}/sonLib.a : ${libSources} ${cp
mv sonLib.a ${libPath}/
test:
- python allTests.py --testLength=SHORT --logLevel CRITICAL
+ python3 allTests.py --testLength=SHORT --logLevel CRITICAL
---- libsonlib.orig/Makefile
-+++ libsonlib/Makefile
-@@ -21,7 +21,7 @@
- cd externalTools && $(MAKE) clean
+--- a/Makefile
++++ b/Makefile
+@@ -15,7 +15,7 @@ cP.clean :
+ cd C && $(MAKE) clean
test : all
- PYTHONPATH=.. PATH=../../bin:$$PATH python allTests.py --testLength=SHORT --logLevel=CRITICAL
@@ -757,9 +757,9 @@ Description: Port to Python3
${binPath}/sonLib_daemonize.py : sonLib_daemonize.py cP
cp sonLib_daemonize.py ${binPath}/sonLib_daemonize.py
---- libsonlib.orig/kvdbTest.py
-+++ libsonlib/kvdbTest.py
-@@ -10,7 +10,7 @@
+--- a/kvdbTest.py
++++ b/kvdbTest.py
+@@ -10,7 +10,7 @@ import os
import sys
import socket
@@ -768,9 +768,9 @@ Description: Port to Python3
class TestCase(unittest.TestCase):
---- libsonlib.orig/misc.py
-+++ libsonlib/misc.py
-@@ -21,7 +21,7 @@
+--- a/misc.py
++++ b/misc.py
+@@ -21,7 +21,7 @@ def sonTraceRootPath():
"""
function for finding external location
"""
@@ -779,9 +779,9 @@ Description: Port to Python3
i = os.path.abspath(sonLib.bioio.__file__)
return os.path.split(os.path.split(os.path.split(i)[0])[0])[0]
---- libsonlib.orig/nxnewickTest.py
-+++ libsonlib/nxnewickTest.py
-@@ -9,9 +9,9 @@
+--- a/nxnewickTest.py
++++ b/nxnewickTest.py
+@@ -9,9 +9,9 @@ import random
import re
from string import whitespace as ws
@@ -794,9 +794,9 @@ Description: Port to Python3
class TestCase(unittest.TestCase):
---- libsonlib.orig/nxtreeTest.py
-+++ libsonlib/nxtreeTest.py
-@@ -9,8 +9,8 @@
+--- a/nxtreeTest.py
++++ b/nxtreeTest.py
+@@ -9,8 +9,8 @@ import random
import copy
import networkx as NX
=====================================
debian/patches/fix_test.patch
=====================================
@@ -3,18 +3,18 @@ Last-Update: 2020-06-16
Description: Somehow the test suite was non-functional. Fix some PATHs here
Assisted-By: scaleway/deepseek-v4-flash-0731
---- libsonlib.orig/C/Makefile
-+++ libsonlib/C/Makefile
-@@ -59,4 +59,4 @@
+--- a/C/Makefile
++++ b/C/Makefile
+@@ -59,4 +59,4 @@ ${libPath}/sonLib.a : ${libSources} ${cp
mv sonLib.a ${libPath}/
test:
- python3 allTests.py --testLength=SHORT --logLevel CRITICAL
+ PYTHONPATH=.. python3 allTests.py --testLength=SHORT --logLevel CRITICAL
---- libsonlib.orig/Makefile
-+++ libsonlib/Makefile
-@@ -21,7 +21,7 @@
- cd externalTools && $(MAKE) clean
+--- a/Makefile
++++ b/Makefile
+@@ -15,7 +15,7 @@ cP.clean :
+ cd C && $(MAKE) clean
test : all
- PYTHONPATH=.. PATH=../../bin:$$PATH python3 allTests.py --testLength=SHORT --logLevel=CRITICAL
=====================================
debian/patches/use_debian_packaged_quicktree.patch
=====================================
@@ -4,35 +4,9 @@ Description: To avoid a code copy of quicktree here inside the quicktree
package a static lib is built and used to link here
Assisted-By: scaleway/deepseek-v4-flash-0731
---- libsonlib.orig/externalTools/Makefile
-+++ libsonlib/externalTools/Makefile
-@@ -1,20 +1,14 @@
- include ../include.mk
--.PHONY: all clean cutestM cutestM.clean quicktreeM.clean
-+.PHONY: all clean cutestM cutestM.clean
-
- libPath = ../lib
-
--all : cutestM quicktreeM
-+all : cutestM
-
--clean : cutestM.clean quicktreeM.clean
-+clean : cutestM.clean
-
- cutestM :
- cd cutest && make all
-
- cutestM.clean :
- cd cutest && make clean
--
--quicktreeM :
-- cd quicktree_1.1 && make all CC="${cxx}"
--
--quicktreeM.clean :
-- cd quicktree_1.1 && make clean
---- libsonlib.orig/C/Makefile
-+++ libsonlib/C/Makefile
-@@ -7,12 +7,11 @@
+--- a/C/Makefile
++++ b/C/Makefile
+@@ -7,12 +7,11 @@ cppSources = impl/*.cpp
libHeaders = $(wildcard inc/*.h)
libInternalHeaders = impl/*.h
libTests = tests/sonLib*.c tests/st*
@@ -46,7 +20,7 @@ Assisted-By: scaleway/deepseek-v4-flash-0731
cppflags += ${kyotoTycoonIncl}
all : ${libPath}/sonLib.a ${testProgs}
-@@ -22,7 +21,7 @@
+@@ -22,7 +21,7 @@ clean :
${binPath}/sonLibTests : ${libTests} ${libInternalHeaders} ${libPath}/sonLib.a ${libPath}/cuTest.a tests/allTests.c
@mkdir -p $(dir $@)
@@ -55,7 +29,7 @@ Assisted-By: scaleway/deepseek-v4-flash-0731
mv $@.tmp $@
${binPath}/sonLib_kvDatabaseTest : ${libTests} ${libInternalHeaders} ${libPath}/sonLib.a ${libPath}/cuTest.a tests/kvDatabaseTest.c tests/kvDatabaseTestCommon.c
-@@ -52,9 +51,9 @@
+@@ -52,9 +51,9 @@ ${libPath}/%.h: inc/%.h
${libPath}/sonLib.a : ${libSources} ${cppSources} $(foreach l, ${libHeaders}, ${libPath}/$(notdir $l)) ${libInternalHeaders}
@mkdir -p $(dir $@)
@@ -68,3 +42,34 @@ Assisted-By: scaleway/deepseek-v4-flash-0731
ranlib sonLib.a
rm *.o
mv sonLib.a ${libPath}/
+--- a/Makefile
++++ b/Makefile
+@@ -1,25 +1,19 @@
+ include include.mk
+ binPath = ./bin
+
+-.PHONY: all clean cP cP.clean externalToolsP.clean test
++.PHONY: all clean cP cP.clean test
+
+ all : cP ${binPath}/sonLib_daemonize.py
+
+-clean : cP.clean externalToolsP.clean
++clean : cP.clean
+ rm -f ${binPath}/sonLib_daemonize.py
+
+-cP: externalToolsP
++cP:
+ cd C && $(MAKE) all
+
+-externalToolsP:
+- cd externalTools && $(MAKE) all
+-
+ cP.clean :
+ cd C && $(MAKE) clean
+
+-externalToolsP.clean :
+- cd externalTools && $(MAKE) clean
+-
+ test : all
+ PYTHONPATH=.. PATH=../../bin:$$PATH python allTests.py --testLength=SHORT --logLevel=CRITICAL
+
=====================================
debian/tests/control
=====================================
@@ -1,2 +1,2 @@
Tests: compile-link
-Depends: @, build-essential, libquicktree-dev, libtokyocabinet-dev, zlib1g-dev, libbz2-dev
+Depends: @, build-essential, libcutest-dev, libquicktree-dev, libtokyocabinet-dev, zlib1g-dev, libbz2-dev
=====================================
externalTools/Makefile deleted
=====================================
@@ -1,20 +0,0 @@
-include ../include.mk
-.PHONY: all clean cutestM cutestM.clean quicktreeM.clean
-
-libPath = ../lib
-
-all : cutestM quicktreeM
-
-clean : cutestM.clean quicktreeM.clean
-
-cutestM :
- cd cutest && make all
-
-cutestM.clean :
- cd cutest && make clean
-
-quicktreeM :
- cd quicktree_1.1 && make all CC="${cxx}"
-
-quicktreeM.clean :
- cd quicktree_1.1 && make clean
=====================================
externalTools/cutest/AllTests.c deleted
=====================================
@@ -1,25 +0,0 @@
-#include <stdio.h>
-
-#include "CuTest.h"
-
-CuSuite* CuGetSuite();
-CuSuite* CuStringGetSuite();
-
-void RunAllTests(void)
-{
- CuString *output = CuStringNew();
- CuSuite* suite = CuSuiteNew();
-
- CuSuiteAddSuite(suite, CuGetSuite());
- CuSuiteAddSuite(suite, CuStringGetSuite());
-
- CuSuiteRun(suite);
- CuSuiteSummary(suite, output);
- CuSuiteDetails(suite, output);
- printf("%s\n", output->buffer);
-}
-
-int main(void)
-{
- RunAllTests();
-}
=====================================
externalTools/cutest/CuTest.c deleted
=====================================
@@ -1,342 +0,0 @@
-#include <assert.h>
-#include <setjmp.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-
-#include "CuTest.h"
-
-/*-------------------------------------------------------------------------*
- * CuStr
- *-------------------------------------------------------------------------*/
-
-char* CuStrAlloc(int size)
-{
- char* newStr = (char*) malloc( sizeof(char) * (size) );
- return newStr;
-}
-
-char* CuStrCopy(const char* old)
-{
- int len = strlen(old);
- char* newStr = CuStrAlloc(len + 1);
- strcpy(newStr, old);
- return newStr;
-}
-
-/*-------------------------------------------------------------------------*
- * CuString
- *-------------------------------------------------------------------------*/
-
-void CuStringInit(CuString* str)
-{
- str->length = 0;
- str->size = STRING_MAX;
- str->buffer = (char*) malloc(sizeof(char) * str->size);
- str->buffer[0] = '\0';
-}
-
-CuString* CuStringNew(void)
-{
- CuString* str = (CuString*) malloc(sizeof(CuString));
- str->length = 0;
- str->size = STRING_MAX;
- str->buffer = (char*) malloc(sizeof(char) * str->size);
- str->buffer[0] = '\0';
- return str;
-}
-
-void CuStringDelete(CuString *str)
-{
- if (!str) return;
- free(str->buffer);
- free(str);
-}
-
-void CuStringResize(CuString* str, int newSize)
-{
- str->buffer = (char*) realloc(str->buffer, sizeof(char) * newSize);
- str->size = newSize;
-}
-
-void CuStringAppend(CuString* str, const char* text)
-{
- int length;
-
- if (text == NULL) {
- text = "NULL";
- }
-
- length = strlen(text);
- if (str->length + length + 1 >= str->size)
- CuStringResize(str, str->length + length + 1 + STRING_INC);
- str->length += length;
- strcat(str->buffer, text);
-}
-
-void CuStringAppendChar(CuString* str, char ch)
-{
- char text[2];
- text[0] = ch;
- text[1] = '\0';
- CuStringAppend(str, text);
-}
-
-void CuStringAppendFormat(CuString* str, const char* format, ...)
-{
- va_list argp;
- char buf[HUGE_STRING_LEN];
- va_start(argp, format);
- vsprintf(buf, format, argp);
- va_end(argp);
- CuStringAppend(str, buf);
-}
-
-void CuStringInsert(CuString* str, const char* text, int pos)
-{
- int length = strlen(text);
- if (pos > str->length)
- pos = str->length;
- if (str->length + length + 1 >= str->size)
- CuStringResize(str, str->length + length + 1 + STRING_INC);
- memmove(str->buffer + pos + length, str->buffer + pos, (str->length - pos) + 1);
- str->length += length;
- memcpy(str->buffer + pos, text, length);
-}
-
-/*-------------------------------------------------------------------------*
- * CuTest
- *-------------------------------------------------------------------------*/
-
-void CuTestInit(CuTest* t, const char* name, TestFunction function)
-{
- t->name = CuStrCopy(name);
- t->failed = 0;
- t->ran = 0;
- t->message = NULL;
- t->function = function;
- t->jumpBuf = NULL;
-}
-
-CuTest* CuTestNew(const char* name, TestFunction function)
-{
- CuTest* tc = CU_ALLOC(CuTest);
- CuTestInit(tc, name, function);
- return tc;
-}
-
-void CuTestDelete(CuTest *t)
-{
- if (!t) return;
- free(t->name);
- free(t);
-}
-
-void CuTestRun(CuTest* tc)
-{
- jmp_buf buf;
- tc->jumpBuf = &buf;
- if (setjmp(buf) == 0)
- {
- tc->ran = 1;
- (tc->function)(tc);
- }
- tc->jumpBuf = 0;
-}
-
-static void CuFailInternal(CuTest* tc, const char* file, int line, CuString* string)
-{
- char buf[HUGE_STRING_LEN];
-
- sprintf(buf, "%s:%d: ", file, line);
- CuStringInsert(string, buf, 0);
-
- tc->failed = 1;
- tc->message = string->buffer;
- if (tc->jumpBuf != 0) longjmp(*(tc->jumpBuf), 0);
-}
-
-void CuFail_Line(CuTest* tc, const char* file, int line, const char* message2, const char* message)
-{
- CuString string;
-
- CuStringInit(&string);
- if (message2 != NULL)
- {
- CuStringAppend(&string, message2);
- CuStringAppend(&string, ": ");
- }
- CuStringAppend(&string, message);
- CuFailInternal(tc, file, line, &string);
-}
-
-void CuAssert_Line(CuTest* tc, const char* file, int line, const char* message, int condition)
-{
- if (condition) return;
- CuFail_Line(tc, file, line, NULL, message);
-}
-
-void CuAssertStrEquals_LineMsg(CuTest* tc, const char* file, int line, const char* message,
- const char* expected, const char* actual)
-{
- CuString string;
- if ((expected == NULL && actual == NULL) ||
- (expected != NULL && actual != NULL &&
- strcmp(expected, actual) == 0))
- {
- return;
- }
-
- CuStringInit(&string);
- if (message != NULL)
- {
- CuStringAppend(&string, message);
- CuStringAppend(&string, ": ");
- }
- CuStringAppend(&string, "expected <");
- CuStringAppend(&string, expected);
- CuStringAppend(&string, "> but was <");
- CuStringAppend(&string, actual);
- CuStringAppend(&string, ">");
- CuFailInternal(tc, file, line, &string);
-}
-
-void CuAssertIntEquals_LineMsg(CuTest* tc, const char* file, int line, const char* message,
- int expected, int actual)
-{
- char buf[STRING_MAX];
- if (expected == actual) return;
- sprintf(buf, "expected <%d> but was <%d>", expected, actual);
- CuFail_Line(tc, file, line, message, buf);
-}
-
-void CuAssertDblEquals_LineMsg(CuTest* tc, const char* file, int line, const char* message,
- double expected, double actual, double delta)
-{
- char buf[STRING_MAX];
- if (fabs(expected - actual) <= delta) return;
- sprintf(buf, "expected <%f> but was <%f>", expected, actual);
-
- CuFail_Line(tc, file, line, message, buf);
-}
-
-void CuAssertPtrEquals_LineMsg(CuTest* tc, const char* file, int line, const char* message,
- void* expected, void* actual)
-{
- char buf[STRING_MAX];
- if (expected == actual) return;
- sprintf(buf, "expected pointer <0x%p> but was <0x%p>", expected, actual);
- CuFail_Line(tc, file, line, message, buf);
-}
-
-
-/*-------------------------------------------------------------------------*
- * CuSuite
- *-------------------------------------------------------------------------*/
-
-void CuSuiteInit(CuSuite* testSuite)
-{
- testSuite->count = 0;
- testSuite->failCount = 0;
- memset(testSuite->list, 0, sizeof(testSuite->list));
-}
-
-CuSuite* CuSuiteNew(void)
-{
- CuSuite* testSuite = CU_ALLOC(CuSuite);
- CuSuiteInit(testSuite);
- return testSuite;
-}
-
-void CuSuiteDelete(CuSuite *testSuite)
-{
- unsigned int n;
- for (n=0; n < MAX_TEST_CASES; n++)
- {
- if (testSuite->list[n])
- {
- CuTestDelete(testSuite->list[n]);
- }
- }
- free(testSuite);
-
-}
-
-void CuSuiteAdd(CuSuite* testSuite, CuTest *testCase)
-{
- assert(testSuite->count < MAX_TEST_CASES);
- testSuite->list[testSuite->count] = testCase;
- testSuite->count++;
-}
-
-void CuSuiteAddSuite(CuSuite* testSuite, CuSuite* testSuite2)
-{
- int i;
- for (i = 0 ; i < testSuite2->count ; ++i)
- {
- CuTest* testCase = testSuite2->list[i];
- CuSuiteAdd(testSuite, testCase);
- testSuite2->list[i] = NULL;
- }
- CuSuiteDelete(testSuite2);
-}
-
-void CuSuiteRun(CuSuite* testSuite)
-{
- int i;
- for (i = 0 ; i < testSuite->count ; ++i)
- {
- CuTest* testCase = testSuite->list[i];
- printf("Running test case %s\n", testCase->name);
- CuTestRun(testCase);
- if (testCase->failed) { testSuite->failCount += 1; }
- }
-}
-
-void CuSuiteSummary(CuSuite* testSuite, CuString* summary)
-{
- int i;
- for (i = 0 ; i < testSuite->count ; ++i)
- {
- CuTest* testCase = testSuite->list[i];
- CuStringAppend(summary, testCase->failed ? "F" : ".");
- }
- CuStringAppend(summary, "\n\n");
-}
-
-void CuSuiteDetails(CuSuite* testSuite, CuString* details)
-{
- int i;
- int failCount = 0;
-
- if (testSuite->failCount == 0)
- {
- int passCount = testSuite->count - testSuite->failCount;
- const char* testWord = passCount == 1 ? "test" : "tests";
- CuStringAppendFormat(details, "OK (%d %s)\n", passCount, testWord);
- }
- else
- {
- if (testSuite->failCount == 1)
- CuStringAppend(details, "There was 1 failure:\n");
- else
- CuStringAppendFormat(details, "There were %d failures:\n", testSuite->failCount);
-
- for (i = 0 ; i < testSuite->count ; ++i)
- {
- CuTest* testCase = testSuite->list[i];
- if (testCase->failed)
- {
- failCount++;
- CuStringAppendFormat(details, "%d) %s: %s\n",
- failCount, testCase->name, testCase->message);
- }
- }
- CuStringAppend(details, "\n!!!FAILURES!!!\n");
-
- CuStringAppendFormat(details, "Runs: %d ", testSuite->count);
- CuStringAppendFormat(details, "Passes: %d ", testSuite->count - testSuite->failCount);
- CuStringAppendFormat(details, "Fails: %d\n", testSuite->failCount);
- }
-}
=====================================
externalTools/cutest/CuTest.h deleted
=====================================
@@ -1,116 +0,0 @@
-#ifndef CU_TEST_H
-#define CU_TEST_H
-
-#include <setjmp.h>
-#include <stdarg.h>
-
-#define CUTEST_VERSION "CuTest 1.5"
-
-/* CuString */
-
-char* CuStrAlloc(int size);
-char* CuStrCopy(const char* old);
-
-#define CU_ALLOC(TYPE) ((TYPE*) malloc(sizeof(TYPE)))
-
-#define HUGE_STRING_LEN 8192
-#define STRING_MAX 256
-#define STRING_INC 256
-
-typedef struct
-{
- int length;
- int size;
- char* buffer;
-} CuString;
-
-void CuStringInit(CuString* str);
-CuString* CuStringNew(void);
-void CuStringRead(CuString* str, const char* path);
-void CuStringAppend(CuString* str, const char* text);
-void CuStringAppendChar(CuString* str, char ch);
-void CuStringAppendFormat(CuString* str, const char* format, ...);
-void CuStringInsert(CuString* str, const char* text, int pos);
-void CuStringResize(CuString* str, int newSize);
-void CuStringDelete(CuString* str);
-
-/* CuTest */
-
-typedef struct CuTest CuTest;
-
-typedef void (*TestFunction)(CuTest *);
-
-struct CuTest
-{
- char* name;
- TestFunction function;
- int failed;
- int ran;
- const char* message;
- jmp_buf *jumpBuf;
-};
-
-void CuTestInit(CuTest* t, const char* name, TestFunction function);
-CuTest* CuTestNew(const char* name, TestFunction function);
-void CuTestRun(CuTest* tc);
-void CuTestDelete(CuTest *t);
-
-/* Internal versions of assert functions -- use the public versions */
-void CuFail_Line(CuTest* tc, const char* file, int line, const char* message2, const char* message);
-void CuAssert_Line(CuTest* tc, const char* file, int line, const char* message, int condition);
-void CuAssertStrEquals_LineMsg(CuTest* tc,
- const char* file, int line, const char* message,
- const char* expected, const char* actual);
-void CuAssertIntEquals_LineMsg(CuTest* tc,
- const char* file, int line, const char* message,
- int expected, int actual);
-void CuAssertDblEquals_LineMsg(CuTest* tc,
- const char* file, int line, const char* message,
- double expected, double actual, double delta);
-void CuAssertPtrEquals_LineMsg(CuTest* tc,
- const char* file, int line, const char* message,
- void* expected, void* actual);
-
-/* public assert functions */
-
-#define CuFail(tc, ms) CuFail_Line( (tc), __FILE__, __LINE__, NULL, (ms))
-#define CuAssert(tc, ms, cond) CuAssert_Line((tc), __FILE__, __LINE__, (ms), (cond))
-#define CuAssertTrue(tc, cond) CuAssert_Line((tc), __FILE__, __LINE__, "assert failed", (cond))
-
-#define CuAssertStrEquals(tc,ex,ac) CuAssertStrEquals_LineMsg((tc),__FILE__,__LINE__,NULL,(ex),(ac))
-#define CuAssertStrEquals_Msg(tc,ms,ex,ac) CuAssertStrEquals_LineMsg((tc),__FILE__,__LINE__,(ms),(ex),(ac))
-#define CuAssertIntEquals(tc,ex,ac) CuAssertIntEquals_LineMsg((tc),__FILE__,__LINE__,NULL,(ex),(ac))
-#define CuAssertIntEquals_Msg(tc,ms,ex,ac) CuAssertIntEquals_LineMsg((tc),__FILE__,__LINE__,(ms),(ex),(ac))
-#define CuAssertDblEquals(tc,ex,ac,dl) CuAssertDblEquals_LineMsg((tc),__FILE__,__LINE__,NULL,(ex),(ac),(dl))
-#define CuAssertDblEquals_Msg(tc,ms,ex,ac,dl) CuAssertDblEquals_LineMsg((tc),__FILE__,__LINE__,(ms),(ex),(ac),(dl))
-#define CuAssertPtrEquals(tc,ex,ac) CuAssertPtrEquals_LineMsg((tc),__FILE__,__LINE__,NULL,(ex),(ac))
-#define CuAssertPtrEquals_Msg(tc,ms,ex,ac) CuAssertPtrEquals_LineMsg((tc),__FILE__,__LINE__,(ms),(ex),(ac))
-
-#define CuAssertPtrNotNull(tc,p) CuAssert_Line((tc),__FILE__,__LINE__,"null pointer unexpected",(p != NULL))
-#define CuAssertPtrNotNullMsg(tc,msg,p) CuAssert_Line((tc),__FILE__,__LINE__,(msg),(p != NULL))
-
-/* CuSuite */
-
-#define MAX_TEST_CASES 1024
-
-#define SUITE_ADD_TEST(SUITE,TEST) CuSuiteAdd(SUITE, CuTestNew(#TEST, TEST))
-
-typedef struct
-{
- int count;
- CuTest* list[MAX_TEST_CASES];
- int failCount;
-
-} CuSuite;
-
-
-void CuSuiteInit(CuSuite* testSuite);
-CuSuite* CuSuiteNew(void);
-void CuSuiteDelete(CuSuite *testSuite);
-void CuSuiteAdd(CuSuite* testSuite, CuTest *testCase);
-void CuSuiteAddSuite(CuSuite* testSuite, CuSuite* testSuite2);
-void CuSuiteRun(CuSuite* testSuite);
-void CuSuiteSummary(CuSuite* testSuite, CuString* summary);
-void CuSuiteDetails(CuSuite* testSuite, CuString* details);
-
-#endif /* CU_TEST_H */
=====================================
externalTools/cutest/CuTestTest.c deleted
=====================================
@@ -1,709 +0,0 @@
-#include <assert.h>
-#include <setjmp.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "CuTest.h"
-
-/*-------------------------------------------------------------------------*
- * Helper functions
- *-------------------------------------------------------------------------*/
-
-#define CompareAsserts(tc, message, expected, actual) X_CompareAsserts((tc), __FILE__, __LINE__, (message), (expected), (actual))
-
-static void X_CompareAsserts(CuTest* tc, const char *file, int line, const char* message, const char* expected, const char* actual)
-{
- int mismatch;
- if (expected == NULL || actual == NULL) {
- mismatch = (expected != NULL || actual != NULL);
- } else {
- const char *front = __FILE__ ":";
- const size_t frontLen = strlen(front);
- const size_t expectedLen = strlen(expected);
-
- const char *matchStr = actual;
-
- mismatch = (strncmp(matchStr, front, frontLen) != 0);
- if (!mismatch) {
- matchStr = strchr(matchStr + frontLen, ':');
- mismatch |= (matchStr == NULL || strncmp(matchStr, ": ", 2));
- if (!mismatch) {
- matchStr += 2;
- mismatch |= (strncmp(matchStr, expected, expectedLen) != 0);
- }
- }
- }
-
- CuAssert_Line(tc, file, line, message, !mismatch);
-}
-
-/*-------------------------------------------------------------------------*
- * CuString Test
- *-------------------------------------------------------------------------*/
-
-void TestCuStringNew(CuTest* tc)
-{
- CuString* str = CuStringNew();
- CuAssertTrue(tc, 0 == str->length);
- CuAssertTrue(tc, 0 != str->size);
- CuAssertStrEquals(tc, "", str->buffer);
-}
-
-
-void TestCuStringAppend(CuTest* tc)
-{
- CuString* str = CuStringNew();
- CuStringAppend(str, "hello");
- CuAssertIntEquals(tc, 5, str->length);
- CuAssertStrEquals(tc, "hello", str->buffer);
- CuStringAppend(str, " world");
- CuAssertIntEquals(tc, 11, str->length);
- CuAssertStrEquals(tc, "hello world", str->buffer);
-}
-
-
-void TestCuStringAppendNULL(CuTest* tc)
-{
- CuString* str = CuStringNew();
- CuStringAppend(str, NULL);
- CuAssertIntEquals(tc, 4, str->length);
- CuAssertStrEquals(tc, "NULL", str->buffer);
-}
-
-
-void TestCuStringAppendChar(CuTest* tc)
-{
- CuString* str = CuStringNew();
- CuStringAppendChar(str, 'a');
- CuStringAppendChar(str, 'b');
- CuStringAppendChar(str, 'c');
- CuStringAppendChar(str, 'd');
- CuAssertIntEquals(tc, 4, str->length);
- CuAssertStrEquals(tc, "abcd", str->buffer);
-}
-
-
-void TestCuStringInserts(CuTest* tc)
-{
- CuString* str = CuStringNew();
- CuStringAppend(str, "world");
- CuAssertIntEquals(tc, 5, str->length);
- CuAssertStrEquals(tc, "world", str->buffer);
- CuStringInsert(str, "hell", 0);
- CuAssertIntEquals(tc, 9, str->length);
- CuAssertStrEquals(tc, "hellworld", str->buffer);
- CuStringInsert(str, "o ", 4);
- CuAssertIntEquals(tc, 11, str->length);
- CuAssertStrEquals(tc, "hello world", str->buffer);
- CuStringInsert(str, "!", 11);
- CuAssertIntEquals(tc, 12, str->length);
- CuAssertStrEquals(tc, "hello world!", str->buffer);
-}
-
-
-void TestCuStringResizes(CuTest* tc)
-{
- CuString* str = CuStringNew();
- int i;
- for(i = 0 ; i < STRING_MAX ; ++i)
- {
- CuStringAppend(str, "aa");
- }
- CuAssertTrue(tc, STRING_MAX * 2 == str->length);
- CuAssertTrue(tc, STRING_MAX * 2 <= str->size);
-}
-
-CuSuite* CuStringGetSuite(void)
-{
- CuSuite* suite = CuSuiteNew();
-
- SUITE_ADD_TEST(suite, TestCuStringNew);
- SUITE_ADD_TEST(suite, TestCuStringAppend);
- SUITE_ADD_TEST(suite, TestCuStringAppendNULL);
- SUITE_ADD_TEST(suite, TestCuStringAppendChar);
- SUITE_ADD_TEST(suite, TestCuStringInserts);
- SUITE_ADD_TEST(suite, TestCuStringResizes);
-
- return suite;
-}
-
-/*-------------------------------------------------------------------------*
- * CuTest Test
- *-------------------------------------------------------------------------*/
-
-void TestPasses(CuTest* tc)
-{
- CuAssert(tc, "test should pass", 1 == 0 + 1);
-}
-
-void zTestFails(CuTest* tc)
-{
- CuAssert(tc, "test should fail", 1 == 1 + 1);
-}
-
-
-void TestCuTestNew(CuTest* tc)
-{
- CuTest* tc2 = CuTestNew("MyTest", TestPasses);
- CuAssertStrEquals(tc, "MyTest", tc2->name);
- CuAssertTrue(tc, !tc2->failed);
- CuAssertTrue(tc, tc2->message == NULL);
- CuAssertTrue(tc, tc2->function == TestPasses);
- CuAssertTrue(tc, tc2->ran == 0);
- CuAssertTrue(tc, tc2->jumpBuf == NULL);
-}
-
-
-void TestCuTestInit(CuTest *tc)
-{
- CuTest tc2;
- CuTestInit(&tc2, "MyTest", TestPasses);
- CuAssertStrEquals(tc, "MyTest", tc2.name);
- CuAssertTrue(tc, !tc2.failed);
- CuAssertTrue(tc, tc2.message == NULL);
- CuAssertTrue(tc, tc2.function == TestPasses);
- CuAssertTrue(tc, tc2.ran == 0);
- CuAssertTrue(tc, tc2.jumpBuf == NULL);
-}
-
-void TestCuAssert(CuTest* tc)
-{
- CuTest tc2;
- CuTestInit(&tc2, "MyTest", TestPasses);
-
- CuAssert(&tc2, "test 1", 5 == 4 + 1);
- CuAssertTrue(tc, !tc2.failed);
- CuAssertTrue(tc, tc2.message == NULL);
-
- CuAssert(&tc2, "test 2", 0);
- CuAssertTrue(tc, tc2.failed);
- CompareAsserts(tc, "CuAssert didn't fail", "test 2", tc2.message);
-
- CuAssert(&tc2, "test 3", 1);
- CuAssertTrue(tc, tc2.failed);
- CompareAsserts(tc, "CuAssert didn't fail", "test 2", tc2.message);
-
- CuAssert(&tc2, "test 4", 0);
- CuAssertTrue(tc, tc2.failed);
- CompareAsserts(tc, "CuAssert didn't fail", "test 4", tc2.message);
-
-}
-
-void TestCuAssertPtrEquals_Success(CuTest* tc)
-{
- CuTest tc2;
- int x;
-
- CuTestInit(&tc2, "MyTest", TestPasses);
-
- /* test success case */
- CuAssertPtrEquals(&tc2, &x, &x);
- CuAssertTrue(tc, ! tc2.failed);
- CuAssertTrue(tc, NULL == tc2.message);
-}
-
-void TestCuAssertPtrEquals_Failure(CuTest* tc)
-{
- CuTest tc2;
- int x;
- int* nullPtr = NULL;
- char expected_message[STRING_MAX];
-
- CuTestInit(&tc2, "MyTest", TestPasses);
-
- /* test failing case */
- sprintf(expected_message, "expected pointer <0x%p> but was <0x%p>", nullPtr, &x);
- CuAssertPtrEquals(&tc2, NULL, &x);
- CuAssertTrue(tc, tc2.failed);
- CompareAsserts(tc, "CuAssertPtrEquals failed", expected_message, tc2.message);
-}
-
-void TestCuAssertPtrNotNull_Success(CuTest* tc)
-{
- CuTest tc2;
- int x;
-
- CuTestInit(&tc2, "MyTest", TestPasses);
-
- /* test success case */
- CuAssertPtrNotNull(&tc2, &x);
- CuAssertTrue(tc, ! tc2.failed);
- CuAssertTrue(tc, NULL == tc2.message);
-}
-
-void TestCuAssertPtrNotNull_Failure(CuTest* tc)
-{
- CuTest tc2;
-
- CuTestInit(&tc2, "MyTest", TestPasses);
-
- /* test failing case */
- CuAssertPtrNotNull(&tc2, NULL);
- CuAssertTrue(tc, tc2.failed);
- CompareAsserts(tc, "CuAssertPtrNotNull failed", "null pointer unexpected", tc2.message);
-}
-
-void TestCuTestRun(CuTest* tc)
-{
- CuTest tc2;
- CuTestInit(&tc2, "MyTest", zTestFails);
- CuTestRun(&tc2);
-
- CuAssertStrEquals(tc, "MyTest", tc2.name);
- CuAssertTrue(tc, tc2.failed);
- CuAssertTrue(tc, tc2.ran);
- CompareAsserts(tc, "TestRun failed", "test should fail", tc2.message);
-}
-
-/*-------------------------------------------------------------------------*
- * CuSuite Test
- *-------------------------------------------------------------------------*/
-
-void TestCuSuiteInit(CuTest* tc)
-{
- CuSuite ts;
- CuSuiteInit(&ts);
- CuAssertTrue(tc, ts.count == 0);
- CuAssertTrue(tc, ts.failCount == 0);
-}
-
-void TestCuSuiteNew(CuTest* tc)
-{
- CuSuite* ts = CuSuiteNew();
- CuAssertTrue(tc, ts->count == 0);
- CuAssertTrue(tc, ts->failCount == 0);
-}
-
-void TestCuSuiteAddTest(CuTest* tc)
-{
- CuSuite ts;
- CuTest tc2;
-
- CuSuiteInit(&ts);
- CuTestInit(&tc2, "MyTest", zTestFails);
-
- CuSuiteAdd(&ts, &tc2);
- CuAssertTrue(tc, ts.count == 1);
-
- CuAssertStrEquals(tc, "MyTest", ts.list[0]->name);
-}
-
-void TestCuSuiteAddSuite(CuTest* tc)
-{
- CuSuite* ts1 = CuSuiteNew();
- CuSuite* ts2 = CuSuiteNew();
-
- CuSuiteAdd(ts1, CuTestNew("TestFails1", zTestFails));
- CuSuiteAdd(ts1, CuTestNew("TestFails2", zTestFails));
-
- CuSuiteAdd(ts2, CuTestNew("TestFails3", zTestFails));
- CuSuiteAdd(ts2, CuTestNew("TestFails4", zTestFails));
-
- CuSuiteAddSuite(ts1, ts2);
- CuAssertIntEquals(tc, 4, ts1->count);
-
- CuAssertStrEquals(tc, "TestFails1", ts1->list[0]->name);
- CuAssertStrEquals(tc, "TestFails2", ts1->list[1]->name);
- CuAssertStrEquals(tc, "TestFails3", ts1->list[2]->name);
- CuAssertStrEquals(tc, "TestFails4", ts1->list[3]->name);
-}
-
-void TestCuSuiteRun(CuTest* tc)
-{
- CuSuite ts;
- CuTest tc1, tc2, tc3, tc4;
-
- CuSuiteInit(&ts);
- CuTestInit(&tc1, "TestPasses", TestPasses);
- CuTestInit(&tc2, "TestPasses", TestPasses);
- CuTestInit(&tc3, "TestFails", zTestFails);
- CuTestInit(&tc4, "TestFails", zTestFails);
-
- CuSuiteAdd(&ts, &tc1);
- CuSuiteAdd(&ts, &tc2);
- CuSuiteAdd(&ts, &tc3);
- CuSuiteAdd(&ts, &tc4);
- CuAssertTrue(tc, ts.count == 4);
-
- CuSuiteRun(&ts);
- CuAssertTrue(tc, ts.count - ts.failCount == 2);
- CuAssertTrue(tc, ts.failCount == 2);
-}
-
-void TestCuSuiteSummary(CuTest* tc)
-{
- CuSuite ts;
- CuTest tc1, tc2;
- CuString summary;
-
- CuSuiteInit(&ts);
- CuTestInit(&tc1, "TestPasses", TestPasses);
- CuTestInit(&tc2, "TestFails", zTestFails);
- CuStringInit(&summary);
-
- CuSuiteAdd(&ts, &tc1);
- CuSuiteAdd(&ts, &tc2);
- CuSuiteRun(&ts);
-
- CuSuiteSummary(&ts, &summary);
-
- CuAssertTrue(tc, ts.count == 2);
- CuAssertTrue(tc, ts.failCount == 1);
- CuAssertStrEquals(tc, ".F\n\n", summary.buffer);
-}
-
-
-void TestCuSuiteDetails_SingleFail(CuTest* tc)
-{
- CuSuite ts;
- CuTest tc1, tc2;
- CuString details;
- const char* front;
- const char* back;
-
- CuSuiteInit(&ts);
- CuTestInit(&tc1, "TestPasses", TestPasses);
- CuTestInit(&tc2, "TestFails", zTestFails);
- CuStringInit(&details);
-
- CuSuiteAdd(&ts, &tc1);
- CuSuiteAdd(&ts, &tc2);
- CuSuiteRun(&ts);
-
- CuSuiteDetails(&ts, &details);
-
- CuAssertTrue(tc, ts.count == 2);
- CuAssertTrue(tc, ts.failCount == 1);
-
- front = "There was 1 failure:\n"
- "1) TestFails: ";
- back = "test should fail\n"
- "\n!!!FAILURES!!!\n"
- "Runs: 2 Passes: 1 Fails: 1\n";
-
- CuAssertStrEquals(tc, back, details.buffer + strlen(details.buffer) - strlen(back));
- details.buffer[strlen(front)] = 0;
- CuAssertStrEquals(tc, front, details.buffer);
-}
-
-
-void TestCuSuiteDetails_SinglePass(CuTest* tc)
-{
- CuSuite ts;
- CuTest tc1;
- CuString details;
- const char* expected;
-
- CuSuiteInit(&ts);
- CuTestInit(&tc1, "TestPasses", TestPasses);
- CuStringInit(&details);
-
- CuSuiteAdd(&ts, &tc1);
- CuSuiteRun(&ts);
-
- CuSuiteDetails(&ts, &details);
-
- CuAssertTrue(tc, ts.count == 1);
- CuAssertTrue(tc, ts.failCount == 0);
-
- expected =
- "OK (1 test)\n";
-
- CuAssertStrEquals(tc, expected, details.buffer);
-}
-
-void TestCuSuiteDetails_MultiplePasses(CuTest* tc)
-{
- CuSuite ts;
- CuTest tc1, tc2;
- CuString details;
- const char* expected;
-
- CuSuiteInit(&ts);
- CuTestInit(&tc1, "TestPasses", TestPasses);
- CuTestInit(&tc2, "TestPasses", TestPasses);
- CuStringInit(&details);
-
- CuSuiteAdd(&ts, &tc1);
- CuSuiteAdd(&ts, &tc2);
- CuSuiteRun(&ts);
-
- CuSuiteDetails(&ts, &details);
-
- CuAssertTrue(tc, ts.count == 2);
- CuAssertTrue(tc, ts.failCount == 0);
-
- expected =
- "OK (2 tests)\n";
-
- CuAssertStrEquals(tc, expected, details.buffer);
-}
-
-void TestCuSuiteDetails_MultipleFails(CuTest* tc)
-{
- CuSuite ts;
- CuTest tc1, tc2;
- CuString details;
- const char* front;
- const char* mid;
- const char* back;
-
- CuSuiteInit(&ts);
- CuTestInit(&tc1, "TestFails1", zTestFails);
- CuTestInit(&tc2, "TestFails2", zTestFails);
- CuStringInit(&details);
-
- CuSuiteAdd(&ts, &tc1);
- CuSuiteAdd(&ts, &tc2);
- CuSuiteRun(&ts);
-
- CuSuiteDetails(&ts, &details);
-
- CuAssertTrue(tc, ts.count == 2);
- CuAssertTrue(tc, ts.failCount == 2);
-
- front =
- "There were 2 failures:\n"
- "1) TestFails1: ";
- mid = "test should fail\n"
- "2) TestFails2: ";
- back = "test should fail\n"
- "\n!!!FAILURES!!!\n"
- "Runs: 2 Passes: 0 Fails: 2\n";
-
- CuAssertStrEquals(tc, back, details.buffer + strlen(details.buffer) - strlen(back));
- CuAssert(tc, "Couldn't find middle", strstr(details.buffer, mid) != NULL);
- details.buffer[strlen(front)] = 0;
- CuAssertStrEquals(tc, front, details.buffer);
-}
-
-
-/*-------------------------------------------------------------------------*
- * Misc Test
- *-------------------------------------------------------------------------*/
-
-void TestCuStrCopy(CuTest* tc)
-{
- const char* old = "hello world";
- const char* newStr = CuStrCopy(old);
- CuAssert(tc, "old is new", strcmp(old, newStr) == 0);
-}
-
-
-void TestCuStringAppendFormat(CuTest* tc)
-{
- int i;
- char* text = CuStrAlloc(301); /* long string */
- CuString* str = CuStringNew();
- for (i = 0 ; i < 300 ; ++i)
- text[i] = 'a';
- text[300] = '\0';
- CuStringAppendFormat(str, "%s", text);
-
- /* buffer limit raised to HUGE_STRING_LEN so no overflow */
-
- CuAssert(tc, "length of str->buffer is 300", 300 == strlen(str->buffer));
-}
-
-void TestFail(CuTest* tc)
-{
- jmp_buf buf;
- int pointReached = 0;
- CuTest* tc2 = CuTestNew("TestFails", zTestFails);
- tc2->jumpBuf = &buf;
- if (setjmp(buf) == 0)
- {
- CuFail(tc2, "hello world");
- pointReached = 1;
- }
- CuAssert(tc, "point was not reached", pointReached == 0);
-}
-
-void TestAssertStrEquals(CuTest* tc)
-{
- jmp_buf buf;
- CuTest *tc2 = CuTestNew("TestAssertStrEquals", zTestFails);
-
- const char* expected = "expected <hello> but was <world>";
- const char *expectedMsg = "some text: expected <hello> but was <world>";
-
- tc2->jumpBuf = &buf;
- if (setjmp(buf) == 0)
- {
- CuAssertStrEquals(tc2, "hello", "world");
- }
- CuAssertTrue(tc, tc2->failed);
- CompareAsserts(tc, "CuAssertStrEquals failed", expected, tc2->message);
- if (setjmp(buf) == 0)
- {
- CuAssertStrEquals_Msg(tc2, "some text", "hello", "world");
- }
- CuAssertTrue(tc, tc2->failed);
- CompareAsserts(tc, "CuAssertStrEquals failed", expectedMsg, tc2->message);
-}
-
-void TestAssertStrEquals_NULL(CuTest* tc)
-{
- jmp_buf buf;
- CuTest *tc2 = CuTestNew("TestAssertStrEquals_NULL", zTestFails);
-
- tc2->jumpBuf = &buf;
- if (setjmp(buf) == 0)
- {
- CuAssertStrEquals(tc2, NULL, NULL);
- }
- CuAssertTrue(tc, !tc2->failed);
- CompareAsserts(tc, "CuAssertStrEquals_NULL failed", NULL, tc2->message);
- if (setjmp(buf) == 0)
- {
- CuAssertStrEquals_Msg(tc2, "some text", NULL, NULL);
- }
- CuAssertTrue(tc, !tc2->failed);
- CompareAsserts(tc, "CuAssertStrEquals_NULL failed", NULL, tc2->message);
-}
-
-void TestAssertStrEquals_FailNULLStr(CuTest* tc)
-{
- jmp_buf buf;
- CuTest *tc2 = CuTestNew("TestAssertStrEquals_FailNULLStr", zTestFails);
-
- const char* expected = "expected <hello> but was <NULL>";
- const char *expectedMsg = "some text: expected <hello> but was <NULL>";
-
- tc2->jumpBuf = &buf;
- if (setjmp(buf) == 0)
- {
- CuAssertStrEquals(tc2, "hello", NULL);
- }
- CuAssertTrue(tc, tc2->failed);
- CompareAsserts(tc, "CuAssertStrEquals_FailNULLStr failed", expected, tc2->message);
- if (setjmp(buf) == 0)
- {
- CuAssertStrEquals_Msg(tc2, "some text", "hello", NULL);
- }
- CuAssertTrue(tc, tc2->failed);
- CompareAsserts(tc, "CuAssertStrEquals_FailNULLStr failed", expectedMsg, tc2->message);
-}
-
-void TestAssertStrEquals_FailStrNULL(CuTest* tc)
-{
- jmp_buf buf;
- CuTest *tc2 = CuTestNew("TestAssertStrEquals_FailStrNULL", zTestFails);
-
- const char* expected = "expected <NULL> but was <hello>";
- const char *expectedMsg = "some text: expected <NULL> but was <hello>";
-
- tc2->jumpBuf = &buf;
- if (setjmp(buf) == 0)
- {
- CuAssertStrEquals(tc2, NULL, "hello");
- }
- CuAssertTrue(tc, tc2->failed);
- CompareAsserts(tc, "CuAssertStrEquals_FailStrNULL failed", expected, tc2->message);
- if (setjmp(buf) == 0)
- {
- CuAssertStrEquals_Msg(tc2, "some text", NULL, "hello");
- }
- CuAssertTrue(tc, tc2->failed);
- CompareAsserts(tc, "CuAssertStrEquals_FailStrNULL failed", expectedMsg, tc2->message);
-}
-
-void TestAssertIntEquals(CuTest* tc)
-{
- jmp_buf buf;
- CuTest *tc2 = CuTestNew("TestAssertIntEquals", zTestFails);
- const char* expected = "expected <42> but was <32>";
- const char* expectedMsg = "some text: expected <42> but was <32>";
- tc2->jumpBuf = &buf;
- if (setjmp(buf) == 0)
- {
- CuAssertIntEquals(tc2, 42, 32);
- }
- CuAssertTrue(tc, tc2->failed);
- CompareAsserts(tc, "CuAssertIntEquals failed", expected, tc2->message);
- if (setjmp(buf) == 0)
- {
- CuAssertIntEquals_Msg(tc2, "some text", 42, 32);
- }
- CuAssertTrue(tc, tc2->failed);
- CompareAsserts(tc, "CuAssertStrEquals failed", expectedMsg, tc2->message);
-}
-
-void TestAssertDblEquals(CuTest* tc)
-{
- jmp_buf buf;
- double x = 3.33;
- double y = 10.0 / 3.0;
- CuTest *tc2 = CuTestNew("TestAssertDblEquals", zTestFails);
- char expected[STRING_MAX];
- char expectedMsg[STRING_MAX];
- sprintf(expected, "expected <%lf> but was <%lf>", x, y);
- sprintf(expectedMsg, "some text: expected <%lf> but was <%lf>", x, y);
-
- CuTestInit(tc2, "TestAssertDblEquals", TestPasses);
-
- CuAssertDblEquals(tc2, x, x, 0.0);
- CuAssertTrue(tc, ! tc2->failed);
- CuAssertTrue(tc, NULL == tc2->message);
-
- CuAssertDblEquals(tc2, x, y, 0.01);
- CuAssertTrue(tc, ! tc2->failed);
- CuAssertTrue(tc, NULL == tc2->message);
-
- tc2->jumpBuf = &buf;
- if (setjmp(buf) == 0)
- {
- CuAssertDblEquals(tc2, x, y, 0.001);
- }
- CuAssertTrue(tc, tc2->failed);
- CompareAsserts(tc, "CuAssertDblEquals failed", expected, tc2->message);
- tc2->jumpBuf = &buf;
- if (setjmp(buf) == 0)
- {
- CuAssertDblEquals_Msg(tc2, "some text", x, y, 0.001);
- }
- CuAssertTrue(tc, tc2->failed);
- CompareAsserts(tc, "CuAssertDblEquals failed", expectedMsg, tc2->message);
-}
-
-/*-------------------------------------------------------------------------*
- * main
- *-------------------------------------------------------------------------*/
-
-CuSuite* CuGetSuite(void)
-{
- CuSuite* suite = CuSuiteNew();
-
- SUITE_ADD_TEST(suite, TestCuStringAppendFormat);
- SUITE_ADD_TEST(suite, TestCuStrCopy);
- SUITE_ADD_TEST(suite, TestFail);
- SUITE_ADD_TEST(suite, TestAssertStrEquals);
- SUITE_ADD_TEST(suite, TestAssertStrEquals_NULL);
- SUITE_ADD_TEST(suite, TestAssertStrEquals_FailStrNULL);
- SUITE_ADD_TEST(suite, TestAssertStrEquals_FailNULLStr);
- SUITE_ADD_TEST(suite, TestAssertIntEquals);
- SUITE_ADD_TEST(suite, TestAssertDblEquals);
-
- SUITE_ADD_TEST(suite, TestCuTestNew);
- SUITE_ADD_TEST(suite, TestCuTestInit);
- SUITE_ADD_TEST(suite, TestCuAssert);
- SUITE_ADD_TEST(suite, TestCuAssertPtrEquals_Success);
- SUITE_ADD_TEST(suite, TestCuAssertPtrEquals_Failure);
- SUITE_ADD_TEST(suite, TestCuAssertPtrNotNull_Success);
- SUITE_ADD_TEST(suite, TestCuAssertPtrNotNull_Failure);
- SUITE_ADD_TEST(suite, TestCuTestRun);
-
- SUITE_ADD_TEST(suite, TestCuSuiteInit);
- SUITE_ADD_TEST(suite, TestCuSuiteNew);
- SUITE_ADD_TEST(suite, TestCuSuiteAddTest);
- SUITE_ADD_TEST(suite, TestCuSuiteAddSuite);
- SUITE_ADD_TEST(suite, TestCuSuiteRun);
- SUITE_ADD_TEST(suite, TestCuSuiteSummary);
- SUITE_ADD_TEST(suite, TestCuSuiteDetails_SingleFail);
- SUITE_ADD_TEST(suite, TestCuSuiteDetails_SinglePass);
- SUITE_ADD_TEST(suite, TestCuSuiteDetails_MultiplePasses);
- SUITE_ADD_TEST(suite, TestCuSuiteDetails_MultipleFails);
-
- return suite;
-}
=====================================
externalTools/cutest/Makefile deleted
=====================================
@@ -1,18 +0,0 @@
-include ../../include.mk
-binPath = ../../bin
-libPath = ../../lib
-
-all : ${libPath}/cuTest.a
-
-clean :
-#Removing test binaries
- rm -f ${libPath}/cuTest.a ${libPath}/CuTest.h
-
-${libPath}/cuTest.a : CuTest.c CuTest.h
- @mkdir -p $(dir $@)
- ${cxx} $(CPPFLAGS) $(CFLAGS) ${cflags} -c CuTest.c
- ar rc cuTest.a *.o
- ranlib cuTest.a
- rm -f *.o
- mv cuTest.a ${libPath}/
- cp CuTest.h ${libPath}/
=====================================
externalTools/cutest/README.txt deleted
=====================================
@@ -1,211 +0,0 @@
-HOW TO USE
-
-You can use CuTest to create unit tests to drive your development
-in the style of Extreme Programming. You can also add unit tests to
-existing code to ensure that it works as you suspect.
-
-Your unit tests are an investment. They let you to change your
-code and add new features confidently without worrying about
-accidentally breaking earlier features.
-
-
-LICENSING
-
-For details on licensing see license.txt.
-
-
-GETTING STARTED
-
-To add unit testing to your C code the only files you need are
-CuTest.c and CuTest.h.
-
-CuTestTest.c and AllTests.c have been included to provide an
-example of how to write unit tests and then how to aggregate them
-into suites and into a single AllTests.c file. Suites allow you
-to put group tests into logical sets. AllTests.c combines all the
-suites and runs them.
-
-You should not have to look inside CuTest.c. Looking in
-CuTestTest.c and AllTests.c (for example usage) should be
-sufficient.
-
-After downloading the sources, run your compiler to create an
-executable called AllTests.exe. For example, if you are using
-Windows with the cl.exe compiler you would type:
-
- cl.exe AllTests.c CuTest.c CuTestTest.c
- AllTests.exe
-
-This will run all the unit tests associated with CuTest and print
-the output on the console. You can replace cl.exe with gcc or
-your favorite compiler in the command above.
-
-
-DETAILED EXAMPLE
-
-Here is a more detailed example. We will work through a simple
-test first exercise. The goal is to create a library of string
-utilities. First, lets write a function that converts a
-null-terminated string to all upper case.
-
-Ensure that CuTest.c and CuTest.h are accessible from your C
-project. Next, create a file called StrUtil.c with these
-contents:
-
- #include "CuTest.h"
-
- char* StrToUpper(char* str) {
- return str;
- }
-
- void TestStrToUpper(CuTest *tc) {
- char* input = strdup("hello world");
- char* actual = StrToUpper(input);
- char* expected = "HELLO WORLD";
- CuAssertStrEquals(tc, expected, actual);
- }
-
- CuSuite* StrUtilGetSuite() {
- CuSuite* suite = CuSuiteNew();
- SUITE_ADD_TEST(suite, TestStrToUpper);
- return suite;
- }
-
-Create another file called AllTests.c with these contents:
-
- #include "CuTest.h"
-
- CuSuite* StrUtilGetSuite();
-
- void RunAllTests(void) {
- CuString *output = CuStringNew();
- CuSuite* suite = CuSuiteNew();
-
- CuSuiteAddSuite(suite, StrUtilGetSuite());
-
- CuSuiteRun(suite);
- CuSuiteSummary(suite, output);
- CuSuiteDetails(suite, output);
- printf("%s\n", output->buffer);
- }
-
- int main(void) {
- RunAllTests();
- }
-
-Then type this on the command line:
-
- gcc AllTests.c CuTest.c StrUtil.c
-
-to compile. You can replace gcc with your favorite compiler.
-CuTest should be portable enough to handle all Windows and Unix
-compilers. Then to run the tests type:
-
- a.out
-
-This will print an error because we haven't implemented the
-StrToUpper function correctly. We are just returning the string
-without changing it to upper case.
-
- char* StrToUpper(char* str) {
- return str;
- }
-
-Rewrite this as follows:
-
- char* StrToUpper(char* str) {
- char* p;
- for (p = str ; *p ; ++p) *p = toupper(*p);
- return str;
- }
-
-Recompile and run the tests again. The test should pass this
-time.
-
-
-WHAT TO DO NEXT
-
-At this point you might want to write more tests for the
-StrToUpper function. Here are some ideas:
-
-TestStrToUpper_EmptyString : pass in ""
-TestStrToUpper_UpperCase : pass in "HELLO WORLD"
-TestStrToUpper_MixedCase : pass in "HELLO world"
-TestStrToUpper_Numbers : pass in "1234 hello"
-
-As you write each one of these tests add it to StrUtilGetSuite
-function. If you don't the tests won't be run. Later as you write
-other functions and write tests for them be sure to include those
-in StrUtilGetSuite also. The StrUtilGetSuite function should
-include all the tests in StrUtil.c
-
-Over time you will create another file called FunkyStuff.c
-containing other functions unrelated to StrUtil. Follow the same
-pattern. Create a FunkyStuffGetSuite function in FunkyStuff.c.
-And add FunkyStuffGetSuite to AllTests.c.
-
-The framework is designed in the way it is so that it is easy to
-organize a lot of tests.
-
-THE BIG PICTURE
-
-Each individual test corresponds to a CuTest. These are grouped
-to form a CuSuite. CuSuites can hold CuTests or other CuSuites.
-AllTests.c collects all the CuSuites in the program into a single
-CuSuite which it then runs as a single CuSuite.
-
-The project is open source so feel free to take a peek under the
-hood at the CuTest.c file to see how it works. CuTestTest.c
-contains tests for CuTest.c. So CuTest tests itself.
-
-Since AllTests.c has a main() you will need to exclude this when
-you are building your product. Here is a nicer way to do this if
-you want to avoid messing with multiple builds. Remove the main()
-in AllTests.c. Note that it just calls RunAllTests(). Instead
-we'll call this directly from the main program.
-
-Now in the main() of the actual program check to see if the
-command line option "--test" was passed. If it was then I call
-RunAllTests() from AllTests.c. Otherwise run the real program.
-
-Shipping the tests with the code can be useful. If you customers
-complain about a problem you can ask them to run the unit tests
-and send you the output. This can help you to quickly isolate the
-piece of your system that is malfunctioning in the customer's
-environment.
-
-CuTest offers a rich set of CuAssert functions. Here is a list:
-
-void CuAssert(CuTest* tc, char* message, int condition);
-void CuAssertTrue(CuTest* tc, int condition);
-void CuAssertStrEquals(CuTest* tc, char* expected, char* actual);
-void CuAssertIntEquals(CuTest* tc, int expected, int actual);
-void CuAssertPtrEquals(CuTest* tc, void* expected, void* actual);
-void CuAssertPtrNotNull(CuTest* tc, void* pointer);
-
-The project is open source and so you can add other more powerful
-asserts to make your tests easier to write and more concise.
-Please feel free to send me changes you make so that I can
-incorporate them into future releases.
-
-If you see any errors in this document please contact me at
-asimjalis at peakprogramming.com.
-
-
-AUTOMATING TEST SUITE GENERATION
-
-make-tests.sh will grep through all the .c files in the current
-directory and generate the code to run all the tests contained in
-them. Using this script you don't have to worry about writing
-AllTests.c or dealing with any of the other suite code.
-
-
-CREDITS
-
-These people have contributed useful code changes to the CuTest project.
-Thanks!
-
-- [02.23.2003] Dave Glowacki <dglo at hyde.ssec.wisc.edu>
-- [04.17.2009] Tobias Lippert <herrmarder at googlemail.com>
-- [11.13.2009] Eli Bendersky <eliben at gmail.com>
-- [12.14.2009] Andrew Brown <abrown at datasci.com>
=====================================
externalTools/cutest/index.html deleted
=====================================
@@ -1,196 +0,0 @@
-<html>
-
-<link href="style.css" rel="stylesheet" type="text/css">
-
-<head>
-<title>CuTest: The Cutest C Unit Testing Framework</title>
-</head>
-
-<BODY>
-
-<script type="text/javascript"><!--
-google_ad_client = "pub-6301376840682363";
-google_ad_width = 728;
-google_ad_height = 90;
-google_ad_format = "728x90_as";
-google_ad_channel ="3703387138";
-google_color_border = "CCCCCC";
-google_color_bg = "FFFFFF";
-google_color_link = "000000";
-google_color_url = "666666";
-google_color_text = "333333";
-//--></script>
-<script type="text/javascript"
- src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
-</script>
-
-<br>
-<br>
-<HR>
-<FONT SIZE="-1">
-[
- <A HREF="http://sourceforge.net/project/showfiles.php?group_id=52240">Download Now</A>
-| <A HREF="http://sourceforge.net/project/stats/?group_id=52240&ugn=cutest">Download Statistics</A>
-| <A HREF="http://sourceforge.net/cvs/?group_id=52240">Browse Source</A>
-| <A HREF="http://sourceforge.net/projects/cutest">SourceForge</A>
-| <A HREF="http://asimjalis.blogspot.com">Blog</A>
-| <A HREF="mailto:asimjalis(nospam)gmail.com">asimjalis(nospam)gmail.com</A>
-]
-</FONT>
-<HR>
-
-
-<H1>CuTest: C Unit Testing Framework</H1>
-
-
-<h2>Overview</h2>
-
-CuTest is a unit testing library for the C language. It can be
-used to do Extreme Programming and Test-First Development in the
-C language. It's a fun and cute library that will make your
-programming fun and productive.
-
-<h2>Benefits</h2>
-
-<ul>
-
-<li> Lower Defects. The tests ensure that your code keeps working
-as you make small changes in it.
-
-<li> Faster Debugging. The tests tell you which subroutine is
-broken. You avoid spending hours trying to figure out what's
-broken.
-
-<li> Development Speed. You trust your old code and can keep
-adding to it without worrying about bad interactions. If there is
-a bad interaction the tests will catch it.
-
-<li> Permanent Bug Fixes. If every time a bug is reported you
-write a quick test, you will guarantee that the bug never
-reappears again.
-
-<li> Fun. As your bug count drops you will begin to enjoy
-programming like you've never done before. Running the tests
-every few minutes and seeing them pass feels good.
-
-</ul>
-
-<h2> Features </h2>
-
-<ul>
-
-<li> Small. Consists of a single .c and .h file.
-
-<li> Easy to Deploy. Just drop the two files into your source
-tree.
-
-<li> Highly Portable. Works with all major compilers on Windows
-(Microsoft, Borland), Linux, Unix, PalmOS.
-
-<li> Open Source. You can extend it to add more functionality.
-The source can be invaluable if you are trying to trace a test
-failure.
-
-<li> Cuteness. Of all the testing frameworks CuTest has the
-cutest name :-)
-
-</ul>
-
-
-<h2>Licensing</h2>
-
-CuTest is distributed under the <a
-href="http://www.opensource.org/licenses/zlib-license.html">zlib/libpng
-license</a>. See license.txt in the distribution for text of license. The
-intent of the license is to:
-
-<ul>
-
-<li> Keep the license as simple as possible
-<li> Encourage the use of CuTest in both free and commercial applications and libraries
-<li> Keep the source code together
-<li> Give credit to the CuTest contributors for their work
-
-</ul>
-
-If you find CuTest useful we would like to hear about it.
-
-
-<h2>Getting Started</h2>
-
-<p> For a detailed tutorial see README in the distribution. This shows you how
-to organize your tests and how to autogenerate the AllTests.c file from your
-source files.
-
-<p> To add unit testing to your C code the only files you need
-are CuTest.c and CuTest.h.
-
-<p> CuTestTest.c and AllTests.c have been included to provide an
-example of how to write unit tests and then how to aggregate them
-into suites and into a single AllTests.c file. Suites allow you
-to put unit tests for different parts of your code in different
-files. AllTests.c combines all the suites and runs them.
-
-<p> You should not have to look inside CuTest.c. Looking in
-CuTestTest.c (for example usage) should be sufficient.
-
-<p> After downloading the sources, run your compiler to create an
-executable called AllTests.exe. For example, if you are using
-Windows you would type:
-
-<PRE CLASS="CONSOLE">
-cl AllTests.c CuTest.c CuTestTest.c
-AllTests.exe
-</PRE>
-
-<p> This will run all the unit tests associated with CuTest and
-print the output on the console.
-
-<p> For more details on how to use the library look at the README file included
-with the distribution.
-
-<h2>Contribute</h2>
-
-<p> We hope you CuTest saves you time and helps you produce high quality
-software.
-
-<p> If you find CuTest useful, let us know. Tell us what platform you are using
-it on (Windows, Linux, etc), and what kinds of applications you are using it
-with.
-
-<p> If you would like to contribute documentation or tutorials to this project
-please send e-mail.
-
-<br>
-<br>
-
-<hr>
-<font size="-1">
-Copyright © 2002-2003, Asim Jalis (<a
-href="mailto:asimjalis(nospam)gmail.com">asimjalis(nospam)gmail.com</a>).
-All rights reserved.
-</font>
-
-<SCRIPT language="JavaScript">
-<!--
- var re = /\(nospam\)/ig;
- var str;
-
- for(i = 0;i < document.links.length;i++)
- {
- str = "" + document.links(i).href;
- if(str.search(re) != -1)
- document.links(i).href = str.replace(re, "@");
-
- str = "" + document.links(i).innerHTML;
- if(str.search(re) != -1)
- document.links(i).innerHTML = str.replace(re, "@");
- }
--->
-</SCRIPT>
-
-<p>
-<a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=52240&type=1" width="88" height="31" border="0" alt="SourceForge.net Logo"></a>
-
-</BODY>
-</HTML>
=====================================
externalTools/cutest/license.txt deleted
=====================================
@@ -1,38 +0,0 @@
-NOTE
-
-The license is based on the zlib/libpng license. For more details see
-http://www.opensource.org/licenses/zlib-license.html. The intent of the
-license is to:
-
-- keep the license as simple as possible
-- encourage the use of CuTest in both free and commercial applications
- and libraries
-- keep the source code together
-- give credit to the CuTest contributors for their work
-
-If you ship CuTest in source form with your source distribution, the
-following license document must be included with it in unaltered form.
-If you find CuTest useful we would like to hear about it.
-
-LICENSE
-
-Copyright (c) 2003 Asim Jalis
-
-This software is provided 'as-is', without any express or implied
-warranty. In no event will the authors be held liable for any damages
-arising from the use of this software.
-
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it
-freely, subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not
-claim that you wrote the original software. If you use this software in
-a product, an acknowledgment in the product documentation would be
-appreciated but is not required.
-
-2. Altered source versions must be plainly marked as such, and must not
-be misrepresented as being the original software.
-
-3. This notice may not be removed or altered from any source
-distribution.
=====================================
externalTools/cutest/make-tests.sh deleted
=====================================
@@ -1,55 +0,0 @@
-#!/usr/bin/env bash
-
-# Auto generate single AllTests file for CuTest.
-# Searches through all *.c files in the current directory.
-# Prints to stdout.
-# Author: Asim Jalis
-# Date: 01/08/2003
-
-if test $# -eq 0 ; then FILES=*.c ; else FILES=$* ; fi
-
-echo '
-
-/* This is auto-generated code. Edit at your own peril. */
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "CuTest.h"
-
-'
-
-cat $FILES | grep '^void Test' |
- sed -e 's/(.*$//' \
- -e 's/$/(CuTest*);/' \
- -e 's/^/extern /'
-
-echo \
-'
-
-void RunAllTests(void)
-{
- CuString *output = CuStringNew();
- CuSuite* suite = CuSuiteNew();
-
-'
-cat $FILES | grep '^void Test' |
- sed -e 's/^void //' \
- -e 's/(.*$//' \
- -e 's/^/ SUITE_ADD_TEST(suite, /' \
- -e 's/$/);/'
-
-echo \
-'
- CuSuiteRun(suite);
- CuSuiteSummary(suite, output);
- CuSuiteDetails(suite, output);
- printf("%s\n", output->buffer);
- CuStringDelete(output);
- CuSuiteDelete(suite);
-}
-
-int main(void)
-{
- RunAllTests();
-}
-'
=====================================
externalTools/cutest/style.css deleted
=====================================
@@ -1,21 +0,0 @@
-BODY {
- font-family: "Verdana,Arial,sans-serif";
- font-size: 10pt;
-}
-PRE.LIST {
- background: #CFD9FF;
- border: 1ex solid #AAAAE6;
- padding: 1ex;
-}
-
-PRE.SNIP {
- background: #CFD9FF;
- padding: 1ex;
-}
-
-PRE.CONSOLE {
- color: #CCCCCC;
- background: #000000;
- font-family: "Courier New,Courier";
- padding: 1ex;
-}
View it on GitLab: https://salsa.debian.org/med-team/libsonlib/-/compare/4cff4b3b26ddba19530486f76f67a3eb3b1fcb15...998127c92b22e28e7e314e173d7897dbcf7d4f8a
--
View it on GitLab: https://salsa.debian.org/med-team/libsonlib/-/compare/4cff4b3b26ddba19530486f76f67a3eb3b1fcb15...998127c92b22e28e7e314e173d7897dbcf7d4f8a
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20261102/3ffecb91/attachment-0001.htm>
More information about the debian-med-commit
mailing list