Beispiel #1
0
def runClasses(*testclass):
    '''
    Testrunner which
    '''
    core = JUnitCore()
    core.addListener(Reporter())
    result = core.run(testclass)
    n = result.getFailureCount()
    if n:
        print
        print "There were %s failures:\n" % n
        for i, F in enumerate(result.getFailures()):
            exc = F.getException()
            try:
                file, line, funcName, lineContent = traceback.extract_tb(
                    exc.traceback)[0]
                print "   %s) %s" % (i + 1, F.getDescription())
                print
                print "      %s" % '      '.join(
                    [s for s in str(exc.cause).split("\n") if s])
                print "      ..."
                print "      " + lineContent
                print "      ..."
                print "      at %s : %s" % (file, line)
                print
                print
            except AttributeError:
                print exc
def runClasses(*testclass):
    """
    Testrunner which
    """
    core = JUnitCore()
    core.addListener(Reporter())
    result = core.run(testclass)
    n = result.getFailureCount()
    if n:
        print
        print "There were %s failures:\n" % n
        for i, F in enumerate(result.getFailures()):
            exc = F.getException()
            try:
                file, line, funcName, lineContent = traceback.extract_tb(exc.traceback)[0]
                print "   %s) %s" % (i + 1, F.getDescription())
                print
                print "      %s" % "      ".join([s for s in str(exc.cause).split("\n") if s])
                print "      ..."
                print "      " + lineContent
                print "      ..."
                print "      at %s : %s" % (file, line)
                print
                print
            except AttributeError:
                print exc
Beispiel #3
0
    def run_junit(self):
        result = JUnitCore.runClasses(list(self.get_test_classes()))
        print "Ran {} tests in {}s, failures: {}".format(result.runCount, result.runTime, result.failureCount)

        if result.failures:
            print "Failures:"
            for failure in result.failures:
                print failure
Beispiel #4
0
    def run_junit(self):
        result = JUnitCore.runClasses(list(self.get_test_classes()))
        print "Ran {} tests in {}s, failures: {}".format(
            result.runCount, result.runTime, result.failureCount)

        if result.failures:
            print "Failures:"
            for failure in result.failures:
                print failure
Beispiel #5
0
		'71yAAeastmost.labels.points',
		'71yAAeastmost.labels',
		'c005BA.labels',
		'181y-12bit-aaarrg-dark-detail-reduced.tif',
		'181y-12bit-aaarrg-mid-detail-reduced.tif',
		'181y-12bit-aaarrg-bright-reduced.tif',
		'tidied-mhl-62yxUAS-lacZ0-reduced.tif.points.R',
		'c061AG-small-section-z-max.tif',
		'c061AG-small-section.tif'):
	destination = os.path.join(images_dir, filename)
	url = 'http://fiji.sc/test-data/' + urllib.quote(filename)
	if not os.path.exists(destination):
		print 'Downloading', filename
		urllib.urlretrieve(url, destination)

if realpath(os.getcwd()) != realpath(ij_dir):
    print >> sys.stderr, "The tests must be run from", realpath(ij_dir)
    sys.exit(1)

from org.junit.runner import JUnitCore

JUnitCore.main(['math3d.TestEigenvalueDecompositions', \
               'distance.TestMutualInformation', \
               'distance.TestEuclidean', \
               'distance.TestCorrelation', \
               'landmarks.TestLoading', \
               'util.TestPenalty', \
               'vib.TestFastMatrix', \
               'tracing.Test2DTracing', \
               'tracing.Test3DTracing'])