Skip to content

Commit

Permalink
Fast DDS Spy tool tests (#21)
Browse files Browse the repository at this point in the history
* Add tool tests

Signed-off-by: Irene Bandera <[email protected]>

* Update

Signed-off-by: Irene Bandera <[email protected]>

* Fix python linter

Signed-off-by: Irene Bandera <[email protected]>

* AApply changes

Signed-off-by: Irene Bandera <[email protected]>

* Fail test

Signed-off-by: Irene Bandera <[email protected]>

* Without one shot

Signed-off-by: Irene Bandera <[email protected]>

* Fix tsan

Signed-off-by: Irene Bandera <[email protected]>

* add commands

Signed-off-by: Irene Bandera <[email protected]>

* Update structure

Signed-off-by: Irene Bandera <[email protected]>

* Change structure

Signed-off-by: Irene Bandera <[email protected]>

* Add one shot test without dds

Signed-off-by: Irene Bandera <[email protected]>

* Update

Signed-off-by: Irene Bandera <[email protected]>

* Working without fast

Signed-off-by: Irene Bandera <[email protected]>

* Add one shot with dds tests

Signed-off-by: Irene Bandera <[email protected]>

* Add dds publisher

Signed-off-by: Irene Bandera <[email protected]>

* Get output commands

Signed-off-by: Irene Bandera <[email protected]>

* Rename function

Signed-off-by: Irene Bandera <[email protected]>

* Test output without dds working

Signed-off-by: Irene Bandera <[email protected]>

* Everything working except for tool with dds

Signed-off-by: Irene Bandera <[email protected]>

* Add xtsan flag to dds tests

Signed-off-by: Irene Bandera <[email protected]>

* Update

Signed-off-by: Irene Bandera <[email protected]>

* Rate with regexp

Signed-off-by: Irene Bandera <[email protected]>

* Everything working

Signed-off-by: Irene Bandera <[email protected]>

* Add signal windows

Signed-off-by: Irene Bandera <[email protected]>

* More coverage

Signed-off-by: Irene Bandera <[email protected]>

* Fix tests

Signed-off-by: Irene Bandera <[email protected]>

* Long lines

Signed-off-by: Irene Bandera <[email protected]>

* Long lines

Signed-off-by: Irene Bandera <[email protected]>

* Some style fixes

Signed-off-by: Irene Bandera <[email protected]>

* Some fixes windows

Signed-off-by: Irene Bandera <[email protected]>

* Some fixes windows

Signed-off-by: Irene Bandera <[email protected]>

* Signal windows

Signed-off-by: Irene Bandera <[email protected]>

* Fix local path dds

Signed-off-by: Irene Bandera <[email protected]>

* Fix one shot

Signed-off-by: Irene Bandera <[email protected]>

* Some fixes

Signed-off-by: Irene Bandera <[email protected]>

* Fix return

Signed-off-by: Irene Bandera <[email protected]>

* Some fixes

Signed-off-by: Irene Bandera <[email protected]>

* Some fixes

Signed-off-by: Irene Bandera <[email protected]>

* Without return code

Signed-off-by: Irene Bandera <[email protected]>

* Update

Signed-off-by: Irene Bandera <[email protected]>

* Some fixes

Signed-off-by: Irene Bandera <[email protected]>

* Time changes

Signed-off-by: Irene Bandera <[email protected]>

* Fix time, uncrustify and python linter

Signed-off-by: Irene Bandera <[email protected]>

* Uncrustify and more timeout

Signed-off-by: Irene Bandera <[email protected]>

* add lease_duration

Signed-off-by: Irene Bandera <[email protected]>

* More timeout

Signed-off-by: Irene Bandera <[email protected]>

* add stop when fail

Signed-off-by: Irene Bandera <[email protected]>

* Add Release path

Signed-off-by: Irene Bandera <[email protected]>

* Fix stop tool when wrong output and sys.exit(0)

Signed-off-by: Irene Bandera <[email protected]>

* Fix exit and give time to stop

Signed-off-by: Irene Bandera <[email protected]>

* Less timeout

Signed-off-by: Irene Bandera <[email protected]>

* timeout=15

Signed-off-by: Irene Bandera <[email protected]>

* Fix python linter

Signed-off-by: Irene Bandera <[email protected]>

* Give more time to stop

Signed-off-by: Irene Bandera <[email protected]>

* change kill publisher

Signed-off-by: Irene Bandera <[email protected]>

* kill publisher

Signed-off-by: Irene Bandera <[email protected]>

* Apply changes

Signed-off-by: Irene Bandera <[email protected]>

* Testing

Signed-off-by: Irene Bandera <[email protected]>

* Add docu code

Signed-off-by: Irene Bandera <[email protected]>

* Debug

Signed-off-by: Irene Bandera <[email protected]>

* Apply changes

Signed-off-by: Irene Bandera <[email protected]>

* Apply changes

Signed-off-by: Irene Bandera <[email protected]>

* Apply changes

Signed-off-by: Irene Bandera <[email protected]>

---------

Signed-off-by: Irene Bandera <[email protected]>
  • Loading branch information
irenebm committed Jun 22, 2023
1 parent 18d52fa commit ce3ae97
Show file tree
Hide file tree
Showing 92 changed files with 6,326 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,52 +29,52 @@ struct ModelParser
{
FASTDDSSPY_PARTICIPANTS_DllAPI
static std::vector<SimpleParticipantData> participants(
const SpyModel& model);
const SpyModel& model) noexcept;
FASTDDSSPY_PARTICIPANTS_DllAPI
static std::vector<ComplexParticipantData> participants_verbose(
const SpyModel& model);
const SpyModel& model) noexcept;
FASTDDSSPY_PARTICIPANTS_DllAPI
static ComplexParticipantData participants(
const SpyModel& model,
const ddspipe::core::types::Guid& guid);
const ddspipe::core::types::Guid& guid) noexcept;

