Skip to content
Snippets Groups Projects
Commit 480f6f7f authored by Simon Oehrl's avatar Simon Oehrl
Browse files

Add testing python module

parent 4f7f9916
Branches
Tags
No related merge requests found
Pipeline #165114 failed
......@@ -38,4 +38,5 @@ add_python_module(
OUTPUT_DIRECTORY ${PYNESCI_OUTPUT_DIR}
)
add_subdirectory(testing)
add_subdirectory(consumer)
# -------------------------------------------------------------------------------
# nesci -- neuronal simulator conan interface
#
# Copyright (c) 2018 RWTH Aachen University, Germany,
# Virtual Reality & Immersive Visualization Group.
# -------------------------------------------------------------------------------
# License
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# -------------------------------------------------------------------------------
file(GLOB SOURCES *.cpp)
file(GLOB HEADERS *.hpp)
file(GLOB PYTHON_SOURCES *.py)
set(PYNESCI_TESTING_OUTPUT_DIR
${CMAKE_CURRENT_BINARY_DIR}/../../pynesci/testing
CACHE PATH "Output path for pynesci python module"
)
add_python_module(
NAME _pynesci_testing
SOURCES ${SOURCES}
HEADERS ${HEADERS}
PYTHON_SOURCES ${PYTHON_SOURCES}
INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}
LINK_LIBRARIES Boost::python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR} Boost::disable_autolinking conduit nesci::nesci nesci::testing
OUTPUT_DIRECTORY ${PYNESCI_TESTING_OUTPUT_DIR}
)
# -------------------------------------------------------------------------------
# nesci -- neuronal simulator conan interface
#
# Copyright (c) 2018 RWTH Aachen University, Germany,
# Virtual Reality & Immersive Visualization Group.
# -------------------------------------------------------------------------------
# License
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# -------------------------------------------------------------------------------
from . _pynesci_testing import *
//------------------------------------------------------------------------------
// nesci -- neuronal simulator conan interface
//
// Copyright (c) 2017-2018 RWTH Aachen University, Germany,
// Virtual Reality & Immersive Visualisation Group.
//------------------------------------------------------------------------------
// License
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//------------------------------------------------------------------------------
#include "boost/python.hpp"
#include "nesci/testing/data.hpp"
#include "pynesci/suppress_warnings.hpp"
namespace pynesci {
namespace testing {
SUPPRESS_WARNINGS_BEGIN
// cppcheck-suppress unusedFunction
BOOST_PYTHON_MODULE(_pynesci_testing) {
using boost::noncopyable;
using boost::python::args;
using boost::python::bases;
using boost::python::class_;
using boost::python::def;
using boost::python::enum_;
using boost::python::init;
using boost::python::no_init;
using boost::python::pure_virtual;
using boost::python::scope;
using boost::python::wrapper;
def("CreateNestMultimeterDataNode",
&nesci::testing::CreateNestMultimeterDataNode);
def("CreateNestMultimeterDataNode",
&nesci::testing::CreateSpikeDetectorDataNode);
}
SUPPRESS_WARNINGS_END
} // namespace testing
} // namespace pynesci
......@@ -20,12 +20,13 @@
# -------------------------------------------------------------------------------
import pynesci
import CreateSpikeDetectorDataNode from pynesci.testing
def test_pynesci_consumer_device_data_view():
device = pynesci.consumer.DeviceDataView("SomeDeviceName")
device = pynesci.consumer.DeviceDataView(CreateSpikeDetectorDataNode())
def test_pynesci_consumer_device_data_view_get_device_name():
device = pynesci.consumer.DeviceDataView("SomeDeviceName")
device = pynesci.consumer.DeviceDataView(CreateSpikeDetectorDataNode())
assert device.GetDeviceName() == "SomeDeviceName"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment