aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-09-11 12:51:45 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-09-11 12:51:45 -0700
commit4e5b7857ca11b2576e0aad58cfca338a9a2d9a8f (patch)
tree4f793a087092df15d06e80d85ddcb90784be2818
parent83ec41b14fa6de59a4dda19cc200546367c1d124 (diff)
parent16c04387f8072ba8db2a444237091f6dbfccd00a (diff)
Merge pull request #1610 from juj/fix_bullet
Fix bullet
-rw-r--r--tests/test_core.py59
1 files changed, 37 insertions, 22 deletions
diff --git a/tests/test_core.py b/tests/test_core.py
index d38a4da3..6bccbbf4 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -8641,29 +8641,44 @@ def process(filename):
Settings.SAFE_HEAP_LINES = ['btVoronoiSimplexSolver.h:40', 'btVoronoiSimplexSolver.h:41',
'btVoronoiSimplexSolver.h:42', 'btVoronoiSimplexSolver.h:43']
- def test():
- self.do_run(open(path_from_root('tests', 'bullet', 'Demos', 'HelloWorld', 'HelloWorld.cpp'), 'r').read(),
- [open(path_from_root('tests', 'bullet', 'output.txt'), 'r').read(), # different roundings
- open(path_from_root('tests', 'bullet', 'output2.txt'), 'r').read(),
- open(path_from_root('tests', 'bullet', 'output3.txt'), 'r').read()],
- libraries=self.get_library('bullet', [os.path.join('src', '.libs', 'libBulletDynamics.a'),
- os.path.join('src', '.libs', 'libBulletCollision.a'),
- os.path.join('src', '.libs', 'libLinearMath.a')],
- configure_args=['--disable-demos','--disable-dependency-tracking']),
- includes=[path_from_root('tests', 'bullet', 'src')])
- test()
-
- assert 'asm2g' in test_modes
- if self.run_name == 'asm2g':
- # Test forced alignment
- print >> sys.stderr, 'testing FORCE_ALIGNED_MEMORY'
- old = open('src.cpp.o.js').read()
- Settings.FORCE_ALIGNED_MEMORY = 1
+ configure_commands = [['sh', './configure'], ['cmake', '.']]
+ configure_args = [['--disable-demos','--disable-dependency-tracking'], ['-DBUILD_DEMOS=OFF', '-DBUILD_EXTRAS=OFF']]
+ for c in range(0,2):
+ configure = configure_commands[c]
+ # Windows cannot run configure sh scripts.
+ if WINDOWS and configure[0] == 'sh':
+ continue
+
+ # Depending on whether 'configure' or 'cmake' is used to build, Bullet places output files in different directory structures.
+ if configure[0] == 'sh':
+ generated_libs = [os.path.join('src', '.libs', 'libBulletDynamics.a'),
+ os.path.join('src', '.libs', 'libBulletCollision.a'),
+ os.path.join('src', '.libs', 'libLinearMath.a')]
+ else:
+ generated_libs = [os.path.join('src', 'BulletDynamics', 'libBulletDynamics.a'),
+ os.path.join('src', 'BulletCollision', 'libBulletCollision.a'),
+ os.path.join('src', 'LinearMath', 'libLinearMath.a')]
+
+ def test():
+ self.do_run(open(path_from_root('tests', 'bullet', 'Demos', 'HelloWorld', 'HelloWorld.cpp'), 'r').read(),
+ [open(path_from_root('tests', 'bullet', 'output.txt'), 'r').read(), # different roundings
+ open(path_from_root('tests', 'bullet', 'output2.txt'), 'r').read(),
+ open(path_from_root('tests', 'bullet', 'output3.txt'), 'r').read()],
+ libraries=self.get_library('bullet', generated_libs, configure=configure, configure_args=configure_args[c]),
+ includes=[path_from_root('tests', 'bullet', 'src')])
test()
- new = open('src.cpp.o.js').read()
- print len(old), len(new), old.count('tempBigInt'), new.count('tempBigInt')
- assert len(old) > len(new)
- assert old.count('tempBigInt') > new.count('tempBigInt')
+
+ assert 'asm2g' in test_modes
+ if self.run_name == 'asm2g':
+ # Test forced alignment
+ print >> sys.stderr, 'testing FORCE_ALIGNED_MEMORY'
+ old = open('src.cpp.o.js').read()
+ Settings.FORCE_ALIGNED_MEMORY = 1
+ test()
+ new = open('src.cpp.o.js').read()
+ print len(old), len(new), old.count('tempBigInt'), new.count('tempBigInt')
+ assert len(old) > len(new)
+ assert old.count('tempBigInt') > new.count('tempBigInt')
def test_poppler(self):
if self.emcc_args is None: return self.skip('very slow, we only do this in emcc runs')