diff options
| -rw-r--r-- | Makefile | 77 |
1 files changed, 35 insertions, 42 deletions
@@ -34,13 +34,6 @@ TEST_UTIL_FILES = $(wildcard $(TEST_DIR)/testutil-*.el) EMACS_BATCH = $(EMACS) --batch --no-site-file --no-site-lisp EMACS_TEST = $(EMACS_BATCH) -L $(PROJECT_ROOT) -L $(TEST_DIR) -# Colors for output -COLOR_GREEN = \033[0;32m -COLOR_RED = \033[0;31m -COLOR_BLUE = \033[0;34m -COLOR_YELLOW = \033[0;33m -COLOR_RESET = \033[0m - .PHONY: help test test-all test-unit test-integration test-file test-name \ validate-parens validate compile lint \ clean clean-compiled clean-tests @@ -51,20 +44,20 @@ COLOR_RESET = \033[0m help: @echo "wttrin Makefile Targets:" @echo "" - @echo " $(COLOR_BLUE)Testing:$(COLOR_RESET)" + @echo " Testing:" @echo " make test - Run all tests ($(words $(ALL_TESTS)) files)" @echo " make test-unit - Run unit tests only ($(words $(UNIT_TESTS)) files)" @echo " make test-integration - Run integration tests only ($(words $(INTEGRATION_TESTS)) files)" @echo " make test-file FILE=<filename> - Run specific test file" @echo " make test-name TEST=<pattern> - Run tests matching pattern" @echo "" - @echo " $(COLOR_BLUE)Validation:$(COLOR_RESET)" + @echo " Validation:" @echo " make validate-parens - Check for unbalanced parentheses" @echo " make validate - Load wttrin.el to verify it compiles" @echo " make compile - Byte-compile wttrin.el" @echo " make lint - Run all linters (checkdoc, package-lint, elisp-lint)" @echo "" - @echo " $(COLOR_BLUE)Utilities:$(COLOR_RESET)" + @echo " Utilities:" @echo " make clean - Remove test artifacts and compiled files" @echo " make clean-compiled - Remove .elc/.eln files only" @echo " make clean-tests - Remove test artifacts only" @@ -81,74 +74,74 @@ help: test: test-all test-all: - @echo "$(COLOR_BLUE)Running all tests ($(words $(ALL_TESTS)) files)...$(COLOR_RESET)" + @echo "Running all tests ($(words $(ALL_TESTS)) files)..." @$(MAKE) test-unit @if [ $(words $(INTEGRATION_TESTS)) -gt 0 ]; then \ $(MAKE) test-integration; \ fi - @echo "$(COLOR_GREEN)✓ All tests complete$(COLOR_RESET)" + @echo "✓ All tests complete" test-unit: - @echo "$(COLOR_BLUE)Running unit tests ($(words $(UNIT_TESTS)) files)...$(COLOR_RESET)" + @echo "Running unit tests ($(words $(UNIT_TESTS)) files)..." @failed=0; \ for test in $(UNIT_TESTS); do \ echo " Testing $$test..."; \ $(EMACS_TEST) -l ert -l $$test -f ert-run-tests-batch-and-exit || failed=$$((failed + 1)); \ done; \ if [ $$failed -eq 0 ]; then \ - echo "$(COLOR_GREEN)✓ All unit tests passed$(COLOR_RESET)"; \ + echo "✓ All unit tests passed"; \ else \ - echo "$(COLOR_RED)✗ $$failed unit test file(s) failed$(COLOR_RESET)"; \ + echo "✗ $$failed unit test file(s) failed"; \ exit 1; \ fi test-integration: @if [ $(words $(INTEGRATION_TESTS)) -eq 0 ]; then \ - echo "$(COLOR_YELLOW)No integration tests found$(COLOR_RESET)"; \ + echo "No integration tests found"; \ exit 0; \ fi - @echo "$(COLOR_BLUE)Running integration tests ($(words $(INTEGRATION_TESTS)) files)...$(COLOR_RESET)" + @echo "Running integration tests ($(words $(INTEGRATION_TESTS)) files)..." @failed=0; \ for test in $(INTEGRATION_TESTS); do \ echo " Testing $$test..."; \ $(EMACS_TEST) -l ert -l $$test -f ert-run-tests-batch-and-exit || failed=$$((failed + 1)); \ done; \ if [ $$failed -eq 0 ]; then \ - echo "$(COLOR_GREEN)✓ All integration tests passed$(COLOR_RESET)"; \ + echo "✓ All integration tests passed"; \ else \ - echo "$(COLOR_RED)✗ $$failed integration test file(s) failed$(COLOR_RESET)"; \ + echo "✗ $$failed integration test file(s) failed"; \ exit 1; \ fi test-file: ifndef FILE - @echo "$(COLOR_RED)Error: FILE parameter required$(COLOR_RESET)" + @echo "Error: FILE parameter required" @echo "Usage: make test-file FILE=test-wttrin--build-url.el" @exit 1 endif - @echo "$(COLOR_BLUE)Running tests in $(FILE)...$(COLOR_RESET)" + @echo "Running tests in $(FILE)..." @$(EMACS_TEST) -l ert -l $(TEST_DIR)/$(FILE) -f ert-run-tests-batch-and-exit - @echo "$(COLOR_GREEN)✓ Tests in $(FILE) complete$(COLOR_RESET)" + @echo "✓ Tests in $(FILE) complete" test-name: ifndef TEST - @echo "$(COLOR_RED)Error: TEST parameter required$(COLOR_RESET)" + @echo "Error: TEST parameter required" @echo "Usage: make test-name TEST=test-wttrin--build-url-*" @exit 1 endif - @echo "$(COLOR_BLUE)Running tests matching pattern: $(TEST)...$(COLOR_RESET)" + @echo "Running tests matching pattern: $(TEST)..." @$(EMACS_TEST) \ -l ert \ $(foreach test,$(ALL_TESTS),-l $(test)) \ --eval '(ert-run-tests-batch-and-exit "$(TEST)")' - @echo "$(COLOR_GREEN)✓ Tests matching '$(TEST)' complete$(COLOR_RESET)" + @echo "✓ Tests matching '$(TEST)' complete" # ============================================================================ # Validation Targets # ============================================================================ validate-parens: - @echo "$(COLOR_BLUE)Checking for unbalanced parentheses...$(COLOR_RESET)" + @echo "Checking for unbalanced parentheses..." @echo " Checking $(MAIN_FILE)..."; \ $(EMACS_BATCH) --eval "(condition-case err \ (progn \ @@ -158,11 +151,11 @@ validate-parens: (error (progn \ (message \"ERROR: %s\" err) \ (kill-emacs 1))))" 2>&1 > /dev/null && \ - echo "$(COLOR_GREEN)✓ $(MAIN_FILE) has balanced parentheses$(COLOR_RESET)" || \ - (echo "$(COLOR_RED)✗ $(MAIN_FILE) has unbalanced parentheses$(COLOR_RESET)" && exit 1) + echo "✓ $(MAIN_FILE) has balanced parentheses" || \ + (echo "✗ $(MAIN_FILE) has unbalanced parentheses" && exit 1) validate: - @echo "$(COLOR_BLUE)Loading wttrin.el to verify compilation...$(COLOR_RESET)" + @echo "Loading wttrin.el to verify compilation..." @$(EMACS_BATCH) -L $(PROJECT_ROOT) \ --eval "(condition-case err \ (progn \ @@ -171,20 +164,20 @@ validate: (error (progn \ (message \"ERROR loading %s: %s\" \"$(MAIN_FILE)\" err) \ (kill-emacs 1))))" && \ - echo "$(COLOR_GREEN)✓ $(MAIN_FILE) loaded successfully$(COLOR_RESET)" || \ - (echo "$(COLOR_RED)✗ $(MAIN_FILE) failed to load$(COLOR_RESET)" && exit 1) + echo "✓ $(MAIN_FILE) loaded successfully" || \ + (echo "✗ $(MAIN_FILE) failed to load" && exit 1) compile: - @echo "$(COLOR_BLUE)Byte-compiling wttrin.el...$(COLOR_RESET)" + @echo "Byte-compiling wttrin.el..." @$(EMACS_BATCH) -L $(PROJECT_ROOT) \ --eval "(progn \ (setq byte-compile-error-on-warn nil) \ (batch-byte-compile))" $(MAIN_FILE) - @echo "$(COLOR_GREEN)✓ Compilation complete$(COLOR_RESET)" + @echo "✓ Compilation complete" lint: - @echo "$(COLOR_BLUE)Running linters on wttrin.el...$(COLOR_RESET)" - @echo "$(COLOR_YELLOW)Note: checkdoc, package-lint, and elisp-lint must be installed$(COLOR_RESET)" + @echo "Running linters on wttrin.el..." + @echo "Note: checkdoc, package-lint, and elisp-lint must be installed" @$(EMACS_BATCH) -L $(PROJECT_ROOT) \ --eval "(progn \ (require 'checkdoc nil t) \ @@ -197,22 +190,22 @@ lint: (package-lint-current-buffer)) \ (when (featurep 'elisp-lint) \ (elisp-lint-file \"$(MAIN_FILE)\")))" && \ - echo "$(COLOR_GREEN)✓ All linting checks passed$(COLOR_RESET)" || \ - echo "$(COLOR_YELLOW)⚠ Linting issues found$(COLOR_RESET)" + echo "✓ All linting checks passed" || \ + echo "⚠ Linting issues found" # ============================================================================ # Utility Targets # ============================================================================ clean: clean-tests clean-compiled - @echo "$(COLOR_GREEN)✓ Clean complete$(COLOR_RESET)" + @echo "✓ Clean complete" clean-compiled: - @echo "$(COLOR_BLUE)Removing compiled files (.elc, .eln)...$(COLOR_RESET)" + @echo "Removing compiled files (.elc, .eln)..." @find $(PROJECT_ROOT) -type f \( -name "*.eln" -o -name "*.elc" \) -delete - @echo "$(COLOR_GREEN)✓ Compiled files removed$(COLOR_RESET)" + @echo "✓ Compiled files removed" clean-tests: - @echo "$(COLOR_BLUE)Removing test artifacts...$(COLOR_RESET)" + @echo "Removing test artifacts..." @rm -rf $(HOME)/.temp-emacs-tests - @echo "$(COLOR_GREEN)✓ Test artifacts removed$(COLOR_RESET)" + @echo "✓ Test artifacts removed" |
