Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ jobs:
uses: alpine-ros/alpine-ros-ci-workflows/.github/workflows/ros1.yaml@main
with:
enable-bot-comment: true
enable-codecov: true
secrets:
bot-comment-token: ${{ secrets.GITHUB_TOKEN }}
5 changes: 0 additions & 5 deletions CMakeLists.txt

This file was deleted.

File renamed without changes.
14 changes: 14 additions & 0 deletions sample_ros_pkg/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 3.1.3)
project(sample_ros_pkg)

find_package(catkin REQUIRED)
catkin_package()

include_directories(include)

if(CATKIN_ENABLE_TESTING)
catkin_add_gtest(test_sample
test/src/test_sample.cpp
src/sample.cpp
)
endif()
File renamed without changes.
9 changes: 9 additions & 0 deletions sample_ros_pkg/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
coverage:
status:
project:
default:
threshold: 5%
patch:
default:
target: 25%
only_pulls: true
4 changes: 4 additions & 0 deletions sample_ros_pkg/include/sample.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#pragma once

int sum(const int a, const int b);
int mul(const int a, const int b);
File renamed without changes.
13 changes: 13 additions & 0 deletions sample_ros_pkg/src/sample.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
int sum(const int a, const int b)
{
// covered
const int c = a + b;
return c;
}

int mul(const int a, const int b)

Check warning on line 8 in sample_ros_pkg/src/sample.cpp

View check run for this annotation

Codecov / codecov/patch

sample_ros_pkg/src/sample.cpp#L8

Added line #L8 was not covered by tests
{
// not covered
const int c = a * b;
return c;

Check warning on line 12 in sample_ros_pkg/src/sample.cpp

View check run for this annotation

Codecov / codecov/patch

sample_ros_pkg/src/sample.cpp#L11-L12

Added lines #L11 - L12 were not covered by tests
}
15 changes: 15 additions & 0 deletions sample_ros_pkg/test/src/test_sample.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include <gtest/gtest.h>

#include <sample.h>

TEST(Sum, Sum)
{
ASSERT_EQ(sum(1, 2), 3);
}

int main(int argc, char** argv)
{
testing::InitGoogleTest(&argc, argv);

return RUN_ALL_TESTS();
}
Loading