Makefile
1 # Documentation Makefile 2 3 .PHONY: help test test-examples test-links test-format test-file clean validate-links link-dashboard test-code-examples validate-content qa-all 4 5 # Default target 6 help: 7 @echo "Planar Documentation Testing" 8 @echo "" 9 @echo "Available targets:" 10 @echo " test - Run all documentation tests" 11 @echo " test-examples - Run code example tests only" 12 @echo " test-links - Run link validation tests only" 13 @echo " validate-links - Run automated link validation with dashboard" 14 @echo " link-dashboard - Generate link health monitoring dashboard" 15 @echo " test-code-examples - Test all Julia code examples in documentation" 16 @echo " validate-content - Run content consistency and template validation" 17 @echo " qa-all - Run all quality assurance checks" 18 @echo " test-format - Run format consistency tests only" 19 @echo " test-file - Test a specific file (use FILE=path/to/file.md)" 20 @echo " test-multi - Test with multiple Julia versions" 21 @echo " report - Generate HTML report from latest test results" 22 @echo " quick-test - Fast test for development (reduced timeout)" 23 @echo " watch - Continuously test on file changes" 24 @echo " build - Build documentation" 25 @echo " clean - Clean test artifacts" 26 @echo "" 27 @echo "Examples:" 28 @echo " make test" 29 @echo " make test-examples" 30 @echo " make test-file FILE=docs/src/strategy.md" 31 @echo " make test-multi" 32 @echo " make report" 33 34 # Run all tests 35 test: 36 @mkdir -p test/results 37 julia --project=Planar test/runtests.jl --verbose --output=test/results/test-results.toml 38 39 # Run code example tests only 40 test-examples: 41 @mkdir -p test/results 42 julia --project=Planar test/runtests.jl --skip-links --skip-format --verbose --output=test/results/examples-results.toml 43 44 # Run link validation tests only 45 test-links: 46 @mkdir -p test/results 47 julia --project=Planar test/runtests.jl --skip-examples --skip-format --verbose --output=test/results/links-results.toml 48 49 # Run automated link validation with dashboard 50 validate-links: 51 @echo "Running automated link validation..." 52 julia --project=Planar scripts/link_validator.jl 53 54 # Generate link health dashboard 55 link-dashboard: 56 @echo "Generating link health dashboard..." 57 julia --project=Planar scripts/link_validator.jl 58 @echo "Dashboard available at: docs/reports/link_health_dashboard.html" 59 60 # Run code example testing 61 test-code-examples: 62 @echo "Code example testing has been replaced with manual AI-guided review" 63 @echo "See docs/maintenance/ai-code-block-review-guide.md for review procedures" 64 65 # Run content consistency validation 66 validate-content: 67 @echo "Validating content consistency and template compliance..." 68 julia --project=Planar scripts/content_consistency_validator.jl 69 70 # Run all quality assurance checks 71 qa-all: 72 @echo "Running all documentation quality assurance checks..." 73 @echo "1. Validating links..." 74 julia --project=Planar scripts/simple_link_validator.jl 75 @echo "2. Code examples use manual AI-guided review (see maintenance/ai-code-block-review-guide.md)" 76 @echo "3. Validating content consistency..." 77 julia --project=Planar scripts/content_consistency_validator.jl 78 @echo "All QA checks completed. Check docs/reports/ for detailed results." 79 80 # Run format consistency tests only 81 test-format: 82 @mkdir -p test/results 83 julia --project=Planar test/runtests.jl --skip-examples --skip-links --verbose --output=test/results/format-results.toml 84 85 # Test a specific file 86 test-file: 87 ifndef FILE 88 @echo "Error: Please specify FILE=path/to/file.md" 89 @exit 1 90 endif 91 julia --project=Planar test/test_file.jl $(FILE) --verbose 92 93 # Build documentation 94 build: 95 julia --project=Planar make.jl 96 97 # Generate test reports 98 report: 99 @if [ -f test/results/test-results.toml ]; then \ 100 julia --project=Planar -e "push!(LOAD_PATH, \"test\"); using TestResultsReporter; generate_html_report(\"test/results/test-results.toml\", \"test/results/report.html\"); generate_summary_report(\"test/results/test-results.toml\")"; \ 101 else \ 102 echo "No test results found. Run 'make test' first."; \ 103 fi 104 105 # Clean test artifacts 106 clean: 107 rm -rf test/results/ 108 rm -rf test/tmp/ 109 find . -name "*.tmp" -delete 110 111 # Quick test for development 112 quick-test: 113 @mkdir -p test/results 114 julia --project=Planar test/runtests.jl --skip-links --timeout=10 --output=test/results/quick-results.toml 115 116 # Test with specific Julia version 117 test-julia-%: 118 @mkdir -p test/results 119 julia-$* --project=Planar test/runtests.jl --verbose --output=test/results/test-results-julia-$*.toml 120 121 # Test multiple Julia versions (if available) 122 test-multi: 123 @for version in 1.10 1.11; do \ 124 if command -v julia-$$version >/dev/null 2>&1; then \ 125 echo "Testing with Julia $$version..."; \ 126 make test-julia-$$version; \ 127 else \ 128 echo "Julia $$version not found, skipping..."; \ 129 fi; \ 130 done 131 132 # Continuous testing (watch for changes) 133 watch: 134 @echo "Watching for changes in docs/src/..." 135 @while true; do \ 136 inotifywait -r -e modify docs/src/ 2>/dev/null && \ 137 echo "Changes detected, running tests..." && \ 138 make test-examples; \ 139 done