FASTDDSSPY_PARTICIPANTS_DllAPI
static std::vector<SimpleEndpointData> writers(
const SpyModel& model);
const SpyModel& model) noexcept;
FASTDDSSPY_PARTICIPANTS_DllAPI
static std::vector<ComplexEndpointData> writers_verbose(
const SpyModel& model);
const SpyModel& model) noexcept;
FASTDDSSPY_PARTICIPANTS_DllAPI
static ComplexEndpointData writers(
const SpyModel& model,
const ddspipe::core::types::Guid& guid);
const ddspipe::core::types::Guid& guid) noexcept;

FASTDDSSPY_PARTICIPANTS_DllAPI
static std::vector<SimpleEndpointData> readers(
const SpyModel& model);
const SpyModel& model) noexcept;
FASTDDSSPY_PARTICIPANTS_DllAPI
static std::vector<ComplexEndpointData> readers_verbose(
const SpyModel& model);
const SpyModel& model) noexcept;
FASTDDSSPY_PARTICIPANTS_DllAPI
static ComplexEndpointData readers(
const SpyModel& model,
const ddspipe::core::types::Guid& guid);
const ddspipe::core::types::Guid& guid) noexcept;

FASTDDSSPY_PARTICIPANTS_DllAPI
static ddspipe::core::types::DdsTopic get_topic(
const SpyModel& model,
std::string topic_name);
std::string topic_name) noexcept;

FASTDDSSPY_PARTICIPANTS_DllAPI
static std::vector<SimpleTopicData> topics(
const SpyModel& model);
const SpyModel& model) noexcept;
FASTDDSSPY_PARTICIPANTS_DllAPI
static std::vector<ComplexTopicData> topics_verbose(
const SpyModel& model);
const SpyModel& model) noexcept;
FASTDDSSPY_PARTICIPANTS_DllAPI
static ComplexTopicData topics(
const SpyModel& model,
const std::string& topic_name);
const std::string& topic_name) noexcept;
};

} /* namespace participants */
Expand Down
40 changes: 20 additions & 20 deletions fastddsspy_participants/src/cpp/visualization/ModelParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace spy {
namespace participants {

std::vector<SimpleParticipantData> ModelParser::participants(
const SpyModel& model)
const SpyModel& model) noexcept
{
std::vector<SimpleParticipantData> result;
for (const auto& it : model.participant_database_)
Expand All @@ -36,7 +36,7 @@ std::vector<SimpleParticipantData> ModelParser::participants(
}

std::vector<ComplexParticipantData> ModelParser::participants_verbose(
const SpyModel& model)
const SpyModel& model) noexcept
{
std::vector<ComplexParticipantData> result;

Expand All @@ -56,7 +56,7 @@ void add_endpoint_to_vector(
std::map<std::string, int>& already_endpoints_index,
std::vector<ComplexParticipantData::Endpoint>& endpoints,
const std::pair<const eprosima::ddspipe::core::types::Guid,
eprosima::spy::participants::EndpointInfo>& endpoint)
eprosima::spy::participants::EndpointInfo>& endpoint) noexcept
{
// Check if this topic has already endpoints added
auto it = already_endpoints_index.find(endpoint.second.topic.m_topic_name);
Expand All @@ -79,7 +79,7 @@ void add_endpoint_to_vector(

ComplexParticipantData ModelParser::participants(
const SpyModel& model,
const ddspipe::core::types::Guid& guid)
const ddspipe::core::types::Guid& guid) noexcept
{
ComplexParticipantData result;

Expand Down Expand Up @@ -126,7 +126,7 @@ ComplexParticipantData ModelParser::participants(

std::string get_participant_name(
const SpyModel& model,
const ddspipe::core::types::Guid guid)
const ddspipe::core::types::Guid guid) noexcept
{
// Look for participant name
for (const auto& participant : model.participant_database_)
Expand All @@ -142,7 +142,7 @@ std::string get_participant_name(

SimpleEndpointData fill_simple_endpoint(
const SpyModel& model,
const spy::participants::EndpointInfo& endpoint)
const spy::participants::EndpointInfo& endpoint) noexcept
{
std::string participant_name = get_participant_name(model, endpoint.guid);

Expand All @@ -159,7 +159,7 @@ SimpleEndpointData fill_simple_endpoint(
void fill_complex_endpoint(
const SpyModel& model,
ComplexEndpointData& result,
const spy::participants::EndpointInfo& endpoint)
const spy::participants::EndpointInfo& endpoint) noexcept
{
result.participant_name = get_participant_name(model, endpoint.guid);

Expand All @@ -173,7 +173,7 @@ void fill_complex_endpoint(
void set_endpoint_simple_information(
const SpyModel& model,
std::vector<SimpleEndpointData>& result,
const ddspipe::core::types::EndpointKind kind)
const ddspipe::core::types::EndpointKind kind) noexcept
{
for (const auto& endpoint : model.endpoint_database_)
{
Expand All @@ -188,7 +188,7 @@ void set_endpoint_complex_information(
const SpyModel& model,
ComplexEndpointData& result,
const ddspipe::core::types::EndpointKind kind,
const eprosima::ddspipe::core::types::Guid guid)
const eprosima::ddspipe::core::types::Guid guid) noexcept
{
for (const auto& endpoint : model.endpoint_database_)
{
Expand All @@ -202,7 +202,7 @@ void set_endpoint_complex_information(
}

std::vector<SimpleEndpointData> ModelParser::writers(
const SpyModel& model)
const SpyModel& model) noexcept
{
std::vector<SimpleEndpointData> result;

Expand All @@ -212,7 +212,7 @@ std::vector<SimpleEndpointData> ModelParser::writers(
}

std::vector<ComplexEndpointData> ModelParser::writers_verbose(
const SpyModel& model)
const SpyModel& model) noexcept
{
std::vector<ComplexEndpointData> result;

Expand All @@ -229,7 +229,7 @@ std::vector<ComplexEndpointData> ModelParser::writers_verbose(

ComplexEndpointData ModelParser::writers(
const SpyModel& model,
const ddspipe::core::types::Guid& guid)
const ddspipe::core::types::Guid& guid) noexcept
{
ComplexEndpointData result;

Expand All @@ -239,7 +239,7 @@ ComplexEndpointData ModelParser::writers(
}

std::vector<SimpleEndpointData> ModelParser::readers(
const SpyModel& model)
const SpyModel& model) noexcept
{
std::vector<SimpleEndpointData> result;

Expand All @@ -249,7 +249,7 @@ std::vector<SimpleEndpointData> ModelParser::readers(
}

std::vector<ComplexEndpointData> ModelParser::readers_verbose(
const SpyModel& model)
const SpyModel& model) noexcept
{
std::vector<ComplexEndpointData> result;

Expand All @@ -266,7 +266,7 @@ std::vector<ComplexEndpointData> ModelParser::readers_verbose(

ComplexEndpointData ModelParser::readers(
const SpyModel& model,
const ddspipe::core::types::Guid& guid)
const ddspipe::core::types::Guid& guid) noexcept
{
ComplexEndpointData result;

Expand All @@ -279,7 +279,7 @@ ComplexEndpointData ModelParser::readers(
* This is an auxiliary function that is used to get topics endpoint database
*/
std::set<eprosima::ddspipe::core::types::DdsTopic> get_topics(
const SpyModel& model)
const SpyModel& model) noexcept
{
std::set<eprosima::ddspipe::core::types::DdsTopic> result;
for (const auto& endpoint : model.endpoint_database_)
Expand All @@ -294,7 +294,7 @@ std::set<eprosima::ddspipe::core::types::DdsTopic> get_topics(

ddspipe::core::types::DdsTopic ModelParser::get_topic(
const SpyModel& model,
std::string topic_name)
std::string topic_name) noexcept
{

for (const auto& endpoint : model.endpoint_database_)
Expand All @@ -309,7 +309,7 @@ ddspipe::core::types::DdsTopic ModelParser::get_topic(
}

std::vector<SimpleTopicData> ModelParser::topics(
const SpyModel& model)
const SpyModel& model) noexcept
{
std::vector<SimpleTopicData> result;

Expand Down Expand Up @@ -348,7 +348,7 @@ std::vector<SimpleTopicData> ModelParser::topics(
}

std::vector<ComplexTopicData> ModelParser::topics_verbose(
const SpyModel& model)
const SpyModel& model) noexcept
{
std::vector<ComplexTopicData> result;

Expand All @@ -363,7 +363,7 @@ std::vector<ComplexTopicData> ModelParser::topics_verbose(

ComplexTopicData ModelParser::topics(
const SpyModel& model,
const std::string& topic_name)
const std::string& topic_name) noexcept
{
ComplexTopicData result;

Expand Down
2 changes: 2 additions & 0 deletions fastddsspy_tool/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

<buildtool_depend>cmake</buildtool_depend>

<depend>cmake_utils</depend>
<depend>cpp_utils</depend>
<depend>py_utils</depend>
<depend>ddspipe_core</depend>
<depend>ddspipe_participants</depend>
<depend>ddspipe_yaml</depend>
Expand Down
4 changes: 4 additions & 0 deletions fastddsspy_tool/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Add subdirectory with labels for tests
add_subdirectory(labels)

# Add subdirectory with tests
add_subdirectory(application)
Loading

0 comments on commit ce3ae97

Please sign in to comment.