aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2016-09-03 19:57:54 +0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2016-09-03 20:28:55 +0200
commit74ca21a41bcb5a49d19e65c9ba88f1f864cb7095 (patch)
tree4774587e47abc0ff20453abbf714b63c36697f26
parent30ae5fd4f65f48009e6956e42ccc2c9d9ad80901 (diff)
downloadblogc-74ca21a41bcb5a49d19e65c9ba88f1f864cb7095.tar.gz
blogc-74ca21a41bcb5a49d19e65c9ba88f1f864cb7095.tar.bz2
blogc-74ca21a41bcb5a49d19e65c9ba88f1f864cb7095.zip
*: big code reorganization.
- source and tests are now splitted by target - utils lib is now called common still pending move error.c from blogc to common
-rw-r--r--Makefile.am193
-rw-r--r--src/blogc-git-receiver/main.c (renamed from src/blogc-git-receiver.c)2
-rw-r--r--src/blogc-runserver/main.c (renamed from src/blogc-runserver.c)2
-rw-r--r--src/blogc/content-parser.c (renamed from src/content-parser.c)2
-rw-r--r--src/blogc/content-parser.h (renamed from src/content-parser.h)0
-rw-r--r--src/blogc/datetime-parser.c (renamed from src/datetime-parser.c)2
-rw-r--r--src/blogc/datetime-parser.h (renamed from src/datetime-parser.h)0
-rw-r--r--src/blogc/debug.c (renamed from src/debug.c)2
-rw-r--r--src/blogc/debug.h (renamed from src/debug.h)2
-rw-r--r--src/blogc/error.c (renamed from src/error.c)2
-rw-r--r--src/blogc/error.h (renamed from src/error.h)0
-rw-r--r--src/blogc/file.c (renamed from src/file.c)4
-rw-r--r--src/blogc/file.h (renamed from src/file.h)0
-rw-r--r--src/blogc/loader.c (renamed from src/loader.c)2
-rw-r--r--src/blogc/loader.h (renamed from src/loader.h)2
-rw-r--r--src/blogc/main.c (renamed from src/blogc.c)4
-rw-r--r--src/blogc/renderer.c (renamed from src/renderer.c)2
-rw-r--r--src/blogc/renderer.h (renamed from src/renderer.h)2
-rw-r--r--src/blogc/source-parser.c (renamed from src/source-parser.c)2
-rw-r--r--src/blogc/source-parser.h (renamed from src/source-parser.h)2
-rw-r--r--src/blogc/template-parser.c (renamed from src/template-parser.c)2
-rw-r--r--src/blogc/template-parser.h (renamed from src/template-parser.h)2
-rw-r--r--src/common/utf8.c (renamed from src/utf8.c)0
-rw-r--r--src/common/utf8.h (renamed from src/utf8.h)0
-rw-r--r--src/common/utils.c (renamed from src/utils.c)0
-rw-r--r--src/common/utils.h (renamed from src/utils.h)0
-rw-r--r--tests/blogc/check_content_parser.c (renamed from tests/check_content_parser.c)2
-rw-r--r--tests/blogc/check_datetime_parser.c (renamed from tests/check_datetime_parser.c)4
-rw-r--r--tests/blogc/check_error.c (renamed from tests/check_error.c)2
-rw-r--r--tests/blogc/check_loader.c (renamed from tests/check_loader.c)8
-rw-r--r--tests/blogc/check_renderer.c (renamed from tests/check_renderer.c)10
-rw-r--r--tests/blogc/check_source_parser.c (renamed from tests/check_source_parser.c)6
-rw-r--r--tests/blogc/check_template_parser.c (renamed from tests/check_template_parser.c)6
-rw-r--r--tests/common/check_utf8.c (renamed from tests/check_utf8.c)4
-rw-r--r--tests/common/check_utils.c (renamed from tests/check_utils.c)2
35 files changed, 135 insertions, 140 deletions
diff --git a/Makefile.am b/Makefile.am
index 2582881..179321c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -32,22 +32,22 @@ BUILT_SOURCES = \
$(NULL)
noinst_HEADERS = \
- src/content-parser.h \
- src/datetime-parser.h \
- src/debug.h \
- src/error.h \
- src/file.h \
- src/loader.h \
- src/renderer.h \
- src/source-parser.h \
- src/template-parser.h \
- src/utf8.h \
- src/utils.h \
+ src/blogc/content-parser.h \
+ src/blogc/datetime-parser.h \
+ src/blogc/debug.h \
+ src/blogc/error.h \
+ src/blogc/file.h \
+ src/blogc/loader.h \
+ src/blogc/renderer.h \
+ src/blogc/source-parser.h \
+ src/blogc/template-parser.h \
+ src/common/utf8.h \
+ src/common/utils.h \
$(NULL)
noinst_LTLIBRARIES = \
libblogc.la \
- libblogc_utils.la \
+ libblogc_common.la \
$(NULL)
noinst_PROGRAMS = \
@@ -74,19 +74,18 @@ check_PROGRAMS = \
libblogc_la_SOURCES = \
- src/content-parser.c \
- src/datetime-parser.c \
- src/error.c \
- src/file.c \
- src/loader.c \
- src/renderer.c \
- src/source-parser.c \
- src/template-parser.c \
+ src/blogc/content-parser.c \
+ src/blogc/datetime-parser.c \
+ src/blogc/error.c \
+ src/blogc/file.c \
+ src/blogc/loader.c \
+ src/blogc/renderer.c \
+ src/blogc/source-parser.c \
+ src/blogc/template-parser.c \
$(NULL)
libblogc_la_CFLAGS = \
$(AM_CFLAGS) \
- -I$(top_srcdir)/src \
$(NULL)
libblogc_la_LIBADD = \
@@ -94,57 +93,53 @@ libblogc_la_LIBADD = \
$(NULL)
-libblogc_utils_la_SOURCES = \
- src/utf8.c \
- src/utils.c \
+libblogc_common_la_SOURCES = \
+ src/common/utf8.c \
+ src/common/utils.c \
$(NULL)
-libblogc_utils_la_CFLAGS = \
+libblogc_common_la_CFLAGS = \
$(AM_CFLAGS) \
- -I$(top_srcdir)/src \
$(NULL)
blogc_SOURCES = \
- src/blogc.c \
- src/debug.c \
+ src/blogc/main.c \
+ src/blogc/debug.c \
$(NULL)
blogc_CFLAGS = \
$(AM_CFLAGS) \
- -I$(top_srcdir)/src \
$(NULL)
blogc_LDADD = \
libblogc.la \
- libblogc_utils.la \
+ libblogc_common.la \
$(NULL)
if BUILD_GIT_RECEIVER
blogc_git_receiver_SOURCES = \
- src/blogc-git-receiver.c \
+ src/blogc-git-receiver/main.c \
$(NULL)
blogc_git_receiver_CFLAGS = \
$(AM_CFLAGS) \
- -I$(top_srcdir)/src \
$(NULL)
blogc_git_receiver_LDADD = \
- libblogc_utils.la \
+ libblogc_common.la \
$(NULL)
endif
if BUILD_RUNSERVER
blogc_runserver_SOURCES = \
- src/blogc-runserver.c \
+ src/blogc-runserver/main.c \
$(NULL)
blogc_runserver_CFLAGS = \
$(AM_CFLAGS) \
- -I$(top_srcdir)/src \
$(LIBEVENT_CFLAGS) \
$(SQUAREBALL_CFLAGS) \
$(NULL)
@@ -152,7 +147,7 @@ blogc_runserver_CFLAGS = \
blogc_runserver_LDADD = \
$(LIBEVENT_LIBS) \
$(MAGIC_LIBS) \
- libblogc_utils.la \
+ libblogc_common.la \
$(NULL)
endif
@@ -272,177 +267,177 @@ endif
if USE_CMOCKA
check_PROGRAMS += \
- tests/check_content_parser \
- tests/check_datetime_parser \
- tests/check_error \
- tests/check_loader \
- tests/check_renderer \
- tests/check_source_parser \
- tests/check_template_parser \
- tests/check_utf8 \
- tests/check_utils \
+ tests/blogc/check_content_parser \
+ tests/blogc/check_datetime_parser \
+ tests/blogc/check_error \
+ tests/blogc/check_loader \
+ tests/blogc/check_renderer \
+ tests/blogc/check_source_parser \
+ tests/blogc/check_template_parser \
+ tests/common/check_utf8 \
+ tests/common/check_utils \
$(NULL)
-tests_check_error_SOURCES = \
- tests/check_error.c \
+tests_blogc_check_error_SOURCES = \
+ tests/blogc/check_error.c \
$(NULL)
-tests_check_error_CFLAGS = \
+tests_blogc_check_error_CFLAGS = \
$(CMOCKA_CFLAGS) \
$(NULL)
-tests_check_error_LDFLAGS = \
+tests_blogc_check_error_LDFLAGS = \
-no-install \
$(NULL)
-tests_check_error_LDADD = \
+tests_blogc_check_error_LDADD = \
$(CMOCKA_LIBS) \
libblogc.la \
- libblogc_utils.la \
+ libblogc_common.la \
$(NULL)
-tests_check_loader_SOURCES = \
- tests/check_loader.c \
+tests_blogc_check_loader_SOURCES = \
+ tests/blogc/check_loader.c \
$(NULL)
-tests_check_loader_CFLAGS = \
+tests_blogc_check_loader_CFLAGS = \
$(CMOCKA_CFLAGS) \
$(NULL)
-tests_check_loader_LDFLAGS = \
+tests_blogc_check_loader_LDFLAGS = \
-no-install \
-Wl,--wrap=blogc_file_get_contents \
-Wl,--wrap=blogc_fprintf \
$(NULL)
-tests_check_loader_LDADD = \
+tests_blogc_check_loader_LDADD = \
$(CMOCKA_LIBS) \
libblogc.la \
- libblogc_utils.la \
+ libblogc_common.la \
$(NULL)
-tests_check_content_parser_SOURCES = \
- tests/check_content_parser.c \
+tests_blogc_check_content_parser_SOURCES = \
+ tests/blogc/check_content_parser.c \
$(NULL)
-tests_check_content_parser_CFLAGS = \
+tests_blogc_check_content_parser_CFLAGS = \
$(CMOCKA_CFLAGS) \
$(NULL)
-tests_check_content_parser_LDFLAGS = \
+tests_blogc_check_content_parser_LDFLAGS = \
-no-install \
$(NULL)
-tests_check_content_parser_LDADD = \
+tests_blogc_check_content_parser_LDADD = \
$(CMOCKA_LIBS) \
libblogc.la \
- libblogc_utils.la \
+ libblogc_common.la \
$(NULL)
-tests_check_datetime_parser_SOURCES = \
- tests/check_datetime_parser.c \
+tests_blogc_check_datetime_parser_SOURCES = \
+ tests/blogc/check_datetime_parser.c \
$(NULL)
-tests_check_datetime_parser_CFLAGS = \
+tests_blogc_check_datetime_parser_CFLAGS = \
$(CMOCKA_CFLAGS) \
$(NULL)
-tests_check_datetime_parser_LDFLAGS = \
+tests_blogc_check_datetime_parser_LDFLAGS = \
-no-install \
$(NULL)
-tests_check_datetime_parser_LDADD = \
+tests_blogc_check_datetime_parser_LDADD = \
$(CMOCKA_LIBS) \
libblogc.la \
- libblogc_utils.la \
+ libblogc_common.la \
$(NULL)
-tests_check_renderer_SOURCES = \
- tests/check_renderer.c \
+tests_blogc_check_renderer_SOURCES = \
+ tests/blogc/check_renderer.c \
$(NULL)
-tests_check_renderer_CFLAGS = \
+tests_blogc_check_renderer_CFLAGS = \
$(CMOCKA_CFLAGS) \
$(NULL)
-tests_check_renderer_LDFLAGS = \
+tests_blogc_check_renderer_LDFLAGS = \
-no-install \
$(NULL)
-tests_check_renderer_LDADD = \
+tests_blogc_check_renderer_LDADD = \
$(CMOCKA_LIBS) \
libblogc.la \
- libblogc_utils.la \
+ libblogc_common.la \
$(NULL)
-tests_check_source_parser_SOURCES = \
- tests/check_source_parser.c \
+tests_blogc_check_source_parser_SOURCES = \
+ tests/blogc/check_source_parser.c \
$(NULL)
-tests_check_source_parser_CFLAGS = \
+tests_blogc_check_source_parser_CFLAGS = \
$(CMOCKA_CFLAGS) \
$(NULL)
-tests_check_source_parser_LDFLAGS = \
+tests_blogc_check_source_parser_LDFLAGS = \
-no-install \
$(NULL)
-tests_check_source_parser_LDADD = \
+tests_blogc_check_source_parser_LDADD = \
$(CMOCKA_LIBS) \
libblogc.la \
- libblogc_utils.la \
+ libblogc_common.la \
$(NULL)
-tests_check_template_parser_SOURCES = \
- tests/check_template_parser.c \
+tests_blogc_check_template_parser_SOURCES = \
+ tests/blogc/check_template_parser.c \
$(NULL)
-tests_check_template_parser_CFLAGS = \
+tests_blogc_check_template_parser_CFLAGS = \
$(CMOCKA_CFLAGS) \
$(NULL)
-tests_check_template_parser_LDFLAGS = \
+tests_blogc_check_template_parser_LDFLAGS = \
-no-install \
$(NULL)
-tests_check_template_parser_LDADD = \
+tests_blogc_check_template_parser_LDADD = \
$(CMOCKA_LIBS) \
libblogc.la \
- libblogc_utils.la \
+ libblogc_common.la \
$(NULL)
-tests_check_utf8_SOURCES = \
- tests/check_utf8.c \
+tests_common_check_utf8_SOURCES = \
+ tests/common/check_utf8.c \
$(NULL)
-tests_check_utf8_CFLAGS = \
+tests_common_check_utf8_CFLAGS = \
$(CMOCKA_CFLAGS) \
$(NULL)
-tests_check_utf8_LDFLAGS = \
+tests_common_check_utf8_LDFLAGS = \
-no-install \
$(NULL)
-tests_check_utf8_LDADD = \
+tests_common_check_utf8_LDADD = \
$(CMOCKA_LIBS) \
- libblogc_utils.la \
+ libblogc_common.la \
$(NULL)
-tests_check_utils_SOURCES = \
- tests/check_utils.c \
+tests_common_check_utils_SOURCES = \
+ tests/common/check_utils.c \
$(NULL)
-tests_check_utils_CFLAGS = \
+tests_common_check_utils_CFLAGS = \
$(CMOCKA_CFLAGS) \
$(NULL)
-tests_check_utils_LDFLAGS = \
+tests_common_check_utils_LDFLAGS = \
-no-install \
$(NULL)
-tests_check_utils_LDADD = \
+tests_common_check_utils_LDADD = \
$(CMOCKA_LIBS) \
- libblogc_utils.la \
+ libblogc_common.la \
$(NULL)
endif
diff --git a/src/blogc-git-receiver.c b/src/blogc-git-receiver/main.c
index 820fce5..554ec0c 100644
--- a/src/blogc-git-receiver.c
+++ b/src/blogc-git-receiver/main.c
@@ -18,7 +18,7 @@
#include <dirent.h>
#include <time.h>
-#include "utils.h"
+#include "../common/utils.h"
#ifndef BUFFER_SIZE
#define BUFFER_SIZE 4096
diff --git a/src/blogc-runserver.c b/src/blogc-runserver/main.c
index 2fbbbc7..2a756f1 100644
--- a/src/blogc-runserver.c
+++ b/src/blogc-runserver/main.c
@@ -23,7 +23,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
-#include "utils.h"
+#include "../common/utils.h"
/**
diff --git a/src/content-parser.c b/src/blogc/content-parser.c
index ca0597b..e751548 100644
--- a/src/content-parser.c
+++ b/src/blogc/content-parser.c
@@ -11,7 +11,7 @@
#include <string.h>
#include "content-parser.h"
-#include "utils.h"
+#include "../common/utils.h"
// this is a half ass implementation of a markdown-like syntax. bugs are
// expected. feel free to improve the parser and add new features.
diff --git a/src/content-parser.h b/src/blogc/content-parser.h
index 37e38d7..37e38d7 100644
--- a/src/content-parser.h
+++ b/src/blogc/content-parser.h
diff --git a/src/datetime-parser.c b/src/blogc/datetime-parser.c
index ad65ff7..28efb74 100644
--- a/src/datetime-parser.c
+++ b/src/blogc/datetime-parser.c
@@ -18,7 +18,7 @@
#include "error.h"
#include "datetime-parser.h"
-#include "utils.h"
+#include "../common/utils.h"
typedef enum {
diff --git a/src/datetime-parser.h b/src/blogc/datetime-parser.h
index a5087b3..a5087b3 100644
--- a/src/datetime-parser.h
+++ b/src/blogc/datetime-parser.h
diff --git a/src/debug.c b/src/blogc/debug.c
index 9689028..2840f60 100644
--- a/src/debug.c
+++ b/src/blogc/debug.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include "template-parser.h"
-#include "utils.h"
+#include "../common/utils.h"
#include "debug.h"
diff --git a/src/debug.h b/src/blogc/debug.h
index cd454d4..eb4e2c1 100644
--- a/src/debug.h
+++ b/src/blogc/debug.h
@@ -9,7 +9,7 @@
#ifndef ___DEBUG_H
#define ___DEBUG_H
-#include "utils.h"
+#include "../common/utils.h"
void blogc_debug_template(sb_slist_t *stmts);
diff --git a/src/error.c b/src/blogc/error.c
index c238f51..41f4cd0 100644
--- a/src/error.c
+++ b/src/blogc/error.c
@@ -10,7 +10,7 @@
#include <stdlib.h>
#include <stdarg.h>
#include "error.h"
-#include "utils.h"
+#include "../common/utils.h"
blogc_error_t*
diff --git a/src/error.h b/src/blogc/error.h
index 31fbaf2..31fbaf2 100644
--- a/src/error.h
+++ b/src/blogc/error.h
diff --git a/src/file.c b/src/blogc/file.c
index dc43056..b3b0c5b 100644
--- a/src/file.c
+++ b/src/blogc/file.c
@@ -14,8 +14,8 @@
#include <string.h>
#include "file.h"
#include "error.h"
-#include "utf8.h"
-#include "utils.h"
+#include "../common/utf8.h"
+#include "../common/utils.h"
// this would belong to loader.c, but we need it in a separated file to be
// able to mock it when unit testing the loader functions.
diff --git a/src/file.h b/src/blogc/file.h
index d2c4390..d2c4390 100644
--- a/src/file.h
+++ b/src/blogc/file.h
diff --git a/src/loader.c b/src/blogc/loader.c
index bd3251e..90f2401 100644
--- a/src/loader.c
+++ b/src/blogc/loader.c
@@ -17,7 +17,7 @@
#include "template-parser.h"
#include "loader.h"
#include "error.h"
-#include "utils.h"
+#include "../common/utils.h"
char*
diff --git a/src/loader.h b/src/blogc/loader.h
index 32b58be..c54d11a 100644
--- a/src/loader.h
+++ b/src/blogc/loader.h
@@ -10,7 +10,7 @@
#define _LOADER_H
#include "error.h"
-#include "utils.h"
+#include "../common/utils.h"
char* blogc_get_filename(const char *f);
sb_slist_t* blogc_template_parse_from_file(const char *f, blogc_error_t **err);
diff --git a/src/blogc.c b/src/blogc/main.c
index c90070d..03f43ae 100644
--- a/src/blogc.c
+++ b/src/blogc/main.c
@@ -27,8 +27,8 @@
#include "loader.h"
#include "renderer.h"
#include "error.h"
-#include "utf8.h"
-#include "utils.h"
+#include "../common/utf8.h"
+#include "../common/utils.h"
#ifndef PACKAGE_VERSION
#define PACKAGE_VERSION "Unknown"
diff --git a/src/renderer.c b/src/blogc/renderer.c
index 27e92bd..97a226e 100644
--- a/src/renderer.c
+++ b/src/blogc/renderer.c
@@ -16,7 +16,7 @@
#include "error.h"
#include "template-parser.h"
#include "renderer.h"
-#include "utils.h"
+#include "../common/utils.h"
const char*
diff --git a/src/renderer.h b/src/blogc/renderer.h
index 2982ee8..f7f5328 100644
--- a/src/renderer.h
+++ b/src/blogc/renderer.h
@@ -10,7 +10,7 @@
#define _RENDERER_H
#include <stdbool.h>
-#include "utils.h"
+#include "../common/utils.h"
const char* blogc_get_variable(const char *name, sb_trie_t *global, sb_trie_t *local);
char* blogc_format_date(const char *date, sb_trie_t *global, sb_trie_t *local);
diff --git a/src/source-parser.c b/src/blogc/source-parser.c
index 5d29213..4472096 100644
--- a/src/source-parser.c
+++ b/src/blogc/source-parser.c
@@ -12,7 +12,7 @@
#include "content-parser.h"
#include "source-parser.h"
#include "error.h"
-#include "utils.h"
+#include "../common/utils.h"
typedef enum {
diff --git a/src/source-parser.h b/src/blogc/source-parser.h
index 0d54742..895cb1b 100644
--- a/src/source-parser.h
+++ b/src/blogc/source-parser.h
@@ -11,7 +11,7 @@
#include <stddef.h>
#include "error.h"
-#include "utils.h"
+#include "../common/utils.h"
sb_trie_t* blogc_source_parse(const char *src, size_t src_len,
blogc_error_t **err);
diff --git a/src/template-parser.c b/src/blogc/template-parser.c
index 6ca6eb7..15750f1 100644
--- a/src/template-parser.c
+++ b/src/blogc/template-parser.c
@@ -12,7 +12,7 @@
#include "template-parser.h"
#include "error.h"
-#include "utils.h"
+#include "../common/utils.h"
typedef enum {
diff --git a/src/template-parser.h b/src/blogc/template-parser.h
index 19df6af..41a2b3a 100644
--- a/src/template-parser.h
+++ b/src/blogc/template-parser.h
@@ -11,7 +11,7 @@
#include <stddef.h>
#include "error.h"
-#include "utils.h"
+#include "../common/utils.h"
/*
* note: whitespace cleaners are NOT added to ast. we fix strings right during
diff --git a/src/utf8.c b/src/common/utf8.c
index a2f4fdd..a2f4fdd 100644
--- a/src/utf8.c
+++ b/src/common/utf8.c
diff --git a/src/utf8.h b/src/common/utf8.h
index 06fe07e..06fe07e 100644
--- a/src/utf8.h
+++ b/src/common/utf8.h
diff --git a/src/utils.c b/src/common/utils.c
index b42ae4e..b42ae4e 100644
--- a/src/utils.c
+++ b/src/common/utils.c
diff --git a/src/utils.h b/src/common/utils.h
index aca02c0..aca02c0 100644
--- a/src/utils.h
+++ b/src/common/utils.h
diff --git a/tests/check_content_parser.c b/tests/blogc/check_content_parser.c
index 79b31c3..6cc58ff 100644
--- a/tests/check_content_parser.c
+++ b/tests/blogc/check_content_parser.c
@@ -11,7 +11,7 @@
#include <setjmp.h>
#include <cmocka.h>
#include <stdlib.h>
-#include "../src/content-parser.h"
+#include "../../src/blogc/content-parser.h"
static void
diff --git a/tests/check_datetime_parser.c b/tests/blogc/check_datetime_parser.c
index 03f5a9a..ec0f120 100644
--- a/tests/check_datetime_parser.c
+++ b/tests/blogc/check_datetime_parser.c
@@ -12,8 +12,8 @@
#include <cmocka.h>
#include <stdlib.h>
#include <locale.h>
-#include "../src/error.h"
-#include "../src/datetime-parser.h"
+#include "../../src/blogc/error.h"
+#include "../../src/blogc/datetime-parser.h"
static void
diff --git a/tests/check_error.c b/tests/blogc/check_error.c
index e844998..9976ac2 100644
--- a/tests/check_error.c
+++ b/tests/blogc/check_error.c
@@ -11,7 +11,7 @@
#include <setjmp.h>
#include <cmocka.h>
#include <string.h>
-#include "../src/error.h"
+#include "../../src/blogc/error.h"
static void
diff --git a/tests/check_loader.c b/tests/blogc/check_loader.c
index 44468c8..8d3d9d6 100644
--- a/tests/check_loader.c
+++ b/tests/blogc/check_loader.c
@@ -13,10 +13,10 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
-#include "../src/error.h"
-#include "../src/template-parser.h"
-#include "../src/loader.h"
-#include "../src/utils.h"
+#include "../../src/blogc/error.h"
+#include "../../src/blogc/template-parser.h"
+#include "../../src/blogc/loader.h"
+#include "../../src/common/utils.h"
static void
diff --git a/tests/check_renderer.c b/tests/blogc/check_renderer.c
index c2c5618..c058788 100644
--- a/tests/check_renderer.c
+++ b/tests/blogc/check_renderer.c
@@ -13,11 +13,11 @@
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
-#include "../src/error.h"
-#include "../src/renderer.h"
-#include "../src/source-parser.h"
-#include "../src/template-parser.h"
-#include "../src/utils.h"
+#include "../../src/blogc/error.h"
+#include "../../src/blogc/renderer.h"
+#include "../../src/blogc/source-parser.h"
+#include "../../src/blogc/template-parser.h"
+#include "../../src/common/utils.h"
static sb_slist_t*
diff --git a/tests/check_source_parser.c b/tests/blogc/check_source_parser.c
index bbd9ec6..a1849eb 100644
--- a/tests/check_source_parser.c
+++ b/tests/blogc/check_source_parser.c
@@ -11,9 +11,9 @@
#include <setjmp.h>
#include <cmocka.h>
#include <string.h>
-#include "../src/source-parser.h"
-#include "../src/error.h"
-#include "../src/utils.h"
+#include "../../src/blogc/source-parser.h"
+#include "../../src/blogc/error.h"
+#include "../../src/common/utils.h"
static void
diff --git a/tests/check_template_parser.c b/tests/blogc/check_template_parser.c
index da6a184..3c88fe4 100644
--- a/tests/check_template_parser.c
+++ b/tests/blogc/check_template_parser.c
@@ -11,9 +11,9 @@
#include <setjmp.h>
#include <cmocka.h>
#include <string.h>
-#include "../src/template-parser.h"
-#include "../src/error.h"
-#include "../src/utils.h"
+#include "../../src/blogc/template-parser.h"
+#include "../../src/blogc/error.h"
+#include "../../src/common/utils.h"
static void
diff --git a/tests/check_utf8.c b/tests/common/check_utf8.c
index e7be61e..d104265 100644
--- a/tests/check_utf8.c
+++ b/tests/common/check_utf8.c
@@ -13,8 +13,8 @@
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
-#include "../src/utf8.h"
-#include "../src/utils.h"
+#include "../../src/common/utf8.h"
+#include "../../src/common/utils.h"
// this file MUST be ASCII
diff --git a/tests/check_utils.c b/tests/common/check_utils.c
index 1750aa2..a9ec316 100644
--- a/tests/check_utils.c
+++ b/tests/common/check_utils.c
@@ -12,7 +12,7 @@
#include <cmocka.h>
#include <stdbool.h>
#include <stdlib.h>
-#include "../src/utils.h"
+#include "../../src/common/utils.h"
#define SB_STRING_CHUNK_SIZE 128