-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (34 loc) · 1.43 KB
/
Copy pathMakefile
File metadata and controls
41 lines (34 loc) · 1.43 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
all:
CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o bsync
-upx --best bsync || true
test:
go test -v ./...
@tmp_bin=$$(mktemp /tmp/bsync-test-bin.XXXXXX); \
trap 'rm -f "$$tmp_bin"' EXIT; \
CGO_ENABLED=0 go build -trimpath -o "$$tmp_bin" .; \
BSYNC_BIN="$$tmp_bin" bash ./test_edge_cases.sh
test-fault:
go test -count=1 -run 'Test(Fault|Strict|Sysfs|RunQuickBenchmark|WaitForReadyNoReady|ShellQuote|RemoteBinary|ValidateProtocol|BlockPayload)' ./...
@tmp_bin=$$(mktemp /tmp/bsync-fault-bin.XXXXXX); \
trap 'rm -f "$$tmp_bin"' EXIT; \
CGO_ENABLED=0 go build -trimpath -o "$$tmp_bin" .; \
BSYNC_BIN="$$tmp_bin" bash ./test_fault_cli.sh
test-stress:
go test -race ./...
@tmp_bin=$$(mktemp /tmp/bsync-stress-bin.XXXXXX); \
trap 'rm -f "$$tmp_bin"' EXIT; \
CGO_ENABLED=0 go build -trimpath -o "$$tmp_bin" .; \
BSYNC_BIN="$$tmp_bin" bash ./test_stress.sh
test-remote:
@test -n "$(REMOTE)" || { echo "usage: make test-remote REMOTE=user@host"; exit 2; }
@tmp_bin=$$(mktemp /tmp/bsync-remote-bin.XXXXXX); \
trap 'rm -f "$$tmp_bin"' EXIT; \
CGO_ENABLED=0 go build -trimpath -o "$$tmp_bin" .; \
BSYNC_BIN="$$tmp_bin" REMOTE="$(REMOTE)" bash ./test_remote_ssh.sh
# Windows cross-compile (run from Linux: requires GOOS=windows)
windows:
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o bsync.exe
-upx --best bsync.exe || true
clean:
rm -f bsync
.PHONY: all windows test test-fault test-stress test-remote clean