diff options
author | Josh Blum | 2013-02-24 14:29:16 -0800 |
---|---|---|
committer | Josh Blum | 2013-02-24 14:29:16 -0800 |
commit | 883743bd59f40f9ce1e30bd196de78c2e7646294 (patch) | |
tree | f9b0cf4f0a1d3894643a681a54aa21fe55398243 /tests | |
parent | 6841702911d07a2bad86ecd3bfc243b6a688ad2a (diff) | |
parent | decd0f40714a71c6fb5c4f100e8f51c6ef238b26 (diff) | |
download | sandhi-883743bd59f40f9ce1e30bd196de78c2e7646294.tar.gz sandhi-883743bd59f40f9ce1e30bd196de78c2e7646294.tar.bz2 sandhi-883743bd59f40f9ce1e30bd196de78c2e7646294.zip |
Merge branch 'stats'
Conflicts:
grextras
include/gras/top_block.hpp
lib/block_handlers.cpp
lib/block_task.cpp
lib/element_impl.hpp
tests/CMakeLists.txt
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/stats_test.py | 28 |
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c1d219f..27a2965 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -11,3 +11,4 @@ GR_ADD_TEST(block_test ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/block_te GR_ADD_TEST(hier_block_test ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/hier_block_test.py) GR_ADD_TEST(thread_pool_test ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/thread_pool_test.py) GR_ADD_TEST(sbuffer_test ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/sbuffer_test.py) +GR_ADD_TEST(stats_test ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/stats_test.py) diff --git a/tests/stats_test.py b/tests/stats_test.py new file mode 100644 index 0000000..9d937e9 --- /dev/null +++ b/tests/stats_test.py @@ -0,0 +1,28 @@ +# Copyright (C) by Josh Blum. See LICENSE.txt for licensing information. + +import unittest +import gras +import numpy +from demo_blocks import * + +class StatsTest(unittest.TestCase): + + def setUp(self): + self.tb = gras.TopBlock() + + def tearDown(self): + self.tb = None + + def test_simple(self): + vec_source = VectorSource(numpy.uint32, [0, 9, 8, 7, 6]) + vec_sink = VectorSink(numpy.uint32) + + self.tb.connect(vec_source, vec_sink) + self.tb.run() + + self.assertEqual(vec_sink.get_vector(), (0, 9, 8, 7, 6)) + + print self.tb.get_stats_xml() + +if __name__ == '__main__': + unittest.main() |