File tree 1 file changed +19
-5
lines changed
1 file changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,16 @@ ALL_DOCS := $(shell find . -name '*.md' -type f | sort)
7
7
ALL_GO_MOD_DIRS := $(filter-out $(TOOLS_MOD_DIR ) , $(shell find . -type f -name 'go.mod' -exec dirname {} \; | sort) )
8
8
ALL_COVERAGE_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | egrep -v '^./example|^$(TOOLS_MOD_DIR ) ' | sort)
9
9
10
+ # Mac OS Catalina 10.5.x doesn't support 386. Hence skip 386 test
11
+ SKIP_386_TEST = false
12
+ UNAME_S := $(shell uname -s)
13
+ ifeq ($(UNAME_S ) ,Darwin)
14
+ SW_VERS := $(shell sw_vers -productVersion)
15
+ ifeq ($(shell echo $(SW_VERS) | egrep '^(10.1[5-9]|1[1-9]|[2-9])'), $(SW_VERS))
16
+ SKIP_386_TEST = true
17
+ endif
18
+ endif
19
+
10
20
GOTEST_MIN = go test -v -timeout 30s
11
21
GOTEST = $(GOTEST_MIN ) -race
12
22
GOTEST_WITH_COVERAGE = $(GOTEST ) -coverprofile=coverage.txt -covermode=atomic
@@ -73,11 +83,15 @@ test:
73
83
74
84
.PHONY : test-386
75
85
test-386 :
76
- set -e; for dir in $( ALL_GO_MOD_DIRS) ; do \
77
- echo " go test ./... GOARCH 386 in $$ {dir}" ; \
78
- (cd " $$ {dir}" && \
79
- GOARCH=386 $(GOTEST_MIN ) ./...); \
80
- done
86
+ if [ $( SKIP_386_TEST) = true ] ; then \
87
+ echo " skipping the test for GOARCH 386 as it is not supported on the current OS" ; \
88
+ else \
89
+ set -e; for dir in $( ALL_GO_MOD_DIRS) ; do \
90
+ echo " go test ./... GOARCH 386 in $$ {dir}" ; \
91
+ (cd " $$ {dir}" && \
92
+ GOARCH=386 $(GOTEST_MIN ) ./...); \
93
+ done ; \
94
+ fi
81
95
82
96
.PHONY : examples
83
97
examples :
You can’t perform that action at this time.
0 commit comments