Skip to content

Commit 457d671

Browse files
authored
Merge pull request #3229 from afbjorklund/makedepend-buildroot
Avoid out directory, when listing test files
2 parents 7157b43 + d13a266 commit 457d671

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

Makefile

+6-6
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ HYPERKIT_FILES := ./cmd/drivers/hyperkit
6262
STORAGE_PROVISIONER_FILES := ./cmd/storage-provisioner
6363
KVM_DRIVER_FILES := ./cmd/drivers/kvm/
6464

65-
MINIKUBE_TEST_FILES := ./...
65+
MINIKUBE_TEST_FILES := ./cmd/... ./pkg/...
6666

6767
MINIKUBE_BUILD_TAGS := container_image_ostree_stub containers_image_openpgp
6868
MINIKUBE_INTEGRATION_BUILD_TAGS := integration $(MINIKUBE_BUILD_TAGS)
@@ -94,7 +94,7 @@ out/minikube-windows-amd64.exe: out/minikube-windows-amd64
9494
cp out/minikube-windows-amd64 out/minikube-windows-amd64.exe
9595

9696
out/minikube.d: pkg/minikube/assets/assets.go
97-
$(MAKEDEPEND) out/minikube-$(GOOS)-$(GOARCH) $(ORG) $(MINIKUBEFILES) $^ > $@
97+
$(MAKEDEPEND) out/minikube-$(GOOS)-$(GOARCH) $(ORG) $^ $(MINIKUBEFILES) > $@
9898

9999
-include out/minikube.d
100100
out/minikube-%-$(GOARCH): pkg/minikube/assets/assets.go
@@ -189,7 +189,7 @@ integration-versioned: out/minikube
189189

190190
.PHONY: test
191191
out/test.d: pkg/minikube/assets/assets.go
192-
$(MAKEDEPEND) -t test $(ORG) $(MINIKUBE_TEST_FILES) $^ > $@
192+
$(MAKEDEPEND) -t test $(ORG) $^ $(MINIKUBE_TEST_FILES) > $@
193193

194194
-include out/test.d
195195
test:
@@ -263,7 +263,7 @@ out/minikube-installer.exe: out/minikube-windows-amd64.exe
263263
rm -rf out/windows_tmp
264264

265265
out/docker-machine-driver-hyperkit.d:
266-
$(MAKEDEPEND) out/docker-machine-driver-hyperkit $(ORG) $(HYPERKIT_FILES) $^ > $@
266+
$(MAKEDEPEND) out/docker-machine-driver-hyperkit $(ORG) $^ $(HYPERKIT_FILES) > $@
267267

268268
-include out/docker-machine-driver-hyperkit.d
269269
out/docker-machine-driver-hyperkit:
@@ -290,7 +290,7 @@ $(ISO_BUILD_IMAGE): deploy/iso/minikube-iso/Dockerfile
290290
@echo "$(@) successfully built"
291291

292292
out/storage-provisioner.d:
293-
$(MAKEDEPEND) out/storage-provisioner $(ORG) $(STORAGE_PROVISIONER_FILES) $^ > $@
293+
$(MAKEDEPEND) out/storage-provisioner $(ORG) $^ $(STORAGE_PROVISIONER_FILES) > $@
294294

295295
-include out/storage-provisioner.d
296296
out/storage-provisioner:
@@ -327,7 +327,7 @@ release-minikube: out/minikube checksum
327327
gsutil cp out/minikube-$(GOOS)-$(GOARCH).sha256 $(MINIKUBE_UPLOAD_LOCATION)/$(MINIKUBE_VERSION)/minikube-$(GOOS)-$(GOARCH).sha256
328328

329329
out/docker-machine-driver-kvm2.d:
330-
$(MAKEDEPEND) out/docker-machine-driver-kvm2 $(ORG) $(KVM_DRIVER_FILES) $^ > $@
330+
$(MAKEDEPEND) out/docker-machine-driver-kvm2 $(ORG) $^ $(KVM_DRIVER_FILES) > $@
331331

332332
-include out/docker-machine-driver-kvm2.d
333333
out/docker-machine-driver-kvm2:

makedepend.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
# Generate go dependencies, for make. Uses `go list".
18-
# Usage: makedepend.sh [-t] output package path [extra]
17+
# Generate go dependencies, for make. Uses `go list`.
18+
# Usage: makedepend.sh [-t] output package extra path...
1919

2020
PATH_FORMAT='{{ .ImportPath }}{{"\n"}}{{join .Deps "\n"}}'
2121
FILE_FORMAT='{{ range $file := .GoFiles }} {{$.Dir}}/{{$file}}{{"\n"}}{{end}}'
@@ -28,14 +28,14 @@ fi
2828

2929
out=$1
3030
pkg=$2
31-
path=$3
32-
extra=$4
31+
extra=$3
32+
paths="$4 $5 $6"
3333

3434
# check for mandatory parameters
35-
test -n "$out$pkg$path" || exit 1
35+
test -n "$out$pkg$paths" || exit 1
3636

3737
echo "$out: $extra\\"
38-
go list -f "$PATH_FORMAT" $path |
38+
go list -f "$PATH_FORMAT" $paths |
3939
grep "$pkg" |
4040
xargs go list -f "$FILE_FORMAT" |
4141
sed -e "s|^ ${GOPATH}| \$(GOPATH)|;s/$/ \\\\/"

test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ echo "Running go tests..."
3434
cd ${GOPATH}/src/${REPO_PATH}
3535
rm -f out/$COV_FILE || true
3636
echo "mode: count" > out/$COV_FILE
37-
for pkg in $(go list -f '{{ if .TestGoFiles }} {{.ImportPath}} {{end}}' ./...); do
37+
for pkg in $(go list -f '{{ if .TestGoFiles }} {{.ImportPath}} {{end}}' ./cmd/... ./pkg/...); do
3838
go test -tags "container_image_ostree_stub containers_image_openpgp" -v $pkg -covermode=count -coverprofile=out/$COV_TMP_FILE
3939
# tail -n +2 skips the first line of the file
4040
# for coverprofile the first line is the `mode: count` line which we only want once in our file

0 commit comments

Comments
 (0)