Changeset View
Changeset View
Standalone View
Standalone View
tests/python/physics_particle_system.py
- This file was copied from tests/python/physics_cloth.py.
| Show All 18 Lines | |||||
| # <pep8 compliant> | # <pep8 compliant> | ||||
| import os | import os | ||||
| import sys | import sys | ||||
| import bpy | import bpy | ||||
| sys.path.append(os.path.dirname(os.path.realpath(__file__))) | sys.path.append(os.path.dirname(os.path.realpath(__file__))) | ||||
| from modules.mesh_test import ModifierTest, PhysicsSpec | from modules.mesh_test import ModifierTest, ParticleSystemSpec | ||||
| def main(): | def main(): | ||||
| test = [ | test = [ | ||||
| ["testCloth", "expectedCloth", | ["ParticleSystemTest", "test", "exp", | ||||
| [PhysicsSpec('Cloth', 'CLOTH', {'quality': 5}, 35)]], | [ParticleSystemSpec('Particles', 'PARTICLE_SYSTEM', {'render_type': "OBJECT", 'instance_object': bpy.data.objects['Cube']}, 20)]], | ||||
| ] | ] | ||||
| cloth_test = ModifierTest(test, threshold=1e-3) | particle_test = ModifierTest(test, threshold=1e-3) | ||||
| command = list(sys.argv) | command = list(sys.argv) | ||||
| for i, cmd in enumerate(command): | for i, cmd in enumerate(command): | ||||
| if cmd == "--run-all-tests": | if cmd == "--run-all-tests": | ||||
| cloth_test.apply_modifiers = True | particle_test.apply_modifiers = True | ||||
| cloth_test.run_all_tests() | particle_test.run_all_tests() | ||||
| break | break | ||||
| elif cmd == "--run-test": | elif cmd == "--run-test": | ||||
| cloth_test.apply_modifiers = False | particle_test.apply_modifiers = False | ||||
| index = int(command[i + 1]) | name = str(command[i + 1]) | ||||
| cloth_test.run_test(index) | particle_test.run_test(name) | ||||
| break | break | ||||
| if __name__ == "__main__": | if __name__ == "__main__": | ||||
| main() | main() | ||||