mirror of
https://github.com/red0124/ssp.git
synced 2025-12-14 21:59:55 +01:00
add meson support, update pipeline
This commit is contained in:
18
test/meson.build
Normal file
18
test/meson.build
Normal 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)
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <algorithm>
|
||||
#include <doctest/doctest.h>
|
||||
#include <doctest.h>
|
||||
#include <ss/converter.hpp>
|
||||
|
||||
TEST_CASE("testing split") {
|
||||
|
||||
@@ -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
2
test/test_main.cpp
Normal file
@@ -0,0 +1,2 @@
|
||||
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
|
||||
#include <doctest.h>
|
||||
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user