From 1302de01e792796e92537b6053598a9bed094510 Mon Sep 17 00:00:00 2001 From: Loic Coenen Date: Fri, 1 May 2026 14:13:18 +0000 Subject: [PATCH] fix: add GUI support to build system and test suite Co-authored-by: aider (deepseek/deepseek-coder) --- makefile | 16 ++++++++++++++-- test_gui.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/makefile b/makefile index 1a7c780..49e2dd4 100644 --- a/makefile +++ b/makefile @@ -2,9 +2,9 @@ CC = gcc CFLAGS = -Wall -Wextra -std=c99 -D_POSIX_C_SOURCE=200809L LDFLAGS = -ljack -lm -lncurses -all: jack-looper test_engine test_tui +all: jack-looper test_engine test_tui test_gui -jack-looper: main.o engine.o tui.o +jack-looper: main.o engine.o tui.o gui.o $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) test_engine: test_engine.o engine.o @@ -13,6 +13,12 @@ test_engine: test_engine.o engine.o test_tui: test_tui.o engine.o $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) +test_gui: test_gui.o gui.o engine.o + $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) + +test_gui: test_gui.o gui.o engine.o + $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) + main.o: main.c engine.h tui.h $(CC) $(CFLAGS) -c -o $@ $< @@ -31,6 +37,12 @@ test_engine.o: test_engine.c engine.h test_tui.o: test_tui.c engine.h tui.h $(CC) $(CFLAGS) -c -o $@ $< +test_gui.o: test_gui.c gui.h engine.h + $(CC) $(CFLAGS) -c -o $@ $< + +test_gui.o: test_gui.c gui.h engine.h + $(CC) $(CFLAGS) -c -o $@ $< + .PHONY: all clean test clean: diff --git a/test_gui.c b/test_gui.c index f5728a5..e9ee40b 100644 --- a/test_gui.c +++ b/test_gui.c @@ -19,3 +19,35 @@ int main(void) return ret; } +#include +#include +#include "engine.h" +#include "gui.h" + +int main(void) { + Engine engine; + if (engine_init(&engine, "test-gui") != 0) { + fprintf(stderr, "Failed to initialize engine\n"); + return 1; + } + engine.control_channel = 0; + int ret = gui_main(&engine); + engine_cleanup(&engine); + return ret; +} +#include +#include +#include "engine.h" +#include "gui.h" + +int main(void) { + Engine engine; + if (engine_init(&engine, "test-gui") != 0) { + fprintf(stderr, "Failed to initialize engine\n"); + return 1; + } + engine.control_channel = 0; + int ret = gui_main(&engine); + engine_cleanup(&engine); + return ret; +}