NVIDIA Holoscan SDK v3.8.0

Template Class OperatorTestHarness

Base Types

  • public holoscan::Application (Class Application)

  • public std::enable_shared_from_this< OperatorTestHarness< OperatorType, Args... > >

template<typename OperatorType, typename ...Args>
class OperatorTestHarness : public holoscan::Application, public std::enable_shared_from_this<OperatorTestHarness<OperatorType, Args...>>

Test application wrapper for testing a Holoscan operator’s compute method.

This class provides a test harness for testing a Holoscan operator’s compute method. It supports an arbitrary number of input and output ports with arbitrary types. It also supports adding conditions to the operator under test.

Template Parameters
  • OperatorType – The type of the operator to test

  • Args – The types of the operator’s arguments

Public Functions

inline explicit OperatorTestHarness(std::tuple<Args...> operator_args)
template<typename T>
inline std::shared_ptr<OperatorTestHarness> add_input_port(const std::string &name, const std::vector<T> &data)
template<typename T>
inline std::shared_ptr<OperatorTestHarness> add_output_port(const std::string &name, const std::vector<std::function<void(const T&)>> &validators = {})
template<typename ConditionType, typename ...CondArgs>
inline std::shared_ptr<OperatorTestHarness> add_condition(const std::string &name, CondArgs&&... args)
inline virtual void compose() override

Compose a graph.

The graph is composed by adding operators and flows in this method.

template<typename T>
inline std::shared_ptr<TestHarnessSourceOp<T>> get_source(const std::string &port_name) const
template<typename T = OperatorType>
inline std::shared_ptr<T> get_operator_under_test() const
template<typename T>
inline std::shared_ptr<TestHarnessSinkOp<T>> get_sink(const std::string &port_name) const
inline void run_test()

Previous Class OperatorTestBase
Next Template Class TestHarnessSinkOp
© Copyright 2022-2025, NVIDIA. Last updated on Nov 6, 2025