Skip to content

Commit 20ecc38

Browse files
authored
skip test-386 for Mac OS 10.15.x (Catalina and upwards). (#521)
* skip test-386 for Mac OS 10.15.x (Catalina and upwards). fixes #520 * fix indentation * remove extra newlines.
1 parent a202f16 commit 20ecc38

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

Makefile

+19-5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ ALL_DOCS := $(shell find . -name '*.md' -type f | sort)
77
ALL_GO_MOD_DIRS := $(filter-out $(TOOLS_MOD_DIR), $(shell find . -type f -name 'go.mod' -exec dirname {} \; | sort))
88
ALL_COVERAGE_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | egrep -v '^./example|^$(TOOLS_MOD_DIR)' | sort)
99

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+
1020
GOTEST_MIN = go test -v -timeout 30s
1121
GOTEST = $(GOTEST_MIN) -race
1222
GOTEST_WITH_COVERAGE = $(GOTEST) -coverprofile=coverage.txt -covermode=atomic
@@ -73,11 +83,15 @@ test:
7383

7484
.PHONY: test-386
7585
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
8195

8296
.PHONY: examples
8397
examples:

0 commit comments

Comments
 (0)