-
Notifications
You must be signed in to change notification settings - Fork 720
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools/pd-ut: accelarate build by
compile-without-link
(#8069)
ref #7969 Signed-off-by: husharp <[email protected]> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
f5fd36f
commit 22543a9
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
# See https://gist.github.com/howardjohn/c0f5d0bc293ef7d7fada533a2c9ffaf4 | ||
# Usage: go test -exec=true -toolexec=go-compile-without-link -vet=off ./... | ||
# Preferably as an alias like `alias go-test-compile='go test -exec=true -toolexec=go-compile-without-link -vet=off'` | ||
# This will compile all tests, but not link them (which is the least cacheable part) | ||
|
||
if [[ "${2}" == "-V=full" ]]; then | ||
"$@" | ||
exit 0 | ||
fi | ||
case "$(basename ${1})" in | ||
link) | ||
# Output a dummy file | ||
touch "${3}" | ||
;; | ||
# We could skip vet as well, but it can be done with -vet=off if desired | ||
*) | ||
"$@" | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters