From 07db05dd805343a5fa83522792fb322914ac59cf Mon Sep 17 00:00:00 2001 From: Simon Zolin Date: Thu, 3 Sep 2020 10:10:54 +0300 Subject: [PATCH] * makefile: test: use '-race' parameter on UNIX, don't use it on Windows Squashed commit of the following: commit b01379bb223dd28464e8f0b1e8878d3e6b314c26 Merge: 16c7ab79 4efc464e Author: Simon Zolin Date: Thu Sep 3 10:00:31 2020 +0300 Merge remote-tracking branch 'origin/master' into fix-test commit 16c7ab7949ee0a175f89285c1f1fbde0aa27081b Author: Simon Zolin Date: Wed Sep 2 20:04:00 2020 +0300 minor commit af8002b09a3017955e9892db413fa62ce1e4ad81 Author: Simon Zolin Date: Wed Sep 2 19:56:01 2020 +0300 * makefile: test: use '-race' parameter on UNIX, don't use it on Windows commit b893358cbe5d1b7dc7db23b0b159ec436c20ee3e Author: Simon Zolin Date: Wed Sep 2 19:36:48 2020 +0300 test commit c52a82b720f61f874d49708e9cc1b307d2f62839 Author: Simon Zolin Date: Wed Sep 2 17:47:51 2020 +0300 - fix test --- Makefile | 8 +++++++- dhcpd/nclient4/client.go | 1 + dhcpd/nclient4/ipv4.go | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d0e6266c..f83b45eb 100644 --- a/Makefile +++ b/Makefile @@ -108,6 +108,12 @@ ifndef DOCKER_IMAGE_NAME $(error DOCKER_IMAGE_NAME value is not set) endif +# OS-specific flags +TEST_FLAGS := -race +ifeq ($(OS),Windows_NT) + TEST_FLAGS := +endif + .PHONY: all build client client-watch docker lint lint-js lint-go test dependencies clean release docker-multi-arch all: build @@ -158,7 +164,7 @@ test: @echo Running JS unit-tests npm run test --prefix client @echo Running Go unit-tests - go test -race -v -bench=. -coverprofile=coverage.txt -covermode=atomic ./... + go test $(TEST_FLAGS) -v -coverprofile=coverage.txt -covermode=atomic ./... ci: client_with_deps go mod download diff --git a/dhcpd/nclient4/client.go b/dhcpd/nclient4/client.go index 02430ae9..144ab11c 100644 --- a/dhcpd/nclient4/client.go +++ b/dhcpd/nclient4/client.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// +build darwin dragonfly freebsd linux netbsd openbsd solaris // +build go1.12 // Package nclient4 is a small, minimum-functionality client for DHCPv4. diff --git a/dhcpd/nclient4/ipv4.go b/dhcpd/nclient4/ipv4.go index 5733eb46..5d961852 100644 --- a/dhcpd/nclient4/ipv4.go +++ b/dhcpd/nclient4/ipv4.go @@ -14,6 +14,7 @@ // // This file contains code taken from gVisor. +// +build darwin dragonfly freebsd linux netbsd openbsd solaris // +build go1.12 package nclient4