From 729ed96362fb3301a0275e1b5b1e01b816cf4531 Mon Sep 17 00:00:00 2001 From: Alexander Todorov Date: Mar 09 2020 10:37:09 +0000 Subject: macros: Accept options for %gotest so in spec files we can do: %gotest -c -o _bin/my-tests path/to/module The background is that in osbuild-composer we'd like to ship the test binaries in a -tests RPM package. --- diff --git a/rpm/macros.d/macros.go-compilers-golang b/rpm/macros.d/macros.go-compilers-golang index b0ab4c4..54cb594 100644 --- a/rpm/macros.d/macros.go-compilers-golang +++ b/rpm/macros.d/macros.go-compilers-golang @@ -47,4 +47,4 @@ ${workroot}${GOPATH:+:${GOPATH}} # Define commands for testing %gotestflags %{gocompilerflags} %gotestextldflags %__global_ldflags %{?__golang_extldflags} -%gotest() %{?gomodulesmode} go test %{gotestflags} -ldflags "${LDFLAGS:-}%{?currentgoldflags} -extldflags '%{gotestextldflags}'" %{?**}; +%gotest(c:o:) %{?gomodulesmode} go test %{gotestflags} -ldflags "${LDFLAGS:-}%{?currentgoldflags} -extldflags '%{gotestextldflags}'" %{?**};