diff options
author | kripken <alonzakai@gmail.com> | 2011-07-03 22:16:19 -0700 |
---|---|---|
committer | kripken <alonzakai@gmail.com> | 2011-07-03 22:16:19 -0700 |
commit | 39b1dca3a0263549a259e1da88c10b9b3ea4ce13 (patch) | |
tree | 7eb9779fc610c0b76d14ea4dc68408a771b5a68e /tests/runner.py | |
parent | 4e9d7978c6cdcc6eba29e372b763343f1bb4a1ff (diff) | |
parent | 6390aaff2001afd7cdabd84cdaa141a4fba96b4d (diff) |
Merge pull request #43 from max99x/master
More library functions
Diffstat (limited to 'tests/runner.py')
-rw-r--r-- | tests/runner.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/runner.py b/tests/runner.py index 85a27a32..88a79c73 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -1640,6 +1640,12 @@ if 'benchmark' not in sys.argv: ''' self.do_test(src, '*1,2,3,5,5,6*\n*stdin==0:0*\n*%*\n*5*\n*66.0*\n*cleaned*') + def test_time(self): + src = open(path_from_root('tests', 'time', 'src.c'), 'r').read() + expected = open(path_from_root('tests', 'time', 'output.txt'), 'r').read() + self.do_test(src, expected) + + def test_statics(self): # static initializers save i16 but load i8 for some reason global COMPILER_TEST_OPTS; COMPILER_TEST_OPTS = ['-g'] @@ -1825,7 +1831,7 @@ if 'benchmark' not in sys.argv: filename = os.path.join(dirname, 'liblib.cpp') BUILD_AS_SHARED_LIB = 1 self.build(lib_src, dirname, filename) - shutil.move(filename + '.o.js', os.path.join(dirname, 'liblib.so.js')) + shutil.move(filename + '.o.js', os.path.join(dirname, 'liblib.so')) src = ''' #include <cstdio> @@ -1870,7 +1876,7 @@ if 'benchmark' not in sys.argv: BUILD_AS_SHARED_LIB = 1 EXPORTED_FUNCTIONS = ['__Z7get_cmpv'] self.build(lib_src, dirname, filename) - shutil.move(filename + '.o.js', os.path.join(dirname, 'liblib.so.js')) + shutil.move(filename + '.o.js', os.path.join(dirname, 'liblib.so')) src = ''' #include <stdio.h> @@ -1960,7 +1966,7 @@ if 'benchmark' not in sys.argv: EXPORTED_FUNCTIONS = ['__Z4funciPFvvE'] EXPORTED_GLOBALS = ['_global'] self.build(lib_src, dirname, filename) - shutil.move(filename + '.o.js', os.path.join(dirname, 'liblib.so.js')) + shutil.move(filename + '.o.js', os.path.join(dirname, 'liblib.so')) src = ''' #include <stdio.h> @@ -2477,7 +2483,7 @@ if 'benchmark' not in sys.argv: global EXPORTED_FUNCTIONS; EXPORTED_FUNCTIONS = ['_main', '_PyRun_SimpleStringFlags'] # for the demo self.do_ll_test(path_from_root('tests', 'python', 'python.ll'), - 'hello python world!\n[0, 2, 4, 6]\n5\n22\n5.470', + 'hello python world!\n[0, 2, 4, 6]\n5\n22\n5.470000', args=['-S', '-c' '''print "hello python world!"; print [x*2 for x in range(4)]; t=2; print 10-3-t; print (lambda x: x*2)(11); print '%f' % 5.47''']) ### Test cases in separate files |