-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
139 lines (119 loc) · 4.21 KB
/
Makefile
File metadata and controls
139 lines (119 loc) · 4.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
.PHONY: all clean test test-unit test-interpreter test-exiftool test-all test-gradle test-gradle-unit test-gradle-all test-gradle-parallel test-maven-parallel build run wrapper dev ci
all: build
# CI build - optimized for CI/CD environments
ci: wrapper
ifeq ($(OS),Windows_NT)
mvn clean test -B
else
./gradlew build --no-daemon --stacktrace
endif
wrapper:
@test -f ./gradlew || gradle wrapper
# Standard build - incremental compilation with parallel tests (4 JVMs)
build: wrapper
ifeq ($(OS),Windows_NT)
gradlew.bat classes testUnitParallel --parallel shadowJar
else
./gradlew classes testUnitParallel --parallel shadowJar
endif
# Development build - forces recompilation (use during active development)
dev: wrapper
ifeq ($(OS),Windows_NT)
gradlew.bat clean compileJava shadowJar installDist
else
./gradlew clean compileJava shadowJar installDist
endif
# Default test target - fast unit tests using perl_test_runner.pl
test: test-unit
# Fast unit tests only (from src/test/resources/unit/ directory)
# Uses Gradle's testUnitParallel (same as default make build)
test-unit: wrapper
ifeq ($(OS),Windows_NT)
gradlew.bat testUnitParallel --parallel
else
./gradlew testUnitParallel --parallel
endif
# Unit tests using bytecode interpreter backend (feature parity check)
test-interpreter:
@echo "Running unit tests with bytecode interpreter..."
JPERL_INTERPRETER=1 perl dev/tools/perl_test_runner.pl --jobs 8 --timeout 60 --output test_interpreter_results.json src/test/resources/unit
# Image::ExifTool test suite (Image-ExifTool-13.44/t/ directory)
test-exiftool:
@echo "Running Image::ExifTool tests..."
@if [ -d Image-ExifTool-13.44/t ]; then \
perl dev/tools/run_exiftool_tests.pl --output test_exiftool_results.json; \
else \
echo "Error: Image-ExifTool-13.44/ directory not found."; \
exit 1; \
fi
# Perl 5 core test suite (perl5_t/t/ directory)
# Run 'perl dev/import-perl5/sync.pl' first to populate perl5_t/
test-perl5:
@echo "Running Perl 5 core test suite..."
@if [ -d perl5_t/t ]; then \
perl dev/tools/perl_test_runner.pl --jobs 8 --timeout 60 --output test_results.json perl5_t/t; \
else \
echo "Error: perl5_t/t/ directory not found. Run 'perl dev/import-perl5/sync.pl' first."; \
exit 1; \
fi
# Perl 5 module tests (auto-discovers all subdirectories in perl5_t/ except t/)
# Run 'perl dev/import-perl5/sync.pl' first to populate perl5_t/
test-modules:
@echo "Running Perl 5 module tests..."
@if [ -d perl5_t ]; then \
MODULE_DIRS=$$(find perl5_t -maxdepth 1 -type d ! -name perl5_t ! -name t -name '[A-Z]*' 2>/dev/null | sort); \
if [ -n "$$MODULE_DIRS" ]; then \
echo "Found module test directories: $$MODULE_DIRS"; \
perl dev/tools/perl_test_runner.pl --jobs 8 --timeout 60 --output test_modules_results.json $$MODULE_DIRS; \
else \
echo "Warning: No module test directories found in perl5_t/. Run 'perl dev/import-perl5/sync.pl' first."; \
fi \
else \
echo "Error: perl5_t/ directory not found. Run 'perl dev/import-perl5/sync.pl' first."; \
exit 1; \
fi
# Comprehensive tests - runs both Perl 5 core tests and module tests
test-all: test-perl5 test-modules
# Alternative: Run tests using JUnit/Gradle (for CI/CD integration)
# Uses parallel execution by default (4 JVMs)
test-gradle: test-gradle-parallel
# Fast unit tests via Gradle/JUnit
test-gradle-unit: wrapper
ifeq ($(OS),Windows_NT)
gradlew.bat testUnit --rerun-tasks
else
./gradlew testUnit --rerun-tasks
endif
# All tests via Gradle/JUnit
test-gradle-all: wrapper
ifeq ($(OS),Windows_NT)
gradlew.bat testAll --rerun-tasks
else
./gradlew testAll --rerun-tasks
endif
# Parallel unit tests via Gradle/JUnit (4 JVMs)
test-gradle-parallel: wrapper
ifeq ($(OS),Windows_NT)
gradlew.bat testUnitParallel --parallel --rerun-tasks
else
./gradlew testUnitParallel --parallel --rerun-tasks
endif
# Parallel unit tests via Maven (4 JVMs)
test-maven-parallel:
ifeq ($(OS),Windows_NT)
start /B mvn test -Pshard1 & start /B mvn test -Pshard2 & start /B mvn test -Pshard3 & start /B mvn test -Pshard4
else
mvn test -Pshard1 & mvn test -Pshard2 & mvn test -Pshard3 & mvn test -Pshard4 & wait
endif
clean: wrapper
ifeq ($(OS),Windows_NT)
gradlew.bat clean
else
./gradlew clean
endif
deb: wrapper
ifeq ($(OS),Windows_NT)
gradlew.bat buildDeb
else
./gradlew buildDeb
endif