forked from dotandev/hintents
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_cross_compile.sh
More file actions
56 lines (47 loc) · 1.42 KB
/
test_cross_compile.sh
File metadata and controls
56 lines (47 loc) · 1.42 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
# Copyright (c) Hintents Authors.
# SPDX-License-Identifier: Apache-2.0
#!/bin/bash
// Copyright (c) 2026 dotandev
// SPDX-License-Identifier: MIT OR Apache-2.0
echo "=== Cross-Platform Compilation Test ==="
echo ""
# Test Linux compilation
echo "Testing Linux (amd64)..."
GOOS=linux GOARCH=amd64 go build -o /tmp/test_linux ./internal/rpc
if [ $? -eq 0 ]; then
echo " Linux compilation: SUCCESS"
rm /tmp/test_linux
else
echo " Linux compilation: FAILED"
fi
# Test macOS compilation
echo "Testing macOS (amd64)..."
GOOS=darwin GOARCH=amd64 go build -o /tmp/test_darwin ./internal/rpc
if [ $? -eq 0 ]; then
echo " macOS compilation: SUCCESS"
rm /tmp/test_darwin
else
echo " macOS compilation: FAILED"
fi
# Test macOS ARM (M1/M2)
echo "Testing macOS (arm64)..."
GOOS=darwin GOARCH=arm64 go build -o /tmp/test_darwin_arm ./internal/rpc
if [ $? -eq 0 ]; then
echo " macOS ARM compilation: SUCCESS"
rm /tmp/test_darwin_arm
else
echo " macOS ARM compilation: FAILED"
fi
# Test Windows compilation
echo "Testing Windows (amd64)..."
GOOS=windows GOARCH=amd64 go build -o /tmp/test_windows.exe ./internal/rpc
if [ $? -eq 0 ]; then
echo " Windows compilation: SUCCESS"
rm /tmp/test_windows.exe
else
echo " Windows compilation: FAILED"
fi
echo ""
echo "=== Compilation Test Complete ==="
echo "All platforms can compile the code successfully."
echo "Hash consistency is guaranteed by XDR and SHA-256 standards."