mirror of
https://github.com/red0124/ssp.git
synced 2025-01-23 04:55:20 +01:00
[skip ci] Update coverage.yml to work with lcov2.0
This commit is contained in:
parent
5e32d722e8
commit
b993eb8852
5
.github/workflows/coverage.yml
vendored
5
.github/workflows/coverage.yml
vendored
@ -46,7 +46,10 @@ jobs:
|
|||||||
- name: Install test coverage tools
|
- name: Install test coverage tools
|
||||||
run: |
|
run: |
|
||||||
apt update
|
apt update
|
||||||
apt install -y gcovr lcov
|
apt install -y gcovr
|
||||||
|
|
||||||
|
- name: Install lcov2.0
|
||||||
|
run: script/ci_install_lcov.sh
|
||||||
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
run: cmake -S test -B build -D CMAKE_BUILD_TYPE=Debug -D CMAKE_CXX_FLAGS="-Wall -fprofile-arcs -ftest-coverage --coverage -fno-elide-constructors -fno-default-inline"
|
run: cmake -S test -B build -D CMAKE_BUILD_TYPE=Debug -D CMAKE_CXX_FLAGS="-Wall -fprofile-arcs -ftest-coverage --coverage -fno-elide-constructors -fno-default-inline"
|
||||||
|
@ -31,6 +31,7 @@ inline ssize_t get_line_file(char** lineptr, size_t* n, FILE* stream) {
|
|||||||
return getline(lineptr, n, stream);
|
return getline(lineptr, n, stream);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
// TODO set ERRNO ?
|
||||||
using ssize_t = int64_t;
|
using ssize_t = int64_t;
|
||||||
inline ssize_t get_line_file(char** lineptr, size_t* n, FILE* stream) {
|
inline ssize_t get_line_file(char** lineptr, size_t* n, FILE* stream) {
|
||||||
size_t pos;
|
size_t pos;
|
||||||
|
@ -742,6 +742,7 @@ private:
|
|||||||
reader(const reader& other) = delete;
|
reader(const reader& other) = delete;
|
||||||
reader& operator=(const reader& other) = delete;
|
reader& operator=(const reader& other) = delete;
|
||||||
|
|
||||||
|
// TODO set error numbers on error
|
||||||
ssize_t get_line_buffer(char** lineptr, size_t* n,
|
ssize_t get_line_buffer(char** lineptr, size_t* n,
|
||||||
const char* const buffer, size_t csv_data_size,
|
const char* const buffer, size_t csv_data_size,
|
||||||
size_t& curr_char) {
|
size_t& curr_char) {
|
||||||
|
7
script/ci_install_lcov.sh
Executable file
7
script/ci_install_lcov.sh
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
echo yes | cpan DateTime Capture::Tiny
|
||||||
|
|
||||||
|
wget -qO- https://github.com/linux-test-project/lcov/releases/download/v2.0/lcov-2.0.tar.gz | tar xvz
|
||||||
|
(cd lcov && make install)
|
||||||
|
lcov --version
|
@ -261,11 +261,14 @@ std::vector<std::string> generate_csv_data(const std::vector<field>& data,
|
|||||||
const std::string& file_name) {
|
const std::string& file_name) {
|
||||||
std::ofstream out{file_name, std::ios_base::app};
|
std::ofstream out{file_name, std::ios_base::app};
|
||||||
std::string line;
|
std::string line;
|
||||||
|
|
||||||
|
// TODO remove new line at eof randomly
|
||||||
for (size_t i = 0; i < data.size(); ++i) {
|
for (size_t i = 0; i < data.size(); ++i) {
|
||||||
line += data[i];
|
line += data[i];
|
||||||
if (i != data.size() - 1) {
|
if (i != data.size() - 1) {
|
||||||
line += delim;
|
line += delim;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
out << line << std::endl;
|
out << line << std::endl;
|
||||||
|
Loading…
Reference in New Issue
Block a user