1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 19:05:07 +00:00

Automated test speed fix

This commit is contained in:
Tw93
2025-11-19 10:07:20 +08:00
parent 1565d36981
commit 8b0396a9ff
4 changed files with 41 additions and 54 deletions

View File

@@ -51,16 +51,19 @@ setup() {
[[ "$output" == *"Touch ID"* ]]
}
@test "mo optimize shows available optimization categories" {
run env HOME="$HOME" "$PROJECT_ROOT/mole" optimize
@test "mo optimize command is recognized" {
# Test that optimize command exists without actually running it
# Running full optimize in tests is too slow (waits for sudo, runs health checks)
run bash -c "grep -q '\"optimize\")' '$PROJECT_ROOT/mole'"
[ "$status" -eq 0 ]
[[ "$output" == *"System"* ]] || [[ "$output" == *"optimization"* ]]
}
@test "mo analyze validates binary exists" {
@test "mo analyze binary is valid" {
if [[ -f "$PROJECT_ROOT/bin/analyze-go" ]]; then
run env HOME="$HOME" "$PROJECT_ROOT/mole" analyze --help
[ "$status" -eq 0 ]
# Verify binary is executable and valid Universal Binary
[ -x "$PROJECT_ROOT/bin/analyze-go" ]
run file "$PROJECT_ROOT/bin/analyze-go"
[[ "$output" == *"Mach-O"* ]] || [[ "$output" == *"executable"* ]]
else
skip "analyze-go binary not built"
fi