-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
92 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# From https://github.com/marketplace/actions/ros-2-ci-action | ||
name: CI Action | ||
|
||
on: | ||
|
@@ -14,16 +15,42 @@ env: | |
|
||
|
||
jobs: | ||
unit-test: | ||
ci-action: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Install ROS | ||
- name: Install ROS2 and dependencies | ||
uses: ros-tooling/[email protected] | ||
with: | ||
required-ros-distro: ${{ env.ROS_DISTRO }} | ||
- name: Build and run tests | ||
|
||
- name: Build and Run Tests | ||
uses: ros-tooling/[email protected] | ||
id: action_ros_ci_step | ||
with: | ||
package_name: vortex-m3-sonar-driver | ||
target-ros2-distros: ${{ env.ROS_DISTRO }} | ||
package-name: vortex-m3-sonar-driver | ||
target-ros2-distro: ${{ env.ROS_DISTRO }} | ||
colcon-defaults: | | ||
{ | ||
"build": { | ||
"mixin": ["coverage-gcc", "coverage-pytest"] | ||
}, | ||
"test": { | ||
"mixin": ["coverage-pytest"] | ||
} | ||
} | ||
- name: Upload Code Coverage Info | ||
uses: codecov/[email protected] | ||
with: | ||
# token: ${{ secrets.CODECOV_TOKEN }} # only needed for private repos | ||
files: ros_ws/lcov/total_coverage.info,ros_ws/coveragepy/.coverage | ||
flags: unittests | ||
name: codecov-umbrella | ||
|
||
- name: Upload Test Results as Artifact | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: colcon-logs | ||
path: ${{ steps.action_ros_ci_step.outputs.ros-workspace-directory-name }}/log | ||
if: always() # upload the logs even when the build fails |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#pragma once | ||
|
||
// Header files for the xml library | ||
#include <api/m3CommandGenerator.hpp> | ||
#include <api/m3ResponseParser.hpp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,37 @@ | ||
#include <gtest/gtest.h> | ||
#include <xml/m3CommandGenerator.hpp> | ||
#include <api/m3CommandGenerator.hpp> | ||
|
||
TEST(XmlCommandGenerator, Connect) { EXPECT_EQ(xml::command::connect(), std::string("<Command>\n<Operation>Connect</Operation>\n</Command>\n")); } | ||
using namespace m3::api::command; | ||
|
||
TEST(XmlCommandGenerator, Disconnect) { EXPECT_EQ(xml::command::disconnect(), std::string("<Command>\n<Operation>Disconnect</Operation>\n</Command>\n")); } | ||
TEST(XmlCommandGenerator, Connect) { EXPECT_EQ(connect(), std::string("<Command>\n<Operation>Connect</Operation>\n</Command>\n")); } | ||
|
||
TEST(XmlCommandGenerator, GetStatus) { EXPECT_EQ(xml::command::getStatus(), std::string("<Command>\n<Operation>Get_Status</Operation>\n</Command>\n")); } | ||
TEST(XmlCommandGenerator, Disconnect) { EXPECT_EQ(disconnect(), std::string("<Command>\n<Operation>Disconnect</Operation>\n</Command>\n")); } | ||
|
||
TEST(XmlCommandGenerator, GetStatus) { EXPECT_EQ(getStatus(), std::string("<Command>\n<Operation>Get_Status</Operation>\n</Command>\n")); } | ||
|
||
TEST(XmlCommandGenerator, SetMode) | ||
{ | ||
EXPECT_EQ(xml::command::setMode(0), std::string("<Command>\n<Operation>Set_Mode</Operation>\n<Mode>0</Mode>\n</Command>\n")); | ||
EXPECT_EQ(xml::command::setMode(1), std::string("<Command>\n<Operation>Set_Mode</Operation>\n<Mode>1</Mode>\n</Command>\n")); | ||
EXPECT_EQ(xml::command::setMode(2), std::string("<Command>\n<Operation>Set_Mode</Operation>\n<Mode>2</Mode>\n</Command>\n")); | ||
EXPECT_EQ(setMode(0), std::string("<Command>\n<Operation>Set_Mode</Operation>\n<Mode>0</Mode>\n</Command>\n")); | ||
EXPECT_EQ(setMode(1), std::string("<Command>\n<Operation>Set_Mode</Operation>\n<Mode>1</Mode>\n</Command>\n")); | ||
EXPECT_EQ(setMode(2), std::string("<Command>\n<Operation>Set_Mode</Operation>\n<Mode>2</Mode>\n</Command>\n")); | ||
} | ||
|
||
TEST(XmlCommandGenerator, SetTVG) | ||
{ | ||
EXPECT_EQ(xml::command::setTVG(0, 0, 0, 0), | ||
EXPECT_EQ(setTVG(0, 0, 0, 0), | ||
std::string("<Command>\n<Operation>Set_TVG</Operation>\n<TVG_A>0</TVG_A>\n<TVG_B>0</TVG_B>\n<TVG_C>0</TVG_C>\n<TVG_L>0</TVG_L>\n</Command>\n")); | ||
EXPECT_EQ(xml::command::setTVG(1, 2, 3, 4), | ||
EXPECT_EQ(setTVG(1, 2, 3, 4), | ||
std::string("<Command>\n<Operation>Set_TVG</Operation>\n<TVG_A>1</TVG_A>\n<TVG_B>2</TVG_B>\n<TVG_C>3</TVG_C>\n<TVG_L>4</TVG_L>\n</Command>\n")); | ||
} | ||
|
||
TEST(XmlCommandGenerator, StopPing) { EXPECT_EQ(xml::command::stopPing(), std::string("<Command>\n<Operation>Stop_Ping</Operation>\n</Command>\n")); } | ||
TEST(XmlCommandGenerator, StopPing) { EXPECT_EQ(stopPing(), std::string("<Command>\n<Operation>Stop_Ping</Operation>\n</Command>\n")); } | ||
|
||
TEST(XmlCommandGenerator, StartPing) { EXPECT_EQ(xml::command::startPing(), std::string("<Command>\n<Operation>Start_Ping</Operation>\n</Command>\n")); } | ||
TEST(XmlCommandGenerator, StartPing) { EXPECT_EQ(startPing(), std::string("<Command>\n<Operation>Start_Ping</Operation>\n</Command>\n")); } | ||
|
||
TEST(XmlCommandGenerator, StartRecord) { EXPECT_EQ(xml::command::startRecord(), std::string("<Command>\n<Operation>Start_Record</Operation>\n</Command>\n")); } | ||
TEST(XmlCommandGenerator, StartRecord) { EXPECT_EQ(startRecord(), std::string("<Command>\n<Operation>Start_Record</Operation>\n</Command>\n")); } | ||
|
||
TEST(XmlCommandGenerator, StopRecord) { EXPECT_EQ(xml::command::stopRecord(), std::string("<Command>\n<Operation>Stop_Record</Operation>\n</Command>\n")); } | ||
TEST(XmlCommandGenerator, StopRecord) { EXPECT_EQ(stopRecord(), std::string("<Command>\n<Operation>Stop_Record</Operation>\n</Command>\n")); } | ||
|
||
TEST(XmlCommandGenerator, StartExport) { EXPECT_EQ(xml::command::startExport(), std::string("<Command>\n<Operation>Start_Export</Operation>\n</Command>\n")); } | ||
TEST(XmlCommandGenerator, StartExport) { EXPECT_EQ(startExport(), std::string("<Command>\n<Operation>Start_Export</Operation>\n</Command>\n")); } | ||
|
||
TEST(XmlCommandGenerator, StopExport) { EXPECT_EQ(xml::command::stopExport(), std::string("<Command>\n<Operation>Stop_Export</Operation>\n</Command>\n")); } | ||
TEST(XmlCommandGenerator, StopExport) { EXPECT_EQ(stopExport(), std::string("<Command>\n<Operation>Stop_Export</Operation>\n</Command>\n")); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters