Skip to content
Snippets Groups Projects
Commit 1f2a7814 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

[Python][Tests] ensure oscillator loads fine

fix #17
parent e02992f8
No related branches found
No related tags found
No related merge requests found
......@@ -84,7 +84,7 @@ IF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
ENDIF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
ADD_SUBDIRECTORY(src)
#ADD_SUBDIRECTORY(tests)
ADD_SUBDIRECTORY(tests)
PKG_CONFIG_APPEND_LIBS(${PROJECT_NAME})
IF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
......
ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN)
ADD_UNIT_TEST(test_simpleseqplay test_simpleseqplay.cc)
TARGET_LINK_LIBRARIES(test_simpleseqplay ${PROJECT_NAME} ${Boost_LIBRARIES})
#ADD_UNIT_TEST(test_simpleseqplay test_simpleseqplay.cc)
#TARGET_LINK_LIBRARIES(test_simpleseqplay ${PROJECT_NAME} ${Boost_LIBRARIES})
IF(BUILD_PYTHON_INTERFACE)
ADD_SUBDIRECTORY(python)
ENDIF(BUILD_PYTHON_INTERFACE)
ADD_PYTHON_UNIT_TEST("py-oscillator" "tests/python/oscillator.py")
import unittest
from random import random
from dynamic_graph.sot.tools import Oscillator
class OscillatorTest(unittest.TestCase):
def test_load(self):
epsilon = random()
osc = Oscillator('my oscillator')
osc.setEpsilon(epsilon)
self.assertEqual(osc.getEpsilon(), epsilon)
if __name__ == '__main__':
unittest.main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment