added tests to meson
This commit is contained in:
parent
5435d54510
commit
5b0576aa0d
|
@ -2,6 +2,8 @@ project('libmrbesen', 'cpp', default_options : ['cpp_std=c++17', 'warning_level=
|
||||||
|
|
||||||
inc = include_directories('inc')
|
inc = include_directories('inc')
|
||||||
|
|
||||||
subdir('src')
|
|
||||||
subdir('inc')
|
subdir('inc')
|
||||||
|
subdir('src')
|
||||||
|
|
||||||
|
subdir('tests')
|
||||||
|
|
||||||
|
|
|
@ -147,11 +147,13 @@ int testFiles_readFile() {
|
||||||
|
|
||||||
ASSERT(!files::readFile(NONEXISTENT_FILE, buf), "this file should not be read"); //try to read non existing file
|
ASSERT(!files::readFile(NONEXISTENT_FILE, buf), "this file should not be read"); //try to read non existing file
|
||||||
|
|
||||||
bool r = files::readFile(std::string("tests/filestests.cpp"), buf);
|
const char* testfile = "tests/filestests.cpp";
|
||||||
|
|
||||||
|
bool r = files::readFile(std::string(testfile), buf);
|
||||||
ASSERT(r, "failed to read");
|
ASSERT(r, "failed to read");
|
||||||
|
|
||||||
//alternative read
|
//alternative read
|
||||||
int fd = open("tests/filestests.cpp", O_RDONLY);
|
int fd = open(testfile, O_RDONLY);
|
||||||
const unsigned int size = 1024*1024; //1MB
|
const unsigned int size = 1024*1024; //1MB
|
||||||
char* buf2 = new char[size];
|
char* buf2 = new char[size];
|
||||||
ssize_t rc = read(fd, buf2, size);
|
ssize_t rc = read(fd, buf2, size);
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
testSrc = files([
|
||||||
|
'doytests.cpp',
|
||||||
|
'filestests.cpp',
|
||||||
|
'main.cpp',
|
||||||
|
'stringspliteratortest.cpp',
|
||||||
|
'test.h',
|
||||||
|
'utilstest.cpp',
|
||||||
|
])
|
||||||
|
|
||||||
|
libmrbesentestexe = executable('libmrbesen_test', testSrc, libmrbesenSrc, include_directories: inc,)
|
||||||
|
|
||||||
|
test('libmrbesenTest', libmrbesentestexe, is_parallel: true, workdir: meson.source_root())
|
Loading…
Reference in New Issue