diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-12-18 07:59:06 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-12-18 07:59:06 -0800 |
commit | 56b65a54cb92d2d4a34535f71dbae08d758d3fc3 (patch) | |
tree | 0220d27388eab38587a8fd12140552e0ce513435 /tests/runner.py | |
parent | e77d99dac0b1ba58c773b4b8c7d8a223ad008624 (diff) | |
parent | 47bc8ba2c47c67d8824c2b7bf35195a079cbed7c (diff) |
Merge branch 'incoming'
Diffstat (limited to 'tests/runner.py')
-rw-r--r-- | tests/runner.py | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/tests/runner.py b/tests/runner.py index 9224cb4b..e62e7681 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -1964,8 +1964,8 @@ if 'benchmark' not in str(sys.argv): main_name = os.path.join(self.get_dir(), 'main.cpp') open(main_name, 'w').write(main) - Building.emmaken(supp_name) - Building.emmaken(main_name) + Building.emcc(supp_name) + Building.emcc(main_name) all_name = os.path.join(self.get_dir(), 'all.bc') Building.link([supp_name + '.o', main_name + '.o'], all_name) @@ -3482,12 +3482,12 @@ at function.:blag int main() { - std::cout << "hello world"; + std::cout << "hello world" << std::endl << 77 << "." << std::endl; return 0; } ''' - self.do_run(src, 'hello world') + self.do_run(src, 'hello world\n77.\n') def test_stdvec(self): src = ''' @@ -3564,9 +3564,9 @@ at function.:blag # emcc should build in dlmalloc automatically, and do all the sign correction etc. for it try_delete(os.path.join(self.get_dir(), 'src.cpp.o.js')) - # XXX find out why we fail without TOTAL_MEMORY here. that should not happen! - output = Popen([EMCC, '-g', '-s', 'TOTAL_MEMORY=104857600', path_from_root('tests', 'dlmalloc_test.c'), + output = Popen([EMCC, path_from_root('tests', 'dlmalloc_test.c'), '-o', os.path.join(self.get_dir(), 'src.cpp.o.js')], stdout=PIPE, stderr=PIPE).communicate() + #print output self.do_run('x', '*1,0*', ['200', '1'], no_build=True) self.do_run('x', '*400,0*', ['400', '400'], no_build=True) @@ -3782,7 +3782,7 @@ at function.:blag freetype = self.get_freetype() poppler = self.get_library('poppler', - [os.path.join('poppler', '.libs', 'libpoppler.so.13.0.0.bc'), + [os.path.join('poppler', '.libs', 'libpoppler.so.13.0.0'), os.path.join('goo', '.libs', 'libgoo.a.bc'), os.path.join('fofi', '.libs', 'libfofi.a.bc'), os.path.join('splash', '.libs', 'libsplash.a.bc'), @@ -3825,7 +3825,7 @@ at function.:blag shutil.copy(path_from_root('tests', 'openjpeg', 'opj_config.h'), self.get_dir()) lib = self.get_library('openjpeg', - [os.path.join('bin', 'libopenjpeg.so.1.4.0.bc'), + [os.path.join('bin', 'libopenjpeg.so.1.4.0'), os.path.sep.join('codec/CMakeFiles/j2k_to_image.dir/index.c.o'.split('/')), os.path.sep.join('codec/CMakeFiles/j2k_to_image.dir/convert.c.o'.split('/')), os.path.sep.join('codec/CMakeFiles/j2k_to_image.dir/__/common/color.c.o'.split('/')), @@ -4484,8 +4484,8 @@ Child2:9 main_name = os.path.join(self.get_dir(), 'main.cpp') open(main_name, 'w').write(main) - Building.emmaken(module_name, ['-g']) - Building.emmaken(main_name, ['-g']) + Building.emcc(module_name, ['-g']) + Building.emcc(main_name, ['-g']) all_name = os.path.join(self.get_dir(), 'all.bc') Building.link([module_name + '.o', main_name + '.o'], all_name) @@ -4889,11 +4889,6 @@ TT = %s del T # T is just a shape for the specific subclasses, we don't test it itself class other(RunnerCore): - def test_reminder(self): - raise Exception('''Fix emmaken.py and emconfiguren.py, they should work but mention they are deprecated - Test emconfigure - configure in test_zlib looks broken''') - def test_emcc(self): def clear(): for name in os.listdir(self.get_dir()): @@ -4939,6 +4934,13 @@ Options that are modified or new in %s include: assert os.path.exists(target), 'Expected %s to exist since args are %s : %s' % (target, str(args), '\n'.join(output)) self.assertContained('hello, world!', self.run_llvm_interpreter([target])) + # emcc src.ll ==> generates .js + clear() + output = Popen([compiler, path_from_root('tests', 'hello_world.ll')], stdout=PIPE, stderr=PIPE).communicate() + assert len(output[0]) == 0, output[0] + assert os.path.exists('a.out.js'), '\n'.join(output) + self.assertContained('hello, world!', run_js('a.out.js')) + # dlmalloc. dlmalloc is special in that it is the only part of libc that is (1) hard to write well, and # very speed-sensitive. So we do not implement it in JS in library.js, instead we compile it from source for source, has_malloc in [('hello_world' + suffix, False), ('hello_malloc.cpp', True)]: @@ -5057,12 +5059,11 @@ Options that are modified or new in %s include: assert os.path.exists('combined.bc'), '\n'.join(output) self.assertContained('side got: hello from main, over', self.run_llvm_interpreter(['combined.bc'])) - # TODO: compile .ll inputs to emcc into .bc # TODO: test normal project linking, static and dynamic: get_library should not need to be told what to link! # TODO: when ready, switch tools/shared building to use emcc over emmaken # TODO: when this is done, more test runner to test these (i.e., test all -Ox thoroughly) # TODO: emscripten tutorial with emcc - # TODO: deprecate llvm optimizations etc. in emscripten.py. + # TODO: deprecate llvm optimizations, dlmalloc, etc. in emscripten.py. # Finally, do some web browser tests def run_browser(html_file, message): @@ -5147,8 +5148,14 @@ else: Building.COMPILER = CLANG - # Pick the JS engine to benchmark - JS_ENGINE = JS_ENGINES[1] + # Pick the JS engine to benchmark. If you specify one, it will be picked. For example, python tests/runner.py benchmark SPIDERMONKEY_ENGINE + JS_ENGINE = JS_ENGINES[0] + for i in range(1, len(sys.argv)): + arg = sys.argv[i] + if not arg.startswith('test_'): + JS_ENGINE = eval(arg) + sys.argv[i] = None + sys.argv = filter(lambda arg: arg is not None, sys.argv) print 'Benchmarking JS engine:', JS_ENGINE Building.COMPILER_TEST_OPTS = [] |