1 #!/usr/bin/env bash
2 # Pure Go build with purego - no CGO needed
3 # libsecp256k1 is loaded dynamically at runtime if available
4 export CGO_ENABLED=0
5 6 # Verify libsecp256k1.so exists in repo (should be at repo root)
7 if [ ! -f "libsecp256k1.so" ]; then
8 echo "Warning: libsecp256k1.so not found in repo - tests may use fallback crypto"
9 else
10 chmod +x libsecp256k1.so 2>/dev/null || true
11 fi
12 13 # Set LD_LIBRARY_PATH to include current directory
14 if [ -f "libsecp256k1.so" ]; then
15 export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$(pwd)"
16 fi
17 18 go mod tidy
19 go test ./...
20 cd pkg/crypto
21 go mod tidy
22 go test ./...
23 cd ../database
24 go mod tidy
25 go test ./...
26 cd ../encoders
27 go mod tidy
28 go test ./...
29 cd ../protocol
30 go mod tidy
31 go test ./...
32 cd ../utils
33 go mod tidy
34 go test ./...
35 cd ../acl
36 go mod tidy
37 go test ./...