Adiciona tinyblocks-syntax, tinyblocks-regex e tinyblocks-markdown (com testes)
This commit is contained in:
1 parent
c75d4be1c2
commit
a921f6574d
16 files changed
+1846
-4
No files matched your search
@@ -33,6 +33,10 @@ IMG_DIR := $(LIBDIR)/tinyblocks-image
|
||||
VG_DIR := $(LIBDIR)/tinyblocks-vg
|
||||
SVG_DIR := $(LIBDIR)/tinyblocks-svg
|
||||
JPG_DIR := $(LIBDIR)/tinyblocks-jpg
|
||||
SYN_DIR := $(LIBDIR)/tinyblocks-syntax
|
||||
RE_DIR := $(LIBDIR)/tinyblocks-regex
|
||||
MD_DIR := $(LIBDIR)/tinyblocks-markdown
|
||||
OT_DIR := $(LIBDIR)/tinyblocks-opentype
|
||||
API_DIR := $(LIBDIR)/tinyblocks-api
|
||||
LIBM_DIR := $(LIBDIR)/tinyblocks-libman
|
||||
ED_DIR := $(LIBDIR)/tinyblocks-editor
|
||||
@@ -89,11 +93,12 @@ LIB_LDFLAGS := -L$(ED_DIR)/build -L$(GX_DIR)/build -L$(SD_DIR)/build \
|
||||
editor run-editor run-sdl2 mylib vector customappearance graphics sdl2-backend test-editor \
|
||||
appdir appimage run-appimage icon \
|
||||
test-toml test-plugin test-blueprint test-base64 test-curves test-ppm test-bmp test-png test-image test-vg test-svg test-jpg \
|
||||
test-syntax test-regex test-markdown test-opentype \
|
||||
category-libs category-sos libs \
|
||||
lib-events lib-control lib-operators lib-variables lib-appearance lib-pen lib-fs \
|
||||
lib-environ \
|
||||
lib-editor lib-graphics lib-sdl2 lib-python lib-mcp lib-toml \
|
||||
lib-json lib-xml lib-csv lib-blueprint lib-base64 lib-curves lib-ppm lib-bmp lib-png lib-image lib-vg lib-svg lib-jpg lib-api lib-libman \
|
||||
lib-json lib-xml lib-csv lib-blueprint lib-base64 lib-curves lib-ppm lib-bmp lib-png lib-image lib-vg lib-svg lib-jpg lib-syntax lib-regex lib-markdown lib-opentype lib-api lib-libman \
|
||||
test-libman test-environ
|
||||
|
||||
all: static example ## Compila a biblioteca estática e o exemplo hello (padrão)
|
||||
@@ -196,6 +201,18 @@ lib-svg: lib-vg lib-base64
|
||||
lib-jpg:
|
||||
$(MAKE) -C $(JPG_DIR)
|
||||
|
||||
lib-syntax:
|
||||
$(MAKE) -C $(SYN_DIR)
|
||||
|
||||
lib-regex:
|
||||
$(MAKE) -C $(RE_DIR)
|
||||
|
||||
lib-markdown:
|
||||
$(MAKE) -C $(MD_DIR)
|
||||
|
||||
lib-opentype:
|
||||
$(MAKE) -C $(OT_DIR)
|
||||
|
||||
lib-api:
|
||||
$(MAKE) -C $(API_DIR)
|
||||
|
||||
@@ -216,8 +233,8 @@ lib-mcp:
|
||||
|
||||
libs: static lib-events lib-control lib-operators lib-variables \
|
||||
lib-appearance lib-pen lib-fs lib-environ lib-graphics lib-sdl2 lib-toml \
|
||||
lib-json lib-xml lib-csv lib-blueprint lib-base64 lib-curves lib-ppm lib-bmp lib-png lib-image lib-vg lib-svg lib-jpg lib-api lib-libman lib-editor
|
||||
@echo "Libraries OK: category + graphics + sdl2 + toml + json + xml + csv + blueprint + base64 + curves + ppm + bmp + png + image + vg + svg + jpg + api + libman + editor"
|
||||
lib-json lib-xml lib-csv lib-blueprint lib-base64 lib-curves lib-ppm lib-bmp lib-png lib-image lib-vg lib-svg lib-jpg lib-syntax lib-regex lib-markdown lib-opentype lib-api lib-libman lib-editor
|
||||
@echo "Libraries OK: category + graphics + sdl2 + toml + json + xml + csv + blueprint + base64 + curves + ppm + bmp + png + image + vg + svg + jpg + syntax + regex + markdown + opentype + api + libman + editor"
|
||||
|
||||
category-libs: static $(foreach l,$(CAT_LIBS),lib-$(l)) ## Compila as libraries de categoria (.a/.so)
|
||||
@echo "Build category libs OK"
|
||||
@@ -510,6 +527,10 @@ test-bmp: $(BUILD)/bmp_test ## Roda o teste da bmp (ASan/UBSan)
|
||||
# -- Teste da library png (libpng) ---
|
||||
PNG_CFLAGS := $(shell pkg-config --cflags libpng 2>/dev/null)
|
||||
PNG_LIBS := $(shell pkg-config --libs libpng 2>/dev/null)
|
||||
|
||||
FREETYPE_CFLAGS := $(shell pkg-config --cflags freetype2 2>/dev/null)
|
||||
FREETYPE_LIBS := $(shell pkg-config --libs freetype2 2>/dev/null)
|
||||
EXTRA_TEST_LIBS :=
|
||||
$(BUILD)/png_test: tests/png_test.c $(PNG_DIR)/src/tb_png.c static
|
||||
@mkdir -p $(BUILD)
|
||||
$(CC) $(CFLAGS_DBG) $(PNG_CFLAGS) -I$(PNG_DIR)/include $(PNG_DIR)/src/tb_png.c \
|
||||
@@ -551,6 +572,39 @@ $(BUILD)/svg_test: tests/svg_test.c $(SVG_DIR)/src/tb_svg.c $(VG_DIR)/src/tb_vg.
|
||||
test-svg: $(BUILD)/svg_test ## Roda o teste da svg (ASan/UBSan)
|
||||
./$(BUILD)/svg_test
|
||||
|
||||
# -- Testes das libraries de texto/sintaxe -------------------------------
|
||||
$(BUILD)/syntax_test: tests/syntax_test.c $(SYN_DIR)/src/tb_syntax.c static
|
||||
@mkdir -p $(BUILD)
|
||||
$(CC) $(CFLAGS_DBG) -I$(SYN_DIR)/include $(SYN_DIR)/src/tb_syntax.c tests/syntax_test.c \
|
||||
-o $@ -Wl,--start-group $(LIB_A) -Wl,--end-group $(EXTRA_TEST_LIBS)
|
||||
|
||||
test-syntax: $(BUILD)/syntax_test ## Roda o teste da syntax (ASan/UBSan)
|
||||
./$(BUILD)/syntax_test
|
||||
|
||||
$(BUILD)/regex_test: tests/regex_test.c $(RE_DIR)/src/tb_regex.c static
|
||||
@mkdir -p $(BUILD)
|
||||
$(CC) $(CFLAGS_DBG) -I$(RE_DIR)/include $(RE_DIR)/src/tb_regex.c tests/regex_test.c \
|
||||
-o $@ -Wl,--start-group $(LIB_A) -Wl,--end-group $(EXTRA_TEST_LIBS)
|
||||
|
||||
test-regex: $(BUILD)/regex_test ## Roda o teste da regex (ASan/UBSan)
|
||||
./$(BUILD)/regex_test
|
||||
|
||||
$(BUILD)/markdown_test: tests/markdown_test.c $(MD_DIR)/src/tb_markdown.c static
|
||||
@mkdir -p $(BUILD)
|
||||
$(CC) $(CFLAGS_DBG) -I$(MD_DIR)/include $(MD_DIR)/src/tb_markdown.c tests/markdown_test.c \
|
||||
-o $@ -Wl,--start-group $(LIB_A) -Wl,--end-group $(EXTRA_TEST_LIBS)
|
||||
|
||||
test-markdown: $(BUILD)/markdown_test ## Roda o teste da markdown (ASan/UBSan)
|
||||
./$(BUILD)/markdown_test
|
||||
|
||||
$(BUILD)/opentype_test: tests/opentype_test.c $(OT_DIR)/src/tb_opentype.c static
|
||||
@mkdir -p $(BUILD)
|
||||
$(CC) $(CFLAGS_DBG) -I$(OT_DIR)/include $(OT_DIR)/src/tb_opentype.c tests/opentype_test.c \
|
||||
-o $@ -Wl,--start-group $(LIB_A) -Wl,--end-group $(FREETYPE_LIBS) $(EXTRA_TEST_LIBS)
|
||||
|
||||
test-opentype: $(BUILD)/opentype_test ## Roda o teste da opentype (ASan/UBSan)
|
||||
./$(BUILD)/opentype_test
|
||||
|
||||
# -- Teste da library jpg (libjpeg; pulado se os headers faltarem) ---
|
||||
JPG_TEST_AVAILABLE := $(shell printf '#include <jpeglib.h>\nint main(void){return 0;}\n' | \
|
||||
$(CC) -xc - -ljpeg -o /dev/null >/dev/null 2>&1 && echo yes)
|
||||
@@ -584,7 +638,7 @@ clean: ## Remove os diretórios build/ (raiz e libraries)
|
||||
$(RM) -r $(BUILD)
|
||||
@for d in $(EV_DIR) $(CT_DIR) $(OP_DIR) $(VR_DIR) $(AP_DIR) $(PN_DIR) $(FS_DIR) \
|
||||
$(TOML_DIR) $(JSON_DIR) $(XML_DIR) $(CSV_DIR) $(BP_DIR) \
|
||||
$(B64_DIR) $(CV_DIR) $(PPM_DIR) $(BMP_DIR) $(PNG_DIR) $(IMG_DIR) $(VG_DIR) $(SVG_DIR) $(JPG_DIR) \
|
||||
$(B64_DIR) $(CV_DIR) $(PPM_DIR) $(BMP_DIR) $(PNG_DIR) $(IMG_DIR) $(VG_DIR) $(SVG_DIR) $(JPG_DIR) $(SYN_DIR) $(RE_DIR) $(MD_DIR) $(OT_DIR) \
|
||||
$(API_DIR) $(LIBM_DIR) \
|
||||
$(ED_DIR) $(GX_DIR) $(SD_DIR) $(PY_DIR) $(MC_DIR); do \
|
||||
$(MAKE) -C $$d clean >/dev/null 2>&1 || true; \
|
||||
|
||||
Reference in new issue
Block a user