def fail(self, msg=None):
        self.tests_failed += 1

        if not msg:
            msg = "assertion failed"

        title = "<b>" + self.getNameFmt("Test failed") + "</b>"
        writebr(title + msg)
        return False
Esempio n. 2
0
	def fail(self, msg=None):
		self.tests_failed+=1
		
		if not msg:
			msg="assertion failed"

		title="<b>" + self.getNameFmt("Test failed") + "</b>"
		writebr(title + msg)
		return False
Esempio n. 3
0
 def testLoop4(self):
     t1 = t0 = time.time()
     n = 100
     m = 0.0
     while t1 - t0 == 0:
         m += 1.0
         for i in range(n):
             long_fib(10L)
         t1 = time.time()
     dt = t1 - t0
     writebr("Loop4 (long): %.2f/sec" % (n*m/dt))
Esempio n. 4
0
 def testLoop3(self):
     t1 = t0 = time.time()
     n = 100
     m = 0.0
     while t1 - t0 == 0:
         m += 1.0
         for i in range(n):
             int_fib(10)
         t1 = time.time()
     dt = t1 - t0
     writebr("Loop3 (int): %.2f/sec" % (n*m/dt))
Esempio n. 5
0
 def testLoop4(self):
     t1 = t0 = time.time()
     n = 100
     m = 0.0
     while t1 - t0 == 0:
         m += 1.0
         for i in range(n):
             long_fib(10L)
         t1 = time.time()
     dt = t1 - t0
     writebr("Loop4 (long): %.2f/sec" % (n * m / dt))
Esempio n. 6
0
 def testLoop3(self):
     t1 = t0 = time.time()
     n = 100
     m = 0.0
     while t1 - t0 == 0:
         m += 1.0
         for i in range(n):
             int_fib(10)
         t1 = time.time()
     dt = t1 - t0
     writebr("Loop3 (int): %.2f/sec" % (n * m / dt))
Esempio n. 7
0
	def fail(self, msg=None):
		self.tests_failed+=1
		
		if not msg:
			msg="assertion failed"

		title="<b>" + self.getNameFmt("Test failed") + "</b>"
		writebr(title + msg)
		if console:
			console.error(msg)
			console.trace()
		return False
Esempio n. 8
0
 def testLoop1(self):
     t1 = t0 = time.time()
     n = 1000
     a = A(1)
     m = 0;
     while t1 - t0 == 0:
         m += 1
         for i in range(n):
             x = a.getX()
         t1 = time.time()
     dt = t1 - t0
     writebr("Loop1: %.2f/sec" % (n*m/dt))
Esempio n. 9
0
 def testLoop1(self):
     t1 = t0 = time.time()
     n = 1000
     a = A(1)
     m = 0
     while t1 - t0 == 0:
         m += 1
         for i in range(n):
             x = a.getX()
         t1 = time.time()
     dt = t1 - t0
     writebr("Loop1: %.2f/sec" % (n * m / dt))
Esempio n. 10
0
    def fail(self, msg=None):
        self.startTest()
        self.tests_failed+=1

        if not msg:
            msg="assertion failed"
        else:
            msg = str(msg)

        title="<b>" + self.getNameFmt("Test failed") + "</b>"
        writebr(title + msg)
        if sys.platform in ['mozilla', 'ie6', 'opera', 'oldmoz', 'safari']:
            from __pyjamas__ import JS
            JS("""if (typeof @{{!console}} != 'undefined') {
                if (typeof @{{!console}}.error == 'function') @{{!console}}.error(@{{msg}});
                if (typeof @{{!console}}.trace == 'function') @{{!console}}.trace();
            }""")
        return False