add meson support, update pipeline

This commit is contained in:
ado
2021-01-19 20:26:36 +01:00
parent 4de7063708
commit 92e8e200f9
11 changed files with 60 additions and 41 deletions

18
test/meson.build Normal file
View File

@@ -0,0 +1,18 @@
test_sources = files([
'test_main.cpp',
'test_converter.cpp',
'test_parser.cpp',
'test_extractions.cpp',
])
doctest_proj = subproject('doctest')
doctest_dep = doctest_proj.get_variable('doctest_dep')
test_exe = executable('test_ssp',
sources: test_sources,
dependencies: doctest_dep,
include_directories: includes,
cpp_args: '-lstdc++fs'
)
test('tests_ssp', test_exe)

View File

@@ -1,5 +1,5 @@
#include <algorithm>
#include <doctest/doctest.h>
#include <doctest.h>
#include <ss/converter.hpp>
TEST_CASE("testing split") {

View File

@@ -1,5 +1,5 @@
#include <ss/extract.hpp>
#include <doctest/doctest.h>
#include <doctest.h>
#include <algorithm>
constexpr auto eps = 0.000001;

2
test/test_main.cpp Normal file
View File

@@ -0,0 +1,2 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include <doctest.h>

View File

@@ -1,17 +1,15 @@
#include <ss/parser.hpp>
#include <doctest/doctest.h>
#include <algorithm>
#include <doctest.h>
#include <filesystem>
#include <fstream>
#include <ss/parser.hpp>
struct unique_file_name {
const std::string name;
unique_file_name() : name{std::tmpnam(nullptr)} {
}
unique_file_name() : name{std::tmpnam(nullptr)} {}
~unique_file_name() {
std::filesystem::remove(name);
}
~unique_file_name() { std::filesystem::remove(name); }
};
struct X {
@@ -27,9 +25,7 @@ struct X {
.append(delim)
.append(s);
}
auto tied() const {
return std::tie(i, d, s);
}
auto tied() const { return std::tie(i, d, s); }
};
template <typename T>
@@ -165,13 +161,10 @@ struct test_struct {
int i;
double d;
char c;
auto tied() {
return std::tie(i, d, c);
}
auto tied() { return std::tie(i, d, c); }
};
void expect_test_struct(const test_struct&) {
}
void expect_test_struct(const test_struct&) {}
// various scenarios
TEST_CASE("testing composite conversion") {
@@ -393,9 +386,7 @@ struct my_string {
my_string() = default;
~my_string() {
delete[] data;
}
~my_string() { delete[] data; }
// make sure no object is copied
my_string(const my_string&) = delete;
@@ -426,9 +417,7 @@ struct xyz {
my_string x;
my_string y;
my_string z;
auto tied() {
return std::tie(x, y, z);
}
auto tied() { return std::tie(x, y, z); }
};
TEST_CASE("testing the moving of parsed values") {