Compare commits
1 Commits
Author | SHA1 | Date |
---|---|---|
Thies Block | c2135dbf8b |
|
@ -7,6 +7,7 @@ build/
|
|||
.gdb_history
|
||||
|
||||
*.so
|
||||
*.deb
|
||||
*.d
|
||||
*.a
|
||||
|
||||
|
|
12
Makefile
12
Makefile
|
@ -55,7 +55,7 @@ clean-depends:
|
|||
$(RM) -r $(DEPF)
|
||||
|
||||
clean:
|
||||
$(RM) -r $(OUTF)$(NAME) $(BUILDDIR) $(NAMETEST) $(NAMESTATIC)
|
||||
$(RM) -r $(OUTF)$(NAME) $(BUILDDIR) $(NAMETEST) $(NAMESTATIC) $(NAMESHORT).deb
|
||||
|
||||
$(NAMETEST): $(TESTF)*.cpp $(NAMESTATIC)
|
||||
@echo "Compiling tests"
|
||||
|
@ -65,6 +65,16 @@ runtest: $(NAMETEST)
|
|||
@echo "Running tests"
|
||||
./$<
|
||||
|
||||
builddeb: $(NAME)
|
||||
mkdir -p $(BUILDDIR)deb/$(NAMESHORT)/DEBIAN/
|
||||
mkdir -p $(BUILDDIR)deb/$(NAMESHORT)/usr/lib/
|
||||
mkdir -p $(BUILDDIR)deb/$(NAMESHORT)/usr/include/$(NAMESHORT)/
|
||||
cp -f ./debconfig $(BUILDDIR)deb/$(NAMESHORT)/DEBIAN/control
|
||||
cp -f ./$(NAME) $(BUILDDIR)deb/$(NAMESHORT)/usr/lib/
|
||||
cp -rf $(INCF)* $(BUILDDIR)deb/$(NAMESHORT)/usr/include/$(NAMESHORT)/
|
||||
dpkg-deb --build $(BUILDDIR)deb/$(NAMESHORT)
|
||||
cp -f $(BUILDDIR)deb/$(NAMESHORT).deb .
|
||||
|
||||
install: $(NAME)
|
||||
cp -f ./$(NAME) /usr/lib/
|
||||
mkdir -p /usr/include/$(NAMESHORT)/
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
Package: libmrbesen
|
||||
Version: 1.0
|
||||
Section: custom
|
||||
Priority: optional
|
||||
Architecture: all
|
||||
Essential: no
|
||||
Installed-Size: 8388608
|
||||
Maintainer: mrbesen.de
|
||||
Description: libmrbesen
|
|
@ -1,9 +0,0 @@
|
|||
headers = files([
|
||||
'config.h',
|
||||
'doy.h',
|
||||
'files.h',
|
||||
'mrbesen.h',
|
||||
'util.h',
|
||||
])
|
||||
|
||||
install_headers(headers, subdir: 'libmrbesen')
|
|
@ -1,9 +0,0 @@
|
|||
project('libmrbesen', 'cpp', default_options : ['cpp_std=c++17', 'warning_level=3'])
|
||||
|
||||
inc = include_directories('inc')
|
||||
|
||||
subdir('inc')
|
||||
subdir('src')
|
||||
|
||||
subdir('tests')
|
||||
|
|
@ -79,7 +79,7 @@ bool mrbesen::files::iterateFile(std::istream& file, fileLineCallback clb, bool
|
|||
|
||||
template<class Container>
|
||||
bool mrbesen::files::scan(const std::string& path, std::insert_iterator<Container> it, bool prefixdir, fileNameFilter fnf) {
|
||||
return scan(path, [&](const std::string& p, [[maybe_unused]] FileType t){ it = p; }, prefixdir, fnf);
|
||||
return scan(path, [&](const std::string& p, FileType t){ it = p; }, prefixdir, fnf);
|
||||
}
|
||||
|
||||
//curently only these are supported, because iterators may break on others upon insertion
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
libmrbesenSrc = files([
|
||||
'config.cpp',
|
||||
'doy.cpp',
|
||||
'files.cpp',
|
||||
'util.cpp',
|
||||
])
|
||||
|
||||
libmrbesen = both_libraries(
|
||||
'mrbesen',
|
||||
libmrbesenSrc,
|
||||
include_directories: inc,
|
||||
install: true,
|
||||
)
|
||||
|
||||
libmrbesen_dep = declare_dependency(
|
||||
link_with: libmrbesen.get_static_lib(),
|
||||
include_directories: inc
|
||||
)
|
|
@ -147,13 +147,11 @@ int testFiles_readFile() {
|
|||
|
||||
ASSERT(!files::readFile(NONEXISTENT_FILE, buf), "this file should not be read"); //try to read non existing file
|
||||
|
||||
const char* testfile = "tests/filestests.cpp";
|
||||
|
||||
bool r = files::readFile(std::string(testfile), buf);
|
||||
bool r = files::readFile(std::string("tests/filestests.cpp"), buf);
|
||||
ASSERT(r, "failed to read");
|
||||
|
||||
//alternative read
|
||||
int fd = open(testfile, O_RDONLY);
|
||||
int fd = open("tests/filestests.cpp", O_RDONLY);
|
||||
const unsigned int size = 1024*1024; //1MB
|
||||
char* buf2 = new char[size];
|
||||
ssize_t rc = read(fd, buf2, size);
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
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