Commit b6d268a5 authored by Remi Perenon's avatar Remi Perenon

Correcting tests scripts

parent 37613b59
Pipeline #3792 failed with stages
in 4 minutes and 32 seconds
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
# #
import unittest import unittest
import sys
import mmtk_basic_tests import mmtk_basic_tests
import mmtk_energy_tests import mmtk_energy_tests
...@@ -41,6 +42,9 @@ def suite(): ...@@ -41,6 +42,9 @@ def suite():
test_suite.addTests(mmtk_universe_tests.suite()) test_suite.addTests(mmtk_universe_tests.suite())
return test_suite return test_suite
if __name__ == '__main__': def run_test():
unittest.TextTestRunner(verbosity=2).run(suite()) if not unittest.TextTestRunner(verbosity=2).run(suite()).wasSuccessful():
sys.exit(1)
if __name__ == '__main__':
run_test()
...@@ -41,6 +41,7 @@ class SuperpositionTest(unittest.TestCase): ...@@ -41,6 +41,7 @@ class SuperpositionTest(unittest.TestCase):
tr, rms = universe.findTransformation(ref_conf) tr, rms = universe.findTransformation(ref_conf)
self.assert_(abs(rms) < 1.e-5) self.assert_(abs(rms) < 1.e-5)
universe.applyTransformation(tr) universe.applyTransformation(tr)
self.assertTrue(False)
self.assert_(universe.rmsDifference(ref_conf) < 1.e-5) self.assert_(universe.rmsDifference(ref_conf) < 1.e-5)
axis, angle = tr.rotation().axisAndAngle() axis, angle = tr.rotation().axisAndAngle()
self.assert_(abs(angle - 0.7) < 1.e-5) self.assert_(abs(angle - 0.7) < 1.e-5)
......
...@@ -47,5 +47,6 @@ def suite(): ...@@ -47,5 +47,6 @@ def suite():
def run_test(): def run_test():
if not unittest.TextTestRunner(verbosity=2).run(suite()).wasSuccessful(): if not unittest.TextTestRunner(verbosity=2).run(suite()).wasSuccessful():
sys.exit(1) sys.exit(1)
if __name__ == '__main__': if __name__ == '__main__':
run_test() run_test()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment