Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CC = gcc
CFLAGS = -Isrc -Wall -Wextra -std=c11 -g
LDFLAGS =

SRC = src/main.c src/lexer/lexer.c
SRC = src/main.c src/lexer/lexer.c src/parser/ast.c src/parser/parser.c
OBJ = $(SRC:.c=.o)

TARGET = eac
Expand All @@ -18,7 +18,7 @@ else
SELECTED_TEST := tests/$(TEST_GOAL)
endif

.PHONY: all clean test test-all $(TEST_GOAL)
.PHONY: all clean test test-all test-parser $(TEST_GOAL)

all: $(TARGET)

Expand All @@ -32,6 +32,30 @@ test: $(TARGET)
@echo "Running test file: $(SELECTED_TEST)"
@./$(TARGET) $(SELECTED_TEST)

test-parser: $(TARGET)
@echo "========================================================================"
@echo " EaC PARSER TESTS"
@echo "========================================================================"
@echo ""
@echo "[TEST 1] Simple Variable Declaration:"
@./$(TARGET) tests/parser/test_var_decl.eac
@echo ""
@echo "[TEST 2] Expressions and Operators:"
@./$(TARGET) tests/parser/test_expressions.eac
@echo ""
@echo "[TEST 3] Control Flow (if/while/for):"
@./$(TARGET) tests/parser/test_control_flow.eac
@echo ""
@echo "[TEST 4] Functions:"
@./$(TARGET) tests/parser/test_functions.eac
@echo ""
@echo "[TEST 5] Complete Program:"
@./$(TARGET) tests/parser/test_complete.eac
@echo ""
@echo "========================================================================"
@echo " PARSER TESTS COMPLETED"
@echo "========================================================================"

ifneq ($(TEST_GOAL),)
$(TEST_GOAL):
endif
Expand Down Expand Up @@ -101,4 +125,4 @@ clean:
@if exist $(TARGET_BIN) del /f /q $(TARGET_BIN) >nul 2>&1
@if exist $(TARGET) del /f /q $(TARGET) >nul 2>&1
@if not "$(OBJ_CLEAN)"=="" del /f /q $(OBJ_CLEAN) >nul 2>&1
@if exist output rmdir /s /q output >nul 2>&1
@if exist output rmdir /s /q output >nul 2>&1
Loading