-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate_coverage_report.lua
More file actions
35 lines (28 loc) · 955 Bytes
/
Copy pathgenerate_coverage_report.lua
File metadata and controls
35 lines (28 loc) · 955 Bytes
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
-- Standalone Coverage Report Generator
-- Run with: lua generate_coverage_report.lua
-- Set package.path to find modules in the tests folder
package.path = package.path .. ";./tests/?.lua"
local test_coverage = require("tests.test_coverage")
print("Generating Test Coverage Report for Earth Survival Game...")
print("")
-- Initialize and analyze
test_coverage.init()
test_coverage.analyze_main_lua()
test_coverage.simulate_test_coverage()
-- Generate and display report
local coverage_report = test_coverage.generate_report()
print(coverage_report)
-- Write report to file
local file = io.open("coverage_report.txt", "w")
if file then
file:write(coverage_report)
file:close()
print("")
print("Coverage report saved to: coverage_report.txt")
else
print("")
print("Failed to save coverage report to file")
end
print("")
print("Press Enter to exit...")
local _ = io.read() -- Capture the return value to avoid linter warning