Makefile (view raw)
1# Makefile for mdget testing suite
2
3# Default target
4.PHONY: all
5all: test-all
6
7# Build mdget binary
8.PHONY: build
9build:
10 @echo "Building mdget..."
11 @go build -o bin/mdget ./cmd/mdget.go
12 @echo "Built: bin/mdget"
13
14# Clean build artifacts
15.PHONY: clean
16clean:
17 @echo "Cleaning up..."
18 @rm -rf bin/ test-output/ tmp/ *.test
19 @echo "Clean complete"
20
21# Test targets
22.PHONY: test-all
23test-all: test-args test-http test-output test-errors test-conversion test-build
24 @echo "✅ All tests passed!"
25
26.PHONY: test-args
27test-args:
28 @echo "Testing command-line arguments..."
29 @cd test && go run test_helper.go test_args.go
30
31.PHONY: test-http
32test-http:
33 @echo "Testing HTTP connectivity..."
34 @cd test && go run test_helper.go test_http.go
35
36.PHONY: test-output
37test-output:
38 @echo "Testing file output..."
39 @cd test && go run test_helper.go test_output.go
40
41.PHONY: test-errors
42test-errors:
43 @echo "Testing error conditions..."
44 @cd test && go run test_helper.go test_errors.go
45
46.PHONY: test-conversion
47test-conversion:
48 @echo "Testing HTML to Markdown conversion..."
49 @cd test && go run test_helper.go test_conversion.go
50
51.PHONY: test-build
52test-build:
53 @echo "Testing build and execution..."
54 @cd test && go run test_helper.go test_build.go
55
56# Helper targets
57.PHONY: help
58help:
59 @echo "mdget Testing Suite"
60 @echo ""
61 @echo "Usage:"
62 @echo " make - Run all tests"
63 @echo " make build - Build mdget binary"
64 @echo " make clean - Clean build artifacts"
65 @echo " make test-all - Run all tests"
66 @echo " make test-args - Test command-line arguments"
67 @echo " make test-http - Test HTTP connectivity"
68 @echo " make test-output - Test file output"
69 @echo " make test-errors - Test error conditions"
70 @echo " make test-conversion - Test HTML to Markdown conversion"
71 @echo " make test-build - Test build and execution"
72 @echo " make help - Show this help"
73
74# Variables
75BINARY_PATH ?= bin/mdget