forked from inferno-os/inferno-os
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathverify-port.sh
More file actions
executable file
·87 lines (77 loc) · 2.4 KB
/
verify-port.sh
File metadata and controls
executable file
·87 lines (77 loc) · 2.4 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
#!/bin/bash
# Verification script for ARM64 64-bit Inferno port
# Tests that critical functionality works
echo "========================================="
echo "ARM64 64-bit Inferno Port Verification"
echo "========================================="
echo ""
cd "$(dirname "$0")"
# Check emulator exists
if [[ ! -f emu/MacOSX/o.emu ]]; then
echo "❌ FAIL: emu/MacOSX/o.emu not found"
exit 1
fi
echo "✅ Emulator binary exists"
# Check limbo exists
if [[ ! -f MacOSX/arm64/bin/limbo ]]; then
echo "❌ FAIL: limbo compiler not found"
exit 1
fi
echo "✅ Limbo compiler exists"
# Check critical .dis files
MISSING=0
for f in dis/emuinit.dis dis/sh.dis dis/lib/readdir.dis dis/cat.dis dis/ls.dis dis/pwd.dis; do
if [[ ! -f "$f" ]]; then
echo "❌ MISSING: $f"
MISSING=$((MISSING + 1))
else
echo " OK: $f ($(wc -c < "$f") bytes)"
fi
done
if [[ "$MISSING" -gt 0 ]]; then
echo ""
echo "Debugging: listing dis/ directory contents:"
ls -la dis/*.dis 2>/dev/null || echo " (no .dis files in dis/)"
ls -la dis/lib/*.dis 2>/dev/null || echo " (no .dis files in dis/lib/)"
echo ""
echo "❌ FAIL: $MISSING critical .dis file(s) missing"
exit 1
fi
echo "✅ Critical .dis files present"
# Test simple output
echo ""
echo "Testing console output..."
timeout 3 ./emu/MacOSX/o.emu -r. test-stderr.dis 2>&1 | grep -q "STDERR: Hello" && \
echo "✅ Console output works" || \
echo "❌ FAIL: No console output"
# Test shell commands
echo ""
echo "Testing shell commands..."
TEST_OUTPUT=$(timeout 5 ./emu/MacOSX/o.emu -r. <<'SHELL' 2>&1 | grep -v DEBUG
pwd
date
cat /dev/sysctl
SHELL
)
echo "$TEST_OUTPUT" | grep -q "/" && echo "✅ pwd works" || echo "❌ pwd failed"
echo "$TEST_OUTPUT" | grep -q "202[0-9]" && echo "✅ date works" || echo "❌ date failed"
echo "$TEST_OUTPUT" | grep -q "Fourth Edition" && echo "✅ cat works" || echo "❌ cat failed"
# Test ls
echo ""
echo "Testing ls command..."
timeout 5 ./emu/MacOSX/o.emu -r. <<'SHELL' 2>&1 | grep -v DEBUG | grep -q "/dis/ls.dis" && \
echo "✅ ls works" || \
echo "❌ ls failed"
ls /dis
SHELL
echo ""
echo "========================================="
echo "Verification Complete"
echo "========================================="
echo ""
echo "If all checks passed, the port is working!"
echo ""
echo "To use Inferno:"
echo " ./emu/MacOSX/o.emu -r."
echo ""
echo "See QUICKSTART.md for more information